wolfSSL SSL/TLS library, support up to TLS1.3

Dependents:   CyaSSL-Twitter-OAuth4Tw Example-client-tls-cert TwitterReader TweetTest ... more

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-crypt.h
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
wolfSSL 7:481bce714567 24 #ifndef WOLF_CRYPT_ERROR_H
wolfSSL 7:481bce714567 25 #define WOLF_CRYPT_ERROR_H
wolfSSL 7:481bce714567 26
wolfSSL 7:481bce714567 27 #include <wolfssl/wolfcrypt/types.h>
wolfSSL 7:481bce714567 28
wolfSSL 7:481bce714567 29 #ifdef HAVE_FIPS
wolfSSL 7:481bce714567 30 #include <cyassl/ctaocrypt/error-crypt.h>
wolfSSL 7:481bce714567 31 #endif /* HAVE_FIPS */
wolfSSL 7:481bce714567 32
wolfSSL 7:481bce714567 33 #ifdef __cplusplus
wolfSSL 7:481bce714567 34 extern "C" {
wolfSSL 7:481bce714567 35 #endif
wolfSSL 7:481bce714567 36
wolfSSL 7:481bce714567 37
wolfSSL 7:481bce714567 38 /* error codes, add string for new errors !!! */
wolfSSL 7:481bce714567 39 enum {
wolfSSL 7:481bce714567 40 MAX_CODE_E = -100, /* errors -101 - -299 */
wolfSSL 7:481bce714567 41 OPEN_RAN_E = -101, /* opening random device error */
wolfSSL 7:481bce714567 42 READ_RAN_E = -102, /* reading random device error */
wolfSSL 7:481bce714567 43 WINCRYPT_E = -103, /* windows crypt init error */
wolfSSL 7:481bce714567 44 CRYPTGEN_E = -104, /* windows crypt generation error */
wolfSSL 7:481bce714567 45 RAN_BLOCK_E = -105, /* reading random device would block */
wolfSSL 7:481bce714567 46 BAD_MUTEX_E = -106, /* Bad mutex operation */
wolfSSL 7:481bce714567 47 WC_TIMEOUT_E = -107, /* timeout error */
wolfSSL 7:481bce714567 48 WC_PENDING_E = -108, /* wolfCrypt operation pending (would block) */
wolfSSL 7:481bce714567 49 WC_NOT_PENDING_E = -109, /* wolfCrypt operation not pending */
wolfSSL 7:481bce714567 50
wolfSSL 7:481bce714567 51 MP_INIT_E = -110, /* mp_init error state */
wolfSSL 7:481bce714567 52 MP_READ_E = -111, /* mp_read error state */
wolfSSL 7:481bce714567 53 MP_EXPTMOD_E = -112, /* mp_exptmod error state */
wolfSSL 7:481bce714567 54 MP_TO_E = -113, /* mp_to_xxx error state, can't convert */
wolfSSL 7:481bce714567 55 MP_SUB_E = -114, /* mp_sub error state, can't subtract */
wolfSSL 7:481bce714567 56 MP_ADD_E = -115, /* mp_add error state, can't add */
wolfSSL 7:481bce714567 57 MP_MUL_E = -116, /* mp_mul error state, can't multiply */
wolfSSL 7:481bce714567 58 MP_MULMOD_E = -117, /* mp_mulmod error state, can't multiply mod */
wolfSSL 7:481bce714567 59 MP_MOD_E = -118, /* mp_mod error state, can't mod */
wolfSSL 7:481bce714567 60 MP_INVMOD_E = -119, /* mp_invmod error state, can't inv mod */
wolfSSL 7:481bce714567 61 MP_CMP_E = -120, /* mp_cmp error state */
wolfSSL 7:481bce714567 62 MP_ZERO_E = -121, /* got a mp zero result, not expected */
wolfSSL 7:481bce714567 63
wolfSSL 7:481bce714567 64 MEMORY_E = -125, /* out of memory error */
wolfSSL 7:481bce714567 65 VAR_STATE_CHANGE_E = -126, /* var state modified by different thread */
wolfSSL 7:481bce714567 66
wolfSSL 7:481bce714567 67 RSA_WRONG_TYPE_E = -130, /* RSA wrong block type for RSA function */
wolfSSL 7:481bce714567 68 RSA_BUFFER_E = -131, /* RSA buffer error, output too small or
wolfSSL 7:481bce714567 69 input too large */
wolfSSL 7:481bce714567 70 BUFFER_E = -132, /* output buffer too small or input too large */
wolfSSL 7:481bce714567 71 ALGO_ID_E = -133, /* setting algo id error */
wolfSSL 7:481bce714567 72 PUBLIC_KEY_E = -134, /* setting public key error */
wolfSSL 7:481bce714567 73 DATE_E = -135, /* setting date validity error */
wolfSSL 7:481bce714567 74 SUBJECT_E = -136, /* setting subject name error */
wolfSSL 7:481bce714567 75 ISSUER_E = -137, /* setting issuer name error */
wolfSSL 7:481bce714567 76 CA_TRUE_E = -138, /* setting CA basic constraint true error */
wolfSSL 7:481bce714567 77 EXTENSIONS_E = -139, /* setting extensions error */
wolfSSL 7:481bce714567 78
wolfSSL 7:481bce714567 79 ASN_PARSE_E = -140, /* ASN parsing error, invalid input */
wolfSSL 7:481bce714567 80 ASN_VERSION_E = -141, /* ASN version error, invalid number */
wolfSSL 7:481bce714567 81 ASN_GETINT_E = -142, /* ASN get big int error, invalid data */
wolfSSL 7:481bce714567 82 ASN_RSA_KEY_E = -143, /* ASN key init error, invalid input */
wolfSSL 7:481bce714567 83 ASN_OBJECT_ID_E = -144, /* ASN object id error, invalid id */
wolfSSL 7:481bce714567 84 ASN_TAG_NULL_E = -145, /* ASN tag error, not null */
wolfSSL 7:481bce714567 85 ASN_EXPECT_0_E = -146, /* ASN expect error, not zero */
wolfSSL 7:481bce714567 86 ASN_BITSTR_E = -147, /* ASN bit string error, wrong id */
wolfSSL 7:481bce714567 87 ASN_UNKNOWN_OID_E = -148, /* ASN oid error, unknown sum id */
wolfSSL 7:481bce714567 88 ASN_DATE_SZ_E = -149, /* ASN date error, bad size */
wolfSSL 7:481bce714567 89 ASN_BEFORE_DATE_E = -150, /* ASN date error, current date before */
wolfSSL 7:481bce714567 90 ASN_AFTER_DATE_E = -151, /* ASN date error, current date after */
wolfSSL 7:481bce714567 91 ASN_SIG_OID_E = -152, /* ASN signature error, mismatched oid */
wolfSSL 7:481bce714567 92 ASN_TIME_E = -153, /* ASN time error, unknown time type */
wolfSSL 7:481bce714567 93 ASN_INPUT_E = -154, /* ASN input error, not enough data */
wolfSSL 7:481bce714567 94 ASN_SIG_CONFIRM_E = -155, /* ASN sig error, confirm failure */
wolfSSL 7:481bce714567 95 ASN_SIG_HASH_E = -156, /* ASN sig error, unsupported hash type */
wolfSSL 7:481bce714567 96 ASN_SIG_KEY_E = -157, /* ASN sig error, unsupported key type */
wolfSSL 7:481bce714567 97 ASN_DH_KEY_E = -158, /* ASN key init error, invalid input */
wolfSSL 7:481bce714567 98 ASN_NTRU_KEY_E = -159, /* ASN ntru key decode error, invalid input */
wolfSSL 7:481bce714567 99 ASN_CRIT_EXT_E = -160, /* ASN unsupported critical extension */
wolfSSL 7:481bce714567 100
wolfSSL 7:481bce714567 101 ECC_BAD_ARG_E = -170, /* ECC input argument of wrong type */
wolfSSL 7:481bce714567 102 ASN_ECC_KEY_E = -171, /* ASN ECC bad input */
wolfSSL 7:481bce714567 103 ECC_CURVE_OID_E = -172, /* Unsupported ECC OID curve type */
wolfSSL 7:481bce714567 104 BAD_FUNC_ARG = -173, /* Bad function argument provided */
wolfSSL 7:481bce714567 105 NOT_COMPILED_IN = -174, /* Feature not compiled in */
wolfSSL 7:481bce714567 106 UNICODE_SIZE_E = -175, /* Unicode password too big */
wolfSSL 7:481bce714567 107 NO_PASSWORD = -176, /* no password provided by user */
wolfSSL 7:481bce714567 108 ALT_NAME_E = -177, /* alt name size problem, too big */
wolfSSL 7:481bce714567 109
wolfSSL 7:481bce714567 110 AES_GCM_AUTH_E = -180, /* AES-GCM Authentication check failure */
wolfSSL 7:481bce714567 111 AES_CCM_AUTH_E = -181, /* AES-CCM Authentication check failure */
wolfSSL 7:481bce714567 112
wolfSSL 7:481bce714567 113 ASYNC_INIT_E = -182, /* Async Init type error */
wolfSSL 7:481bce714567 114
wolfSSL 7:481bce714567 115 COMPRESS_INIT_E = -183, /* Compress init error */
wolfSSL 7:481bce714567 116 COMPRESS_E = -184, /* Compress error */
wolfSSL 7:481bce714567 117 DECOMPRESS_INIT_E = -185, /* DeCompress init error */
wolfSSL 7:481bce714567 118 DECOMPRESS_E = -186, /* DeCompress error */
wolfSSL 7:481bce714567 119
wolfSSL 7:481bce714567 120 BAD_ALIGN_E = -187, /* Bad alignment for operation, no alloc */
wolfSSL 7:481bce714567 121 ASN_NO_SIGNER_E = -188, /* ASN no signer to confirm failure */
wolfSSL 7:481bce714567 122 ASN_CRL_CONFIRM_E = -189, /* ASN CRL signature confirm failure */
wolfSSL 7:481bce714567 123 ASN_CRL_NO_SIGNER_E = -190, /* ASN CRL no signer to confirm failure */
wolfSSL 7:481bce714567 124 ASN_OCSP_CONFIRM_E = -191, /* ASN OCSP signature confirm failure */
wolfSSL 7:481bce714567 125
wolfSSL 7:481bce714567 126 BAD_STATE_E = -192, /* Bad state operation */
wolfSSL 7:481bce714567 127 BAD_PADDING_E = -193, /* Bad padding, msg not correct length */
wolfSSL 7:481bce714567 128
wolfSSL 7:481bce714567 129 REQ_ATTRIBUTE_E = -194, /* setting cert request attributes error */
wolfSSL 7:481bce714567 130
wolfSSL 7:481bce714567 131 PKCS7_OID_E = -195, /* PKCS#7, mismatched OID error */
wolfSSL 7:481bce714567 132 PKCS7_RECIP_E = -196, /* PKCS#7, recipient error */
wolfSSL 7:481bce714567 133 FIPS_NOT_ALLOWED_E = -197, /* FIPS not allowed error */
wolfSSL 7:481bce714567 134 ASN_NAME_INVALID_E = -198, /* ASN name constraint error */
wolfSSL 7:481bce714567 135
wolfSSL 7:481bce714567 136 RNG_FAILURE_E = -199, /* RNG Failed, Reinitialize */
wolfSSL 7:481bce714567 137 HMAC_MIN_KEYLEN_E = -200, /* FIPS Mode HMAC Minimum Key Length error */
wolfSSL 7:481bce714567 138 RSA_PAD_E = -201, /* RSA Padding Error */
wolfSSL 7:481bce714567 139 LENGTH_ONLY_E = -202, /* Returning output length only */
wolfSSL 7:481bce714567 140
wolfSSL 7:481bce714567 141 IN_CORE_FIPS_E = -203, /* In Core Integrity check failure */
wolfSSL 7:481bce714567 142 AES_KAT_FIPS_E = -204, /* AES KAT failure */
wolfSSL 7:481bce714567 143 DES3_KAT_FIPS_E = -205, /* DES3 KAT failure */
wolfSSL 7:481bce714567 144 HMAC_KAT_FIPS_E = -206, /* HMAC KAT failure */
wolfSSL 7:481bce714567 145 RSA_KAT_FIPS_E = -207, /* RSA KAT failure */
wolfSSL 7:481bce714567 146 DRBG_KAT_FIPS_E = -208, /* HASH DRBG KAT failure */
wolfSSL 7:481bce714567 147 DRBG_CONT_FIPS_E = -209, /* HASH DRBG Continuous test failure */
wolfSSL 7:481bce714567 148 AESGCM_KAT_FIPS_E = -210, /* AESGCM KAT failure */
wolfSSL 7:481bce714567 149 THREAD_STORE_KEY_E = -211, /* Thread local storage key create failure */
wolfSSL 7:481bce714567 150 THREAD_STORE_SET_E = -212, /* Thread local storage key set failure */
wolfSSL 7:481bce714567 151
wolfSSL 7:481bce714567 152 MAC_CMP_FAILED_E = -213, /* MAC comparison failed */
wolfSSL 7:481bce714567 153 IS_POINT_E = -214, /* ECC is point on curve failed */
wolfSSL 7:481bce714567 154 ECC_INF_E = -215, /* ECC point infinity error */
wolfSSL 7:481bce714567 155 ECC_PRIV_KEY_E = -216, /* ECC private key not valid error */
wolfSSL 7:481bce714567 156 ECC_OUT_OF_RANGE_E = -217, /* ECC key component out of range */
wolfSSL 7:481bce714567 157
wolfSSL 7:481bce714567 158 SRP_CALL_ORDER_E = -218, /* SRP function called in the wrong order. */
wolfSSL 7:481bce714567 159 SRP_VERIFY_E = -219, /* SRP proof verification failed. */
wolfSSL 7:481bce714567 160 SRP_BAD_KEY_E = -220, /* SRP bad ephemeral values. */
wolfSSL 7:481bce714567 161
wolfSSL 7:481bce714567 162 ASN_NO_SKID = -221, /* ASN no Subject Key Identifier found */
wolfSSL 7:481bce714567 163 ASN_NO_AKID = -222, /* ASN no Authority Key Identifier found */
wolfSSL 7:481bce714567 164 ASN_NO_KEYUSAGE = -223, /* ASN no Key Usage found */
wolfSSL 7:481bce714567 165 SKID_E = -224, /* setting Subject Key Identifier error */
wolfSSL 7:481bce714567 166 AKID_E = -225, /* setting Authority Key Identifier error */
wolfSSL 7:481bce714567 167 KEYUSAGE_E = -226, /* Bad Key Usage value */
wolfSSL 7:481bce714567 168 CERTPOLICIES_E = -227, /* setting Certificate Policies error */
wolfSSL 7:481bce714567 169
wolfSSL 7:481bce714567 170 WC_INIT_E = -228, /* wolfcrypt failed to initialize */
wolfSSL 7:481bce714567 171 SIG_VERIFY_E = -229, /* wolfcrypt signature verify error */
wolfSSL 7:481bce714567 172 BAD_COND_E = -230, /* Bad condition variable operation */
wolfSSL 7:481bce714567 173 SIG_TYPE_E = -231, /* Signature Type not enabled/available */
wolfSSL 7:481bce714567 174 HASH_TYPE_E = -232, /* Hash Type not enabled/available */
wolfSSL 7:481bce714567 175
wolfSSL 7:481bce714567 176 WC_KEY_SIZE_E = -234, /* Key size error, either too small or large */
wolfSSL 7:481bce714567 177 ASN_COUNTRY_SIZE_E = -235, /* ASN Cert Gen, invalid country code size */
wolfSSL 7:481bce714567 178 MISSING_RNG_E = -236, /* RNG required but not provided */
wolfSSL 7:481bce714567 179 ASN_PATHLEN_SIZE_E = -237, /* ASN CA path length too large error */
wolfSSL 7:481bce714567 180 ASN_PATHLEN_INV_E = -238, /* ASN CA path length inversion error */
wolfSSL 7:481bce714567 181
wolfSSL 7:481bce714567 182 BAD_KEYWRAP_ALG_E = -239,
wolfSSL 7:481bce714567 183 BAD_KEYWRAP_IV_E = -240, /* Decrypted AES key wrap IV incorrect */
wolfSSL 7:481bce714567 184 WC_CLEANUP_E = -241, /* wolfcrypt cleanup failed */
wolfSSL 7:481bce714567 185 ECC_CDH_KAT_FIPS_E = -242, /* ECC CDH Known Answer Test failure */
wolfSSL 7:481bce714567 186 DH_CHECK_PUB_E = -243, /* DH Check Pub Key error */
wolfSSL 7:481bce714567 187 BAD_PATH_ERROR = -244, /* Bad path for opendir */
wolfSSL 7:481bce714567 188
wolfSSL 7:481bce714567 189 MIN_CODE_E = -300 /* errors -101 - -299 */
wolfSSL 7:481bce714567 190
wolfSSL 7:481bce714567 191 /* add new companion error id strings for any new error codes
wolfSSL 7:481bce714567 192 wolfcrypt/src/error.c !!! */
wolfSSL 7:481bce714567 193 };
wolfSSL 7:481bce714567 194
wolfSSL 7:481bce714567 195
wolfSSL 7:481bce714567 196 WOLFSSL_API void wc_ErrorString(int err, char* buff);
wolfSSL 7:481bce714567 197 WOLFSSL_API const char* wc_GetErrorString(int error);
wolfSSL 7:481bce714567 198
wolfSSL 7:481bce714567 199
wolfSSL 7:481bce714567 200 #ifdef __cplusplus
wolfSSL 7:481bce714567 201 } /* extern "C" */
wolfSSL 7:481bce714567 202 #endif
wolfSSL 7:481bce714567 203 #endif /* WOLF_CRYPT_ERROR_H */
wolfSSL 7:481bce714567 204