Fork of CyaSSL for my specific settings
Fork of CyaSSL by
ctaocrypt/src/error.c@4:28ac50e1d49c, 2015-03-03 (annotated)
- Committer:
- d0773d
- Date:
- Tue Mar 03 22:52:52 2015 +0000
- Revision:
- 4:28ac50e1d49c
- Parent:
- 0:1239e9b70ca2
CyaSSL example
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wolfSSL | 0:1239e9b70ca2 | 1 | /* error.c |
wolfSSL | 0:1239e9b70ca2 | 2 | * |
wolfSSL | 0:1239e9b70ca2 | 3 | * Copyright (C) 2006-2014 wolfSSL Inc. |
wolfSSL | 0:1239e9b70ca2 | 4 | * |
wolfSSL | 0:1239e9b70ca2 | 5 | * This file is part of CyaSSL. |
wolfSSL | 0:1239e9b70ca2 | 6 | * |
wolfSSL | 0:1239e9b70ca2 | 7 | * CyaSSL is free software; you can redistribute it and/or modify |
wolfSSL | 0:1239e9b70ca2 | 8 | * it under the terms of the GNU General Public License as published by |
wolfSSL | 0:1239e9b70ca2 | 9 | * the Free Software Foundation; either version 2 of the License, or |
wolfSSL | 0:1239e9b70ca2 | 10 | * (at your option) any later version. |
wolfSSL | 0:1239e9b70ca2 | 11 | * |
wolfSSL | 0:1239e9b70ca2 | 12 | * CyaSSL is distributed in the hope that it will be useful, |
wolfSSL | 0:1239e9b70ca2 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
wolfSSL | 0:1239e9b70ca2 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
wolfSSL | 0:1239e9b70ca2 | 15 | * GNU General Public License for more details. |
wolfSSL | 0:1239e9b70ca2 | 16 | * |
wolfSSL | 0:1239e9b70ca2 | 17 | * You should have received a copy of the GNU General Public License |
wolfSSL | 0:1239e9b70ca2 | 18 | * along with this program; if not, write to the Free Software |
wolfSSL | 0:1239e9b70ca2 | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
wolfSSL | 0:1239e9b70ca2 | 20 | */ |
wolfSSL | 0:1239e9b70ca2 | 21 | |
wolfSSL | 0:1239e9b70ca2 | 22 | #ifdef HAVE_CONFIG_H |
wolfSSL | 0:1239e9b70ca2 | 23 | #include <config.h> |
wolfSSL | 0:1239e9b70ca2 | 24 | #endif |
wolfSSL | 0:1239e9b70ca2 | 25 | |
wolfSSL | 0:1239e9b70ca2 | 26 | #include <cyassl/ctaocrypt/settings.h> |
wolfSSL | 0:1239e9b70ca2 | 27 | |
wolfSSL | 0:1239e9b70ca2 | 28 | #include <cyassl/ctaocrypt/error-crypt.h> |
wolfSSL | 0:1239e9b70ca2 | 29 | |
wolfSSL | 0:1239e9b70ca2 | 30 | #ifdef _MSC_VER |
wolfSSL | 0:1239e9b70ca2 | 31 | /* 4996 warning to use MS extensions e.g., strcpy_s instead of XSTRNCPY */ |
wolfSSL | 0:1239e9b70ca2 | 32 | #pragma warning(disable: 4996) |
wolfSSL | 0:1239e9b70ca2 | 33 | #endif |
wolfSSL | 0:1239e9b70ca2 | 34 | |
wolfSSL | 0:1239e9b70ca2 | 35 | |
wolfSSL | 0:1239e9b70ca2 | 36 | void CTaoCryptErrorString(int error, char* buffer) |
wolfSSL | 0:1239e9b70ca2 | 37 | { |
wolfSSL | 0:1239e9b70ca2 | 38 | const int max = CYASSL_MAX_ERROR_SZ; /* shorthand */ |
wolfSSL | 0:1239e9b70ca2 | 39 | |
wolfSSL | 0:1239e9b70ca2 | 40 | #ifdef NO_ERROR_STRINGS |
wolfSSL | 0:1239e9b70ca2 | 41 | |
wolfSSL | 0:1239e9b70ca2 | 42 | (void)error; |
wolfSSL | 0:1239e9b70ca2 | 43 | XSTRNCPY(buffer, "no support for error strings built in", max); |
wolfSSL | 0:1239e9b70ca2 | 44 | |
wolfSSL | 0:1239e9b70ca2 | 45 | #else |
wolfSSL | 0:1239e9b70ca2 | 46 | |
wolfSSL | 0:1239e9b70ca2 | 47 | switch (error) { |
wolfSSL | 0:1239e9b70ca2 | 48 | |
wolfSSL | 0:1239e9b70ca2 | 49 | case OPEN_RAN_E : |
wolfSSL | 0:1239e9b70ca2 | 50 | XSTRNCPY(buffer, "opening random device error", max); |
wolfSSL | 0:1239e9b70ca2 | 51 | break; |
wolfSSL | 0:1239e9b70ca2 | 52 | |
wolfSSL | 0:1239e9b70ca2 | 53 | case READ_RAN_E : |
wolfSSL | 0:1239e9b70ca2 | 54 | XSTRNCPY(buffer, "reading random device error", max); |
wolfSSL | 0:1239e9b70ca2 | 55 | break; |
wolfSSL | 0:1239e9b70ca2 | 56 | |
wolfSSL | 0:1239e9b70ca2 | 57 | case WINCRYPT_E : |
wolfSSL | 0:1239e9b70ca2 | 58 | XSTRNCPY(buffer, "windows crypt init error", max); |
wolfSSL | 0:1239e9b70ca2 | 59 | break; |
wolfSSL | 0:1239e9b70ca2 | 60 | |
wolfSSL | 0:1239e9b70ca2 | 61 | case CRYPTGEN_E : |
wolfSSL | 0:1239e9b70ca2 | 62 | XSTRNCPY(buffer, "windows crypt generation error", max); |
wolfSSL | 0:1239e9b70ca2 | 63 | break; |
wolfSSL | 0:1239e9b70ca2 | 64 | |
wolfSSL | 0:1239e9b70ca2 | 65 | case RAN_BLOCK_E : |
wolfSSL | 0:1239e9b70ca2 | 66 | XSTRNCPY(buffer, "random device read would block error", max); |
wolfSSL | 0:1239e9b70ca2 | 67 | break; |
wolfSSL | 0:1239e9b70ca2 | 68 | |
wolfSSL | 0:1239e9b70ca2 | 69 | case BAD_MUTEX_E : |
wolfSSL | 0:1239e9b70ca2 | 70 | XSTRNCPY(buffer, "Bad mutex, operation failed", max); |
wolfSSL | 0:1239e9b70ca2 | 71 | break; |
wolfSSL | 0:1239e9b70ca2 | 72 | |
wolfSSL | 0:1239e9b70ca2 | 73 | case MP_INIT_E : |
wolfSSL | 0:1239e9b70ca2 | 74 | XSTRNCPY(buffer, "mp_init error state", max); |
wolfSSL | 0:1239e9b70ca2 | 75 | break; |
wolfSSL | 0:1239e9b70ca2 | 76 | |
wolfSSL | 0:1239e9b70ca2 | 77 | case MP_READ_E : |
wolfSSL | 0:1239e9b70ca2 | 78 | XSTRNCPY(buffer, "mp_read error state", max); |
wolfSSL | 0:1239e9b70ca2 | 79 | break; |
wolfSSL | 0:1239e9b70ca2 | 80 | |
wolfSSL | 0:1239e9b70ca2 | 81 | case MP_EXPTMOD_E : |
wolfSSL | 0:1239e9b70ca2 | 82 | XSTRNCPY(buffer, "mp_exptmod error state", max); |
wolfSSL | 0:1239e9b70ca2 | 83 | break; |
wolfSSL | 0:1239e9b70ca2 | 84 | |
wolfSSL | 0:1239e9b70ca2 | 85 | case MP_TO_E : |
wolfSSL | 0:1239e9b70ca2 | 86 | XSTRNCPY(buffer, "mp_to_xxx error state, can't convert", max); |
wolfSSL | 0:1239e9b70ca2 | 87 | break; |
wolfSSL | 0:1239e9b70ca2 | 88 | |
wolfSSL | 0:1239e9b70ca2 | 89 | case MP_SUB_E : |
wolfSSL | 0:1239e9b70ca2 | 90 | XSTRNCPY(buffer, "mp_sub error state, can't subtract", max); |
wolfSSL | 0:1239e9b70ca2 | 91 | break; |
wolfSSL | 0:1239e9b70ca2 | 92 | |
wolfSSL | 0:1239e9b70ca2 | 93 | case MP_ADD_E : |
wolfSSL | 0:1239e9b70ca2 | 94 | XSTRNCPY(buffer, "mp_add error state, can't add", max); |
wolfSSL | 0:1239e9b70ca2 | 95 | break; |
wolfSSL | 0:1239e9b70ca2 | 96 | |
wolfSSL | 0:1239e9b70ca2 | 97 | case MP_MUL_E : |
wolfSSL | 0:1239e9b70ca2 | 98 | XSTRNCPY(buffer, "mp_mul error state, can't multiply", max); |
wolfSSL | 0:1239e9b70ca2 | 99 | break; |
wolfSSL | 0:1239e9b70ca2 | 100 | |
wolfSSL | 0:1239e9b70ca2 | 101 | case MP_MULMOD_E : |
wolfSSL | 0:1239e9b70ca2 | 102 | XSTRNCPY(buffer, "mp_mulmod error state, can't multiply mod", max); |
wolfSSL | 0:1239e9b70ca2 | 103 | break; |
wolfSSL | 0:1239e9b70ca2 | 104 | |
wolfSSL | 0:1239e9b70ca2 | 105 | case MP_MOD_E : |
wolfSSL | 0:1239e9b70ca2 | 106 | XSTRNCPY(buffer, "mp_mod error state, can't mod", max); |
wolfSSL | 0:1239e9b70ca2 | 107 | break; |
wolfSSL | 0:1239e9b70ca2 | 108 | |
wolfSSL | 0:1239e9b70ca2 | 109 | case MP_INVMOD_E : |
wolfSSL | 0:1239e9b70ca2 | 110 | XSTRNCPY(buffer, "mp_invmod error state, can't inv mod", max); |
wolfSSL | 0:1239e9b70ca2 | 111 | break; |
wolfSSL | 0:1239e9b70ca2 | 112 | |
wolfSSL | 0:1239e9b70ca2 | 113 | case MP_CMP_E : |
wolfSSL | 0:1239e9b70ca2 | 114 | XSTRNCPY(buffer, "mp_cmp error state", max); |
wolfSSL | 0:1239e9b70ca2 | 115 | break; |
wolfSSL | 0:1239e9b70ca2 | 116 | |
wolfSSL | 0:1239e9b70ca2 | 117 | case MP_ZERO_E : |
wolfSSL | 0:1239e9b70ca2 | 118 | XSTRNCPY(buffer, "mp zero result, not expected", max); |
wolfSSL | 0:1239e9b70ca2 | 119 | break; |
wolfSSL | 0:1239e9b70ca2 | 120 | |
wolfSSL | 0:1239e9b70ca2 | 121 | case MEMORY_E : |
wolfSSL | 0:1239e9b70ca2 | 122 | XSTRNCPY(buffer, "out of memory error", max); |
wolfSSL | 0:1239e9b70ca2 | 123 | break; |
wolfSSL | 0:1239e9b70ca2 | 124 | |
wolfSSL | 0:1239e9b70ca2 | 125 | case RSA_WRONG_TYPE_E : |
wolfSSL | 0:1239e9b70ca2 | 126 | XSTRNCPY(buffer, "RSA wrong block type for RSA function", max); |
wolfSSL | 0:1239e9b70ca2 | 127 | break; |
wolfSSL | 0:1239e9b70ca2 | 128 | |
wolfSSL | 0:1239e9b70ca2 | 129 | case RSA_BUFFER_E : |
wolfSSL | 0:1239e9b70ca2 | 130 | XSTRNCPY(buffer, "RSA buffer error, output too small or input too big", |
wolfSSL | 0:1239e9b70ca2 | 131 | max); |
wolfSSL | 0:1239e9b70ca2 | 132 | break; |
wolfSSL | 0:1239e9b70ca2 | 133 | |
wolfSSL | 0:1239e9b70ca2 | 134 | case BUFFER_E : |
wolfSSL | 0:1239e9b70ca2 | 135 | XSTRNCPY(buffer, "Buffer error, output too small or input too big",max); |
wolfSSL | 0:1239e9b70ca2 | 136 | break; |
wolfSSL | 0:1239e9b70ca2 | 137 | |
wolfSSL | 0:1239e9b70ca2 | 138 | case ALGO_ID_E : |
wolfSSL | 0:1239e9b70ca2 | 139 | XSTRNCPY(buffer, "Setting Cert AlogID error", max); |
wolfSSL | 0:1239e9b70ca2 | 140 | break; |
wolfSSL | 0:1239e9b70ca2 | 141 | |
wolfSSL | 0:1239e9b70ca2 | 142 | case PUBLIC_KEY_E : |
wolfSSL | 0:1239e9b70ca2 | 143 | XSTRNCPY(buffer, "Setting Cert Public Key error", max); |
wolfSSL | 0:1239e9b70ca2 | 144 | break; |
wolfSSL | 0:1239e9b70ca2 | 145 | |
wolfSSL | 0:1239e9b70ca2 | 146 | case DATE_E : |
wolfSSL | 0:1239e9b70ca2 | 147 | XSTRNCPY(buffer, "Setting Cert Date validity error", max); |
wolfSSL | 0:1239e9b70ca2 | 148 | break; |
wolfSSL | 0:1239e9b70ca2 | 149 | |
wolfSSL | 0:1239e9b70ca2 | 150 | case SUBJECT_E : |
wolfSSL | 0:1239e9b70ca2 | 151 | XSTRNCPY(buffer, "Setting Cert Subject name error", max); |
wolfSSL | 0:1239e9b70ca2 | 152 | break; |
wolfSSL | 0:1239e9b70ca2 | 153 | |
wolfSSL | 0:1239e9b70ca2 | 154 | case ISSUER_E : |
wolfSSL | 0:1239e9b70ca2 | 155 | XSTRNCPY(buffer, "Setting Cert Issuer name error", max); |
wolfSSL | 0:1239e9b70ca2 | 156 | break; |
wolfSSL | 0:1239e9b70ca2 | 157 | |
wolfSSL | 0:1239e9b70ca2 | 158 | case CA_TRUE_E : |
wolfSSL | 0:1239e9b70ca2 | 159 | XSTRNCPY(buffer, "Setting basic constraint CA true error", max); |
wolfSSL | 0:1239e9b70ca2 | 160 | break; |
wolfSSL | 0:1239e9b70ca2 | 161 | |
wolfSSL | 0:1239e9b70ca2 | 162 | case EXTENSIONS_E : |
wolfSSL | 0:1239e9b70ca2 | 163 | XSTRNCPY(buffer, "Setting extensions error", max); |
wolfSSL | 0:1239e9b70ca2 | 164 | break; |
wolfSSL | 0:1239e9b70ca2 | 165 | |
wolfSSL | 0:1239e9b70ca2 | 166 | case ASN_PARSE_E : |
wolfSSL | 0:1239e9b70ca2 | 167 | XSTRNCPY(buffer, "ASN parsing error, invalid input", max); |
wolfSSL | 0:1239e9b70ca2 | 168 | break; |
wolfSSL | 0:1239e9b70ca2 | 169 | |
wolfSSL | 0:1239e9b70ca2 | 170 | case ASN_VERSION_E : |
wolfSSL | 0:1239e9b70ca2 | 171 | XSTRNCPY(buffer, "ASN version error, invalid number", max); |
wolfSSL | 0:1239e9b70ca2 | 172 | break; |
wolfSSL | 0:1239e9b70ca2 | 173 | |
wolfSSL | 0:1239e9b70ca2 | 174 | case ASN_GETINT_E : |
wolfSSL | 0:1239e9b70ca2 | 175 | XSTRNCPY(buffer, "ASN get big int error, invalid data", max); |
wolfSSL | 0:1239e9b70ca2 | 176 | break; |
wolfSSL | 0:1239e9b70ca2 | 177 | |
wolfSSL | 0:1239e9b70ca2 | 178 | case ASN_RSA_KEY_E : |
wolfSSL | 0:1239e9b70ca2 | 179 | XSTRNCPY(buffer, "ASN key init error, invalid input", max); |
wolfSSL | 0:1239e9b70ca2 | 180 | break; |
wolfSSL | 0:1239e9b70ca2 | 181 | |
wolfSSL | 0:1239e9b70ca2 | 182 | case ASN_OBJECT_ID_E : |
wolfSSL | 0:1239e9b70ca2 | 183 | XSTRNCPY(buffer, "ASN object id error, invalid id", max); |
wolfSSL | 0:1239e9b70ca2 | 184 | break; |
wolfSSL | 0:1239e9b70ca2 | 185 | |
wolfSSL | 0:1239e9b70ca2 | 186 | case ASN_TAG_NULL_E : |
wolfSSL | 0:1239e9b70ca2 | 187 | XSTRNCPY(buffer, "ASN tag error, not null", max); |
wolfSSL | 0:1239e9b70ca2 | 188 | break; |
wolfSSL | 0:1239e9b70ca2 | 189 | |
wolfSSL | 0:1239e9b70ca2 | 190 | case ASN_EXPECT_0_E : |
wolfSSL | 0:1239e9b70ca2 | 191 | XSTRNCPY(buffer, "ASN expect error, not zero", max); |
wolfSSL | 0:1239e9b70ca2 | 192 | break; |
wolfSSL | 0:1239e9b70ca2 | 193 | |
wolfSSL | 0:1239e9b70ca2 | 194 | case ASN_BITSTR_E : |
wolfSSL | 0:1239e9b70ca2 | 195 | XSTRNCPY(buffer, "ASN bit string error, wrong id", max); |
wolfSSL | 0:1239e9b70ca2 | 196 | break; |
wolfSSL | 0:1239e9b70ca2 | 197 | |
wolfSSL | 0:1239e9b70ca2 | 198 | case ASN_UNKNOWN_OID_E : |
wolfSSL | 0:1239e9b70ca2 | 199 | XSTRNCPY(buffer, "ASN oid error, unknown sum id", max); |
wolfSSL | 0:1239e9b70ca2 | 200 | break; |
wolfSSL | 0:1239e9b70ca2 | 201 | |
wolfSSL | 0:1239e9b70ca2 | 202 | case ASN_DATE_SZ_E : |
wolfSSL | 0:1239e9b70ca2 | 203 | XSTRNCPY(buffer, "ASN date error, bad size", max); |
wolfSSL | 0:1239e9b70ca2 | 204 | break; |
wolfSSL | 0:1239e9b70ca2 | 205 | |
wolfSSL | 0:1239e9b70ca2 | 206 | case ASN_BEFORE_DATE_E : |
wolfSSL | 0:1239e9b70ca2 | 207 | XSTRNCPY(buffer, "ASN date error, current date before", max); |
wolfSSL | 0:1239e9b70ca2 | 208 | break; |
wolfSSL | 0:1239e9b70ca2 | 209 | |
wolfSSL | 0:1239e9b70ca2 | 210 | case ASN_AFTER_DATE_E : |
wolfSSL | 0:1239e9b70ca2 | 211 | XSTRNCPY(buffer, "ASN date error, current date after", max); |
wolfSSL | 0:1239e9b70ca2 | 212 | break; |
wolfSSL | 0:1239e9b70ca2 | 213 | |
wolfSSL | 0:1239e9b70ca2 | 214 | case ASN_SIG_OID_E : |
wolfSSL | 0:1239e9b70ca2 | 215 | XSTRNCPY(buffer, "ASN signature error, mismatched oid", max); |
wolfSSL | 0:1239e9b70ca2 | 216 | break; |
wolfSSL | 0:1239e9b70ca2 | 217 | |
wolfSSL | 0:1239e9b70ca2 | 218 | case ASN_TIME_E : |
wolfSSL | 0:1239e9b70ca2 | 219 | XSTRNCPY(buffer, "ASN time error, unkown time type", max); |
wolfSSL | 0:1239e9b70ca2 | 220 | break; |
wolfSSL | 0:1239e9b70ca2 | 221 | |
wolfSSL | 0:1239e9b70ca2 | 222 | case ASN_INPUT_E : |
wolfSSL | 0:1239e9b70ca2 | 223 | XSTRNCPY(buffer, "ASN input error, not enough data", max); |
wolfSSL | 0:1239e9b70ca2 | 224 | break; |
wolfSSL | 0:1239e9b70ca2 | 225 | |
wolfSSL | 0:1239e9b70ca2 | 226 | case ASN_SIG_CONFIRM_E : |
wolfSSL | 0:1239e9b70ca2 | 227 | XSTRNCPY(buffer, "ASN sig error, confirm failure", max); |
wolfSSL | 0:1239e9b70ca2 | 228 | break; |
wolfSSL | 0:1239e9b70ca2 | 229 | |
wolfSSL | 0:1239e9b70ca2 | 230 | case ASN_SIG_HASH_E : |
wolfSSL | 0:1239e9b70ca2 | 231 | XSTRNCPY(buffer, "ASN sig error, unsupported hash type", max); |
wolfSSL | 0:1239e9b70ca2 | 232 | break; |
wolfSSL | 0:1239e9b70ca2 | 233 | |
wolfSSL | 0:1239e9b70ca2 | 234 | case ASN_SIG_KEY_E : |
wolfSSL | 0:1239e9b70ca2 | 235 | XSTRNCPY(buffer, "ASN sig error, unsupported key type", max); |
wolfSSL | 0:1239e9b70ca2 | 236 | break; |
wolfSSL | 0:1239e9b70ca2 | 237 | |
wolfSSL | 0:1239e9b70ca2 | 238 | case ASN_DH_KEY_E : |
wolfSSL | 0:1239e9b70ca2 | 239 | XSTRNCPY(buffer, "ASN key init error, invalid input", max); |
wolfSSL | 0:1239e9b70ca2 | 240 | break; |
wolfSSL | 0:1239e9b70ca2 | 241 | |
wolfSSL | 0:1239e9b70ca2 | 242 | case ASN_NTRU_KEY_E : |
wolfSSL | 0:1239e9b70ca2 | 243 | XSTRNCPY(buffer, "ASN NTRU key decode error, invalid input", max); |
wolfSSL | 0:1239e9b70ca2 | 244 | break; |
wolfSSL | 0:1239e9b70ca2 | 245 | |
wolfSSL | 0:1239e9b70ca2 | 246 | case ASN_CRIT_EXT_E: |
wolfSSL | 0:1239e9b70ca2 | 247 | XSTRNCPY(buffer, "X.509 Critical extension ignored", max); |
wolfSSL | 0:1239e9b70ca2 | 248 | break; |
wolfSSL | 0:1239e9b70ca2 | 249 | |
wolfSSL | 0:1239e9b70ca2 | 250 | case ECC_BAD_ARG_E : |
wolfSSL | 0:1239e9b70ca2 | 251 | XSTRNCPY(buffer, "ECC input argument wrong type, invalid input", max); |
wolfSSL | 0:1239e9b70ca2 | 252 | break; |
wolfSSL | 0:1239e9b70ca2 | 253 | |
wolfSSL | 0:1239e9b70ca2 | 254 | case ASN_ECC_KEY_E : |
wolfSSL | 0:1239e9b70ca2 | 255 | XSTRNCPY(buffer, "ECC ASN1 bad key data, invalid input", max); |
wolfSSL | 0:1239e9b70ca2 | 256 | break; |
wolfSSL | 0:1239e9b70ca2 | 257 | |
wolfSSL | 0:1239e9b70ca2 | 258 | case ECC_CURVE_OID_E : |
wolfSSL | 0:1239e9b70ca2 | 259 | XSTRNCPY(buffer, "ECC curve sum OID unsupported, invalid input", max); |
wolfSSL | 0:1239e9b70ca2 | 260 | break; |
wolfSSL | 0:1239e9b70ca2 | 261 | |
wolfSSL | 0:1239e9b70ca2 | 262 | case BAD_FUNC_ARG : |
wolfSSL | 0:1239e9b70ca2 | 263 | XSTRNCPY(buffer, "Bad function argument", max); |
wolfSSL | 0:1239e9b70ca2 | 264 | break; |
wolfSSL | 0:1239e9b70ca2 | 265 | |
wolfSSL | 0:1239e9b70ca2 | 266 | case NOT_COMPILED_IN : |
wolfSSL | 0:1239e9b70ca2 | 267 | XSTRNCPY(buffer, "Feature not compiled in", max); |
wolfSSL | 0:1239e9b70ca2 | 268 | break; |
wolfSSL | 0:1239e9b70ca2 | 269 | |
wolfSSL | 0:1239e9b70ca2 | 270 | case UNICODE_SIZE_E : |
wolfSSL | 0:1239e9b70ca2 | 271 | XSTRNCPY(buffer, "Unicode password too big", max); |
wolfSSL | 0:1239e9b70ca2 | 272 | break; |
wolfSSL | 0:1239e9b70ca2 | 273 | |
wolfSSL | 0:1239e9b70ca2 | 274 | case NO_PASSWORD : |
wolfSSL | 0:1239e9b70ca2 | 275 | XSTRNCPY(buffer, "No password provided by user", max); |
wolfSSL | 0:1239e9b70ca2 | 276 | break; |
wolfSSL | 0:1239e9b70ca2 | 277 | |
wolfSSL | 0:1239e9b70ca2 | 278 | case ALT_NAME_E : |
wolfSSL | 0:1239e9b70ca2 | 279 | XSTRNCPY(buffer, "Alt Name problem, too big", max); |
wolfSSL | 0:1239e9b70ca2 | 280 | break; |
wolfSSL | 0:1239e9b70ca2 | 281 | |
wolfSSL | 0:1239e9b70ca2 | 282 | case AES_GCM_AUTH_E: |
wolfSSL | 0:1239e9b70ca2 | 283 | XSTRNCPY(buffer, "AES-GCM Authentication check fail", max); |
wolfSSL | 0:1239e9b70ca2 | 284 | break; |
wolfSSL | 0:1239e9b70ca2 | 285 | |
wolfSSL | 0:1239e9b70ca2 | 286 | case AES_CCM_AUTH_E: |
wolfSSL | 0:1239e9b70ca2 | 287 | XSTRNCPY(buffer, "AES-CCM Authentication check fail", max); |
wolfSSL | 0:1239e9b70ca2 | 288 | break; |
wolfSSL | 0:1239e9b70ca2 | 289 | |
wolfSSL | 0:1239e9b70ca2 | 290 | case CAVIUM_INIT_E: |
wolfSSL | 0:1239e9b70ca2 | 291 | XSTRNCPY(buffer, "Cavium Init type error", max); |
wolfSSL | 0:1239e9b70ca2 | 292 | break; |
wolfSSL | 0:1239e9b70ca2 | 293 | |
wolfSSL | 0:1239e9b70ca2 | 294 | case COMPRESS_INIT_E: |
wolfSSL | 0:1239e9b70ca2 | 295 | XSTRNCPY(buffer, "Compress Init error", max); |
wolfSSL | 0:1239e9b70ca2 | 296 | break; |
wolfSSL | 0:1239e9b70ca2 | 297 | |
wolfSSL | 0:1239e9b70ca2 | 298 | case COMPRESS_E: |
wolfSSL | 0:1239e9b70ca2 | 299 | XSTRNCPY(buffer, "Compress error", max); |
wolfSSL | 0:1239e9b70ca2 | 300 | break; |
wolfSSL | 0:1239e9b70ca2 | 301 | |
wolfSSL | 0:1239e9b70ca2 | 302 | case DECOMPRESS_INIT_E: |
wolfSSL | 0:1239e9b70ca2 | 303 | XSTRNCPY(buffer, "DeCompress Init error", max); |
wolfSSL | 0:1239e9b70ca2 | 304 | break; |
wolfSSL | 0:1239e9b70ca2 | 305 | |
wolfSSL | 0:1239e9b70ca2 | 306 | case DECOMPRESS_E: |
wolfSSL | 0:1239e9b70ca2 | 307 | XSTRNCPY(buffer, "DeCompress error", max); |
wolfSSL | 0:1239e9b70ca2 | 308 | break; |
wolfSSL | 0:1239e9b70ca2 | 309 | |
wolfSSL | 0:1239e9b70ca2 | 310 | case BAD_ALIGN_E: |
wolfSSL | 0:1239e9b70ca2 | 311 | XSTRNCPY(buffer, "Bad alignment error, no alloc help", max); |
wolfSSL | 0:1239e9b70ca2 | 312 | break; |
wolfSSL | 0:1239e9b70ca2 | 313 | |
wolfSSL | 0:1239e9b70ca2 | 314 | case ASN_NO_SIGNER_E : |
wolfSSL | 0:1239e9b70ca2 | 315 | XSTRNCPY(buffer, "ASN no signer error to confirm failure", max); |
wolfSSL | 0:1239e9b70ca2 | 316 | break; |
wolfSSL | 0:1239e9b70ca2 | 317 | |
wolfSSL | 0:1239e9b70ca2 | 318 | case ASN_CRL_CONFIRM_E : |
wolfSSL | 0:1239e9b70ca2 | 319 | XSTRNCPY(buffer, "ASN CRL sig error, confirm failure", max); |
wolfSSL | 0:1239e9b70ca2 | 320 | break; |
wolfSSL | 0:1239e9b70ca2 | 321 | |
wolfSSL | 0:1239e9b70ca2 | 322 | case ASN_CRL_NO_SIGNER_E : |
wolfSSL | 0:1239e9b70ca2 | 323 | XSTRNCPY(buffer, "ASN CRL no signer error to confirm failure", max); |
wolfSSL | 0:1239e9b70ca2 | 324 | break; |
wolfSSL | 0:1239e9b70ca2 | 325 | |
wolfSSL | 0:1239e9b70ca2 | 326 | case ASN_OCSP_CONFIRM_E : |
wolfSSL | 0:1239e9b70ca2 | 327 | XSTRNCPY(buffer, "ASN OCSP sig error, confirm failure", max); |
wolfSSL | 0:1239e9b70ca2 | 328 | break; |
wolfSSL | 0:1239e9b70ca2 | 329 | |
wolfSSL | 0:1239e9b70ca2 | 330 | case BAD_ENC_STATE_E: |
wolfSSL | 0:1239e9b70ca2 | 331 | XSTRNCPY(buffer, "Bad ecc encrypt state operation", max); |
wolfSSL | 0:1239e9b70ca2 | 332 | break; |
wolfSSL | 0:1239e9b70ca2 | 333 | |
wolfSSL | 0:1239e9b70ca2 | 334 | case BAD_PADDING_E: |
wolfSSL | 0:1239e9b70ca2 | 335 | XSTRNCPY(buffer, "Bad padding, message wrong length", max); |
wolfSSL | 0:1239e9b70ca2 | 336 | break; |
wolfSSL | 0:1239e9b70ca2 | 337 | |
wolfSSL | 0:1239e9b70ca2 | 338 | case REQ_ATTRIBUTE_E: |
wolfSSL | 0:1239e9b70ca2 | 339 | XSTRNCPY(buffer, "Setting cert request attributes error", max); |
wolfSSL | 0:1239e9b70ca2 | 340 | break; |
wolfSSL | 0:1239e9b70ca2 | 341 | |
wolfSSL | 0:1239e9b70ca2 | 342 | case PKCS7_OID_E: |
wolfSSL | 0:1239e9b70ca2 | 343 | XSTRNCPY(buffer, "PKCS#7 error: mismatched OID value", max); |
wolfSSL | 0:1239e9b70ca2 | 344 | break; |
wolfSSL | 0:1239e9b70ca2 | 345 | |
wolfSSL | 0:1239e9b70ca2 | 346 | case PKCS7_RECIP_E: |
wolfSSL | 0:1239e9b70ca2 | 347 | XSTRNCPY(buffer, "PKCS#7 error: no matching recipient found", max); |
wolfSSL | 0:1239e9b70ca2 | 348 | break; |
wolfSSL | 0:1239e9b70ca2 | 349 | |
wolfSSL | 0:1239e9b70ca2 | 350 | case FIPS_NOT_ALLOWED_E: |
wolfSSL | 0:1239e9b70ca2 | 351 | XSTRNCPY(buffer, "FIPS mode not allowed error", max); |
wolfSSL | 0:1239e9b70ca2 | 352 | break; |
wolfSSL | 0:1239e9b70ca2 | 353 | |
wolfSSL | 0:1239e9b70ca2 | 354 | case ASN_NAME_INVALID_E: |
wolfSSL | 0:1239e9b70ca2 | 355 | XSTRNCPY(buffer, "Name Constraint error", max); |
wolfSSL | 0:1239e9b70ca2 | 356 | break; |
wolfSSL | 0:1239e9b70ca2 | 357 | |
wolfSSL | 0:1239e9b70ca2 | 358 | default: |
wolfSSL | 0:1239e9b70ca2 | 359 | XSTRNCPY(buffer, "unknown error number", max); |
wolfSSL | 0:1239e9b70ca2 | 360 | |
wolfSSL | 0:1239e9b70ca2 | 361 | } |
wolfSSL | 0:1239e9b70ca2 | 362 | |
wolfSSL | 0:1239e9b70ca2 | 363 | #endif /* NO_ERROR_STRINGS */ |
wolfSSL | 0:1239e9b70ca2 | 364 | |
wolfSSL | 0:1239e9b70ca2 | 365 | } |
wolfSSL | 0:1239e9b70ca2 | 366 |