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