source: asp3_tinet_ecnl_rx/trunk/wolfssl-3.12.2/wolfssl/wolfcrypt/error-crypt.h@ 337

Last change on this file since 337 was 337, checked in by coas-nagasima, 6 years ago

ASP3版ECNLを追加

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