wolfSSL 3.11.1 for TLS1.3 beta

Fork of wolfSSL by wolf SSL

Committer:
wolfSSL
Date:
Tue May 02 08:44:47 2017 +0000
Revision:
7:481bce714567
wolfSSL3.10.2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 7:481bce714567 1 /* error.c
wolfSSL 7:481bce714567 2 *
wolfSSL 7:481bce714567 3 * Copyright (C) 2006-2016 wolfSSL Inc.
wolfSSL 7:481bce714567 4 *
wolfSSL 7:481bce714567 5 * This file is part of wolfSSL.
wolfSSL 7:481bce714567 6 *
wolfSSL 7:481bce714567 7 * wolfSSL is free software; you can redistribute it and/or modify
wolfSSL 7:481bce714567 8 * it under the terms of the GNU General Public License as published by
wolfSSL 7:481bce714567 9 * the Free Software Foundation; either version 2 of the License, or
wolfSSL 7:481bce714567 10 * (at your option) any later version.
wolfSSL 7:481bce714567 11 *
wolfSSL 7:481bce714567 12 * wolfSSL is distributed in the hope that it will be useful,
wolfSSL 7:481bce714567 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
wolfSSL 7:481bce714567 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wolfSSL 7:481bce714567 15 * GNU General Public License for more details.
wolfSSL 7:481bce714567 16 *
wolfSSL 7:481bce714567 17 * You should have received a copy of the GNU General Public License
wolfSSL 7:481bce714567 18 * along with this program; if not, write to the Free Software
wolfSSL 7:481bce714567 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
wolfSSL 7:481bce714567 20 */
wolfSSL 7:481bce714567 21
wolfSSL 7:481bce714567 22
wolfSSL 7:481bce714567 23 #ifdef HAVE_CONFIG_H
wolfSSL 7:481bce714567 24 #include <config.h>
wolfSSL 7:481bce714567 25 #endif
wolfSSL 7:481bce714567 26
wolfSSL 7:481bce714567 27 #include <wolfssl/wolfcrypt/settings.h>
wolfSSL 7:481bce714567 28
wolfSSL 7:481bce714567 29 #include <wolfssl/wolfcrypt/error-crypt.h>
wolfSSL 7:481bce714567 30
wolfSSL 7:481bce714567 31 #ifdef _MSC_VER
wolfSSL 7:481bce714567 32 /* 4996 warning to use MS extensions e.g., strcpy_s instead of XSTRNCPY */
wolfSSL 7:481bce714567 33 #pragma warning(disable: 4996)
wolfSSL 7:481bce714567 34 #endif
wolfSSL 7:481bce714567 35
wolfSSL 7:481bce714567 36 const char* wc_GetErrorString(int error)
wolfSSL 7:481bce714567 37 {
wolfSSL 7:481bce714567 38 #ifdef NO_ERROR_STRINGS
wolfSSL 7:481bce714567 39
wolfSSL 7:481bce714567 40 (void)error;
wolfSSL 7:481bce714567 41 return "no support for error strings built in";
wolfSSL 7:481bce714567 42
wolfSSL 7:481bce714567 43 #else
wolfSSL 7:481bce714567 44
wolfSSL 7:481bce714567 45 switch (error) {
wolfSSL 7:481bce714567 46
wolfSSL 7:481bce714567 47 case OPEN_RAN_E :
wolfSSL 7:481bce714567 48 return "opening random device error";
wolfSSL 7:481bce714567 49
wolfSSL 7:481bce714567 50 case READ_RAN_E :
wolfSSL 7:481bce714567 51 return "reading random device error";
wolfSSL 7:481bce714567 52
wolfSSL 7:481bce714567 53 case WINCRYPT_E :
wolfSSL 7:481bce714567 54 return "windows crypt init error";
wolfSSL 7:481bce714567 55
wolfSSL 7:481bce714567 56 case CRYPTGEN_E :
wolfSSL 7:481bce714567 57 return "windows crypt generation error";
wolfSSL 7:481bce714567 58
wolfSSL 7:481bce714567 59 case RAN_BLOCK_E :
wolfSSL 7:481bce714567 60 return "random device read would block error";
wolfSSL 7:481bce714567 61
wolfSSL 7:481bce714567 62 case BAD_MUTEX_E :
wolfSSL 7:481bce714567 63 return "Bad mutex, operation failed";
wolfSSL 7:481bce714567 64
wolfSSL 7:481bce714567 65 case WC_TIMEOUT_E:
wolfSSL 7:481bce714567 66 return "Timeout error";
wolfSSL 7:481bce714567 67
wolfSSL 7:481bce714567 68 case WC_PENDING_E:
wolfSSL 7:481bce714567 69 return "wolfCrypt Operation Pending (would block / eagain) error";
wolfSSL 7:481bce714567 70
wolfSSL 7:481bce714567 71 case WC_NOT_PENDING_E:
wolfSSL 7:481bce714567 72 return "wolfCrypt operation not pending error";
wolfSSL 7:481bce714567 73
wolfSSL 7:481bce714567 74 case MP_INIT_E :
wolfSSL 7:481bce714567 75 return "mp_init error state";
wolfSSL 7:481bce714567 76
wolfSSL 7:481bce714567 77 case MP_READ_E :
wolfSSL 7:481bce714567 78 return "mp_read error state";
wolfSSL 7:481bce714567 79
wolfSSL 7:481bce714567 80 case MP_EXPTMOD_E :
wolfSSL 7:481bce714567 81 return "mp_exptmod error state";
wolfSSL 7:481bce714567 82
wolfSSL 7:481bce714567 83 case MP_TO_E :
wolfSSL 7:481bce714567 84 return "mp_to_xxx error state, can't convert";
wolfSSL 7:481bce714567 85
wolfSSL 7:481bce714567 86 case MP_SUB_E :
wolfSSL 7:481bce714567 87 return "mp_sub error state, can't subtract";
wolfSSL 7:481bce714567 88
wolfSSL 7:481bce714567 89 case MP_ADD_E :
wolfSSL 7:481bce714567 90 return "mp_add error state, can't add";
wolfSSL 7:481bce714567 91
wolfSSL 7:481bce714567 92 case MP_MUL_E :
wolfSSL 7:481bce714567 93 return "mp_mul error state, can't multiply";
wolfSSL 7:481bce714567 94
wolfSSL 7:481bce714567 95 case MP_MULMOD_E :
wolfSSL 7:481bce714567 96 return "mp_mulmod error state, can't multiply mod";
wolfSSL 7:481bce714567 97
wolfSSL 7:481bce714567 98 case MP_MOD_E :
wolfSSL 7:481bce714567 99 return "mp_mod error state, can't mod";
wolfSSL 7:481bce714567 100
wolfSSL 7:481bce714567 101 case MP_INVMOD_E :
wolfSSL 7:481bce714567 102 return "mp_invmod error state, can't inv mod";
wolfSSL 7:481bce714567 103
wolfSSL 7:481bce714567 104 case MP_CMP_E :
wolfSSL 7:481bce714567 105 return "mp_cmp error state";
wolfSSL 7:481bce714567 106
wolfSSL 7:481bce714567 107 case MP_ZERO_E :
wolfSSL 7:481bce714567 108 return "mp zero result, not expected";
wolfSSL 7:481bce714567 109
wolfSSL 7:481bce714567 110 case MEMORY_E :
wolfSSL 7:481bce714567 111 return "out of memory error";
wolfSSL 7:481bce714567 112
wolfSSL 7:481bce714567 113 case VAR_STATE_CHANGE_E :
wolfSSL 7:481bce714567 114 return "Variable state modified by different thread";
wolfSSL 7:481bce714567 115
wolfSSL 7:481bce714567 116 case RSA_WRONG_TYPE_E :
wolfSSL 7:481bce714567 117 return "RSA wrong block type for RSA function";
wolfSSL 7:481bce714567 118
wolfSSL 7:481bce714567 119 case RSA_BUFFER_E :
wolfSSL 7:481bce714567 120 return "RSA buffer error, output too small or input too big";
wolfSSL 7:481bce714567 121
wolfSSL 7:481bce714567 122 case BUFFER_E :
wolfSSL 7:481bce714567 123 return "Buffer error, output too small or input too big";
wolfSSL 7:481bce714567 124
wolfSSL 7:481bce714567 125 case ALGO_ID_E :
wolfSSL 7:481bce714567 126 return "Setting Cert AlgoID error";
wolfSSL 7:481bce714567 127
wolfSSL 7:481bce714567 128 case PUBLIC_KEY_E :
wolfSSL 7:481bce714567 129 return "Setting Cert Public Key error";
wolfSSL 7:481bce714567 130
wolfSSL 7:481bce714567 131 case DATE_E :
wolfSSL 7:481bce714567 132 return "Setting Cert Date validity error";
wolfSSL 7:481bce714567 133
wolfSSL 7:481bce714567 134 case SUBJECT_E :
wolfSSL 7:481bce714567 135 return "Setting Cert Subject name error";
wolfSSL 7:481bce714567 136
wolfSSL 7:481bce714567 137 case ISSUER_E :
wolfSSL 7:481bce714567 138 return "Setting Cert Issuer name error";
wolfSSL 7:481bce714567 139
wolfSSL 7:481bce714567 140 case CA_TRUE_E :
wolfSSL 7:481bce714567 141 return "Setting basic constraint CA true error";
wolfSSL 7:481bce714567 142
wolfSSL 7:481bce714567 143 case EXTENSIONS_E :
wolfSSL 7:481bce714567 144 return "Setting extensions error";
wolfSSL 7:481bce714567 145
wolfSSL 7:481bce714567 146 case ASN_PARSE_E :
wolfSSL 7:481bce714567 147 return "ASN parsing error, invalid input";
wolfSSL 7:481bce714567 148
wolfSSL 7:481bce714567 149 case ASN_VERSION_E :
wolfSSL 7:481bce714567 150 return "ASN version error, invalid number";
wolfSSL 7:481bce714567 151
wolfSSL 7:481bce714567 152 case ASN_GETINT_E :
wolfSSL 7:481bce714567 153 return "ASN get big int error, invalid data";
wolfSSL 7:481bce714567 154
wolfSSL 7:481bce714567 155 case ASN_RSA_KEY_E :
wolfSSL 7:481bce714567 156 return "ASN key init error, invalid input";
wolfSSL 7:481bce714567 157
wolfSSL 7:481bce714567 158 case ASN_OBJECT_ID_E :
wolfSSL 7:481bce714567 159 return "ASN object id error, invalid id";
wolfSSL 7:481bce714567 160
wolfSSL 7:481bce714567 161 case ASN_TAG_NULL_E :
wolfSSL 7:481bce714567 162 return "ASN tag error, not null";
wolfSSL 7:481bce714567 163
wolfSSL 7:481bce714567 164 case ASN_EXPECT_0_E :
wolfSSL 7:481bce714567 165 return "ASN expect error, not zero";
wolfSSL 7:481bce714567 166
wolfSSL 7:481bce714567 167 case ASN_BITSTR_E :
wolfSSL 7:481bce714567 168 return "ASN bit string error, wrong id";
wolfSSL 7:481bce714567 169
wolfSSL 7:481bce714567 170 case ASN_UNKNOWN_OID_E :
wolfSSL 7:481bce714567 171 return "ASN oid error, unknown sum id";
wolfSSL 7:481bce714567 172
wolfSSL 7:481bce714567 173 case ASN_DATE_SZ_E :
wolfSSL 7:481bce714567 174 return "ASN date error, bad size";
wolfSSL 7:481bce714567 175
wolfSSL 7:481bce714567 176 case ASN_BEFORE_DATE_E :
wolfSSL 7:481bce714567 177 return "ASN date error, current date before";
wolfSSL 7:481bce714567 178
wolfSSL 7:481bce714567 179 case ASN_AFTER_DATE_E :
wolfSSL 7:481bce714567 180 return "ASN date error, current date after";
wolfSSL 7:481bce714567 181
wolfSSL 7:481bce714567 182 case ASN_SIG_OID_E :
wolfSSL 7:481bce714567 183 return "ASN signature error, mismatched oid";
wolfSSL 7:481bce714567 184
wolfSSL 7:481bce714567 185 case ASN_TIME_E :
wolfSSL 7:481bce714567 186 return "ASN time error, unknown time type";
wolfSSL 7:481bce714567 187
wolfSSL 7:481bce714567 188 case ASN_INPUT_E :
wolfSSL 7:481bce714567 189 return "ASN input error, not enough data";
wolfSSL 7:481bce714567 190
wolfSSL 7:481bce714567 191 case ASN_SIG_CONFIRM_E :
wolfSSL 7:481bce714567 192 return "ASN sig error, confirm failure";
wolfSSL 7:481bce714567 193
wolfSSL 7:481bce714567 194 case ASN_SIG_HASH_E :
wolfSSL 7:481bce714567 195 return "ASN sig error, unsupported hash type";
wolfSSL 7:481bce714567 196
wolfSSL 7:481bce714567 197 case ASN_SIG_KEY_E :
wolfSSL 7:481bce714567 198 return "ASN sig error, unsupported key type";
wolfSSL 7:481bce714567 199
wolfSSL 7:481bce714567 200 case ASN_DH_KEY_E :
wolfSSL 7:481bce714567 201 return "ASN key init error, invalid input";
wolfSSL 7:481bce714567 202
wolfSSL 7:481bce714567 203 case ASN_NTRU_KEY_E :
wolfSSL 7:481bce714567 204 return "ASN NTRU key decode error, invalid input";
wolfSSL 7:481bce714567 205
wolfSSL 7:481bce714567 206 case ASN_CRIT_EXT_E:
wolfSSL 7:481bce714567 207 return "X.509 Critical extension ignored";
wolfSSL 7:481bce714567 208
wolfSSL 7:481bce714567 209 case ECC_BAD_ARG_E :
wolfSSL 7:481bce714567 210 return "ECC input argument wrong type, invalid input";
wolfSSL 7:481bce714567 211
wolfSSL 7:481bce714567 212 case ASN_ECC_KEY_E :
wolfSSL 7:481bce714567 213 return "ECC ASN1 bad key data, invalid input";
wolfSSL 7:481bce714567 214
wolfSSL 7:481bce714567 215 case ECC_CURVE_OID_E :
wolfSSL 7:481bce714567 216 return "ECC curve sum OID unsupported, invalid input";
wolfSSL 7:481bce714567 217
wolfSSL 7:481bce714567 218 case BAD_FUNC_ARG :
wolfSSL 7:481bce714567 219 return "Bad function argument";
wolfSSL 7:481bce714567 220
wolfSSL 7:481bce714567 221 case NOT_COMPILED_IN :
wolfSSL 7:481bce714567 222 return "Feature not compiled in";
wolfSSL 7:481bce714567 223
wolfSSL 7:481bce714567 224 case UNICODE_SIZE_E :
wolfSSL 7:481bce714567 225 return "Unicode password too big";
wolfSSL 7:481bce714567 226
wolfSSL 7:481bce714567 227 case NO_PASSWORD :
wolfSSL 7:481bce714567 228 return "No password provided by user";
wolfSSL 7:481bce714567 229
wolfSSL 7:481bce714567 230 case ALT_NAME_E :
wolfSSL 7:481bce714567 231 return "Alt Name problem, too big";
wolfSSL 7:481bce714567 232
wolfSSL 7:481bce714567 233 case AES_GCM_AUTH_E:
wolfSSL 7:481bce714567 234 return "AES-GCM Authentication check fail";
wolfSSL 7:481bce714567 235
wolfSSL 7:481bce714567 236 case AES_CCM_AUTH_E:
wolfSSL 7:481bce714567 237 return "AES-CCM Authentication check fail";
wolfSSL 7:481bce714567 238
wolfSSL 7:481bce714567 239 case ASYNC_INIT_E:
wolfSSL 7:481bce714567 240 return "Async Init error";
wolfSSL 7:481bce714567 241
wolfSSL 7:481bce714567 242 case COMPRESS_INIT_E:
wolfSSL 7:481bce714567 243 return "Compress Init error";
wolfSSL 7:481bce714567 244
wolfSSL 7:481bce714567 245 case COMPRESS_E:
wolfSSL 7:481bce714567 246 return "Compress error";
wolfSSL 7:481bce714567 247
wolfSSL 7:481bce714567 248 case DECOMPRESS_INIT_E:
wolfSSL 7:481bce714567 249 return "DeCompress Init error";
wolfSSL 7:481bce714567 250
wolfSSL 7:481bce714567 251 case DECOMPRESS_E:
wolfSSL 7:481bce714567 252 return "DeCompress error";
wolfSSL 7:481bce714567 253
wolfSSL 7:481bce714567 254 case BAD_ALIGN_E:
wolfSSL 7:481bce714567 255 return "Bad alignment error, no alloc help";
wolfSSL 7:481bce714567 256
wolfSSL 7:481bce714567 257 case ASN_NO_SIGNER_E :
wolfSSL 7:481bce714567 258 return "ASN no signer error to confirm failure";
wolfSSL 7:481bce714567 259
wolfSSL 7:481bce714567 260 case ASN_CRL_CONFIRM_E :
wolfSSL 7:481bce714567 261 return "ASN CRL sig error, confirm failure";
wolfSSL 7:481bce714567 262
wolfSSL 7:481bce714567 263 case ASN_CRL_NO_SIGNER_E :
wolfSSL 7:481bce714567 264 return "ASN CRL no signer error to confirm failure";
wolfSSL 7:481bce714567 265
wolfSSL 7:481bce714567 266 case ASN_OCSP_CONFIRM_E :
wolfSSL 7:481bce714567 267 return "ASN OCSP sig error, confirm failure";
wolfSSL 7:481bce714567 268
wolfSSL 7:481bce714567 269 case BAD_STATE_E:
wolfSSL 7:481bce714567 270 return "Bad state operation";
wolfSSL 7:481bce714567 271
wolfSSL 7:481bce714567 272 case BAD_PADDING_E:
wolfSSL 7:481bce714567 273 return "Bad padding, message wrong length";
wolfSSL 7:481bce714567 274
wolfSSL 7:481bce714567 275 case REQ_ATTRIBUTE_E:
wolfSSL 7:481bce714567 276 return "Setting cert request attributes error";
wolfSSL 7:481bce714567 277
wolfSSL 7:481bce714567 278 case PKCS7_OID_E:
wolfSSL 7:481bce714567 279 return "PKCS#7 error: mismatched OID value";
wolfSSL 7:481bce714567 280
wolfSSL 7:481bce714567 281 case PKCS7_RECIP_E:
wolfSSL 7:481bce714567 282 return "PKCS#7 error: no matching recipient found";
wolfSSL 7:481bce714567 283
wolfSSL 7:481bce714567 284 case FIPS_NOT_ALLOWED_E:
wolfSSL 7:481bce714567 285 return "FIPS mode not allowed error";
wolfSSL 7:481bce714567 286
wolfSSL 7:481bce714567 287 case ASN_NAME_INVALID_E:
wolfSSL 7:481bce714567 288 return "Name Constraint error";
wolfSSL 7:481bce714567 289
wolfSSL 7:481bce714567 290 case RNG_FAILURE_E:
wolfSSL 7:481bce714567 291 return "Random Number Generator failed";
wolfSSL 7:481bce714567 292
wolfSSL 7:481bce714567 293 case HMAC_MIN_KEYLEN_E:
wolfSSL 7:481bce714567 294 return "FIPS Mode HMAC Minimum Key Length error";
wolfSSL 7:481bce714567 295
wolfSSL 7:481bce714567 296 case RSA_PAD_E:
wolfSSL 7:481bce714567 297 return "Rsa Padding error";
wolfSSL 7:481bce714567 298
wolfSSL 7:481bce714567 299 case LENGTH_ONLY_E:
wolfSSL 7:481bce714567 300 return "Output length only set, not for other use error";
wolfSSL 7:481bce714567 301
wolfSSL 7:481bce714567 302 case IN_CORE_FIPS_E:
wolfSSL 7:481bce714567 303 return "In Core Integrity check FIPS error";
wolfSSL 7:481bce714567 304
wolfSSL 7:481bce714567 305 case AES_KAT_FIPS_E:
wolfSSL 7:481bce714567 306 return "AES Known Answer Test check FIPS error";
wolfSSL 7:481bce714567 307
wolfSSL 7:481bce714567 308 case DES3_KAT_FIPS_E:
wolfSSL 7:481bce714567 309 return "DES3 Known Answer Test check FIPS error";
wolfSSL 7:481bce714567 310
wolfSSL 7:481bce714567 311 case HMAC_KAT_FIPS_E:
wolfSSL 7:481bce714567 312 return "HMAC Known Answer Test check FIPS error";
wolfSSL 7:481bce714567 313
wolfSSL 7:481bce714567 314 case RSA_KAT_FIPS_E:
wolfSSL 7:481bce714567 315 return "RSA Known Answer Test check FIPS error";
wolfSSL 7:481bce714567 316
wolfSSL 7:481bce714567 317 case DRBG_KAT_FIPS_E:
wolfSSL 7:481bce714567 318 return "DRBG Known Answer Test check FIPS error";
wolfSSL 7:481bce714567 319
wolfSSL 7:481bce714567 320 case DRBG_CONT_FIPS_E:
wolfSSL 7:481bce714567 321 return "DRBG Continuous Test FIPS error";
wolfSSL 7:481bce714567 322
wolfSSL 7:481bce714567 323 case AESGCM_KAT_FIPS_E:
wolfSSL 7:481bce714567 324 return "AESGCM Known Answer Test check FIPS error";
wolfSSL 7:481bce714567 325
wolfSSL 7:481bce714567 326 case THREAD_STORE_KEY_E:
wolfSSL 7:481bce714567 327 return "Thread Storage Key Create error";
wolfSSL 7:481bce714567 328
wolfSSL 7:481bce714567 329 case THREAD_STORE_SET_E:
wolfSSL 7:481bce714567 330 return "Thread Storage Set error";
wolfSSL 7:481bce714567 331
wolfSSL 7:481bce714567 332 case MAC_CMP_FAILED_E:
wolfSSL 7:481bce714567 333 return "MAC comparison failed";
wolfSSL 7:481bce714567 334
wolfSSL 7:481bce714567 335 case IS_POINT_E:
wolfSSL 7:481bce714567 336 return "ECC is point on curve failed";
wolfSSL 7:481bce714567 337
wolfSSL 7:481bce714567 338 case ECC_INF_E:
wolfSSL 7:481bce714567 339 return " ECC point at infinity error";
wolfSSL 7:481bce714567 340
wolfSSL 7:481bce714567 341 case ECC_OUT_OF_RANGE_E:
wolfSSL 7:481bce714567 342 return " ECC Qx or Qy out of range error";
wolfSSL 7:481bce714567 343
wolfSSL 7:481bce714567 344 case ECC_PRIV_KEY_E:
wolfSSL 7:481bce714567 345 return " ECC private key is not valid error";
wolfSSL 7:481bce714567 346
wolfSSL 7:481bce714567 347 case SRP_CALL_ORDER_E:
wolfSSL 7:481bce714567 348 return "SRP function called in the wrong order error";
wolfSSL 7:481bce714567 349
wolfSSL 7:481bce714567 350 case SRP_VERIFY_E:
wolfSSL 7:481bce714567 351 return "SRP proof verification error";
wolfSSL 7:481bce714567 352
wolfSSL 7:481bce714567 353 case SRP_BAD_KEY_E:
wolfSSL 7:481bce714567 354 return "SRP bad key values error";
wolfSSL 7:481bce714567 355
wolfSSL 7:481bce714567 356 case ASN_NO_SKID:
wolfSSL 7:481bce714567 357 return "ASN no Subject Key Identifier found error";
wolfSSL 7:481bce714567 358
wolfSSL 7:481bce714567 359 case ASN_NO_AKID:
wolfSSL 7:481bce714567 360 return "ASN no Authority Key Identifier found error";
wolfSSL 7:481bce714567 361
wolfSSL 7:481bce714567 362 case ASN_NO_KEYUSAGE:
wolfSSL 7:481bce714567 363 return "ASN no Key Usage found error";
wolfSSL 7:481bce714567 364
wolfSSL 7:481bce714567 365 case SKID_E:
wolfSSL 7:481bce714567 366 return "Setting Subject Key Identifier error";
wolfSSL 7:481bce714567 367
wolfSSL 7:481bce714567 368 case AKID_E:
wolfSSL 7:481bce714567 369 return "Setting Authority Key Identifier error";
wolfSSL 7:481bce714567 370
wolfSSL 7:481bce714567 371 case KEYUSAGE_E:
wolfSSL 7:481bce714567 372 return "Bad Key Usage value error";
wolfSSL 7:481bce714567 373
wolfSSL 7:481bce714567 374 case CERTPOLICIES_E:
wolfSSL 7:481bce714567 375 return "Setting Certificate Policies error";
wolfSSL 7:481bce714567 376
wolfSSL 7:481bce714567 377 case WC_INIT_E:
wolfSSL 7:481bce714567 378 return "wolfCrypt Initialize Failure error";
wolfSSL 7:481bce714567 379
wolfSSL 7:481bce714567 380 case SIG_VERIFY_E:
wolfSSL 7:481bce714567 381 return "Signature verify error";
wolfSSL 7:481bce714567 382
wolfSSL 7:481bce714567 383 case BAD_COND_E:
wolfSSL 7:481bce714567 384 return "Bad condition variable operation error";
wolfSSL 7:481bce714567 385
wolfSSL 7:481bce714567 386 case SIG_TYPE_E:
wolfSSL 7:481bce714567 387 return "Signature type not enabled/available";
wolfSSL 7:481bce714567 388
wolfSSL 7:481bce714567 389 case HASH_TYPE_E:
wolfSSL 7:481bce714567 390 return "Hash type not enabled/available";
wolfSSL 7:481bce714567 391
wolfSSL 7:481bce714567 392 case WC_KEY_SIZE_E:
wolfSSL 7:481bce714567 393 return "Key size error, either too small or large";
wolfSSL 7:481bce714567 394
wolfSSL 7:481bce714567 395 case ASN_COUNTRY_SIZE_E:
wolfSSL 7:481bce714567 396 return "Country code size error, either too small or large";
wolfSSL 7:481bce714567 397
wolfSSL 7:481bce714567 398 case MISSING_RNG_E:
wolfSSL 7:481bce714567 399 return "RNG required but not provided";
wolfSSL 7:481bce714567 400
wolfSSL 7:481bce714567 401 case ASN_PATHLEN_SIZE_E:
wolfSSL 7:481bce714567 402 return "ASN CA path length value too large error";
wolfSSL 7:481bce714567 403
wolfSSL 7:481bce714567 404 case ASN_PATHLEN_INV_E:
wolfSSL 7:481bce714567 405 return "ASN CA path length larger than signer error";
wolfSSL 7:481bce714567 406
wolfSSL 7:481bce714567 407 case BAD_KEYWRAP_ALG_E:
wolfSSL 7:481bce714567 408 return "Unsupported key wrap algorithm error";
wolfSSL 7:481bce714567 409
wolfSSL 7:481bce714567 410 case BAD_KEYWRAP_IV_E:
wolfSSL 7:481bce714567 411 return "Decrypted AES key wrap IV does not match expected";
wolfSSL 7:481bce714567 412
wolfSSL 7:481bce714567 413 case WC_CLEANUP_E:
wolfSSL 7:481bce714567 414 return "wolfcrypt cleanup failed";
wolfSSL 7:481bce714567 415
wolfSSL 7:481bce714567 416 case ECC_CDH_KAT_FIPS_E:
wolfSSL 7:481bce714567 417 return "wolfcrypt FIPS ECC CDH Known Answer Test Failure";
wolfSSL 7:481bce714567 418
wolfSSL 7:481bce714567 419 case DH_CHECK_PUB_E:
wolfSSL 7:481bce714567 420 return "DH Check Public Key failure";
wolfSSL 7:481bce714567 421
wolfSSL 7:481bce714567 422 case BAD_PATH_ERROR:
wolfSSL 7:481bce714567 423 return "Bad path for opendir error";
wolfSSL 7:481bce714567 424
wolfSSL 7:481bce714567 425 default:
wolfSSL 7:481bce714567 426 return "unknown error number";
wolfSSL 7:481bce714567 427
wolfSSL 7:481bce714567 428 }
wolfSSL 7:481bce714567 429
wolfSSL 7:481bce714567 430 #endif /* NO_ERROR_STRINGS */
wolfSSL 7:481bce714567 431
wolfSSL 7:481bce714567 432 }
wolfSSL 7:481bce714567 433
wolfSSL 7:481bce714567 434 void wc_ErrorString(int error, char* buffer)
wolfSSL 7:481bce714567 435 {
wolfSSL 7:481bce714567 436 XSTRNCPY(buffer, wc_GetErrorString(error), WOLFSSL_MAX_ERROR_SZ);
wolfSSL 7:481bce714567 437 }
wolfSSL 7:481bce714567 438