A library for setting up Secure Socket Layer (SSL) connections and verifying remote hosts using certificates. Contains only the source files for mbed platform implementation of the library.

Dependents:   HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL

Committer:
Vanger
Date:
Mon Jan 19 21:45:42 2015 +0000
Revision:
0:b86d15c6ba29
Updated CyaSSL Library to 3.3.0. Changed Settings and functions to be implemented for mbed platforms

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Vanger 0:b86d15c6ba29 1 /* error-crypt.h
Vanger 0:b86d15c6ba29 2 *
Vanger 0:b86d15c6ba29 3 * Copyright (C) 2006-2014 wolfSSL Inc.
Vanger 0:b86d15c6ba29 4 *
Vanger 0:b86d15c6ba29 5 * This file is part of CyaSSL.
Vanger 0:b86d15c6ba29 6 *
Vanger 0:b86d15c6ba29 7 * CyaSSL is free software; you can redistribute it and/or modify
Vanger 0:b86d15c6ba29 8 * it under the terms of the GNU General Public License as published by
Vanger 0:b86d15c6ba29 9 * the Free Software Foundation; either version 2 of the License, or
Vanger 0:b86d15c6ba29 10 * (at your option) any later version.
Vanger 0:b86d15c6ba29 11 *
Vanger 0:b86d15c6ba29 12 * CyaSSL is distributed in the hope that it will be useful,
Vanger 0:b86d15c6ba29 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Vanger 0:b86d15c6ba29 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Vanger 0:b86d15c6ba29 15 * GNU General Public License for more details.
Vanger 0:b86d15c6ba29 16 *
Vanger 0:b86d15c6ba29 17 * You should have received a copy of the GNU General Public License
Vanger 0:b86d15c6ba29 18 * along with this program; if not, write to the Free Software
Vanger 0:b86d15c6ba29 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Vanger 0:b86d15c6ba29 20 */
Vanger 0:b86d15c6ba29 21
Vanger 0:b86d15c6ba29 22
Vanger 0:b86d15c6ba29 23 #ifndef CTAO_CRYPT_ERROR_H
Vanger 0:b86d15c6ba29 24 #define CTAO_CRYPT_ERROR_H
Vanger 0:b86d15c6ba29 25
Vanger 0:b86d15c6ba29 26 #include <cyassl/ctaocrypt/types.h>
Vanger 0:b86d15c6ba29 27
Vanger 0:b86d15c6ba29 28
Vanger 0:b86d15c6ba29 29 #ifdef __cplusplus
Vanger 0:b86d15c6ba29 30 extern "C" {
Vanger 0:b86d15c6ba29 31 #endif
Vanger 0:b86d15c6ba29 32
Vanger 0:b86d15c6ba29 33
Vanger 0:b86d15c6ba29 34 /* error codes */
Vanger 0:b86d15c6ba29 35 enum {
Vanger 0:b86d15c6ba29 36 MAX_CODE_E = -100, /* errors -101 - -299 */
Vanger 0:b86d15c6ba29 37 OPEN_RAN_E = -101, /* opening random device error */
Vanger 0:b86d15c6ba29 38 READ_RAN_E = -102, /* reading random device error */
Vanger 0:b86d15c6ba29 39 WINCRYPT_E = -103, /* windows crypt init error */
Vanger 0:b86d15c6ba29 40 CRYPTGEN_E = -104, /* windows crypt generation error */
Vanger 0:b86d15c6ba29 41 RAN_BLOCK_E = -105, /* reading random device would block */
Vanger 0:b86d15c6ba29 42 BAD_MUTEX_E = -106, /* Bad mutex operation */
Vanger 0:b86d15c6ba29 43
Vanger 0:b86d15c6ba29 44 MP_INIT_E = -110, /* mp_init error state */
Vanger 0:b86d15c6ba29 45 MP_READ_E = -111, /* mp_read error state */
Vanger 0:b86d15c6ba29 46 MP_EXPTMOD_E = -112, /* mp_exptmod error state */
Vanger 0:b86d15c6ba29 47 MP_TO_E = -113, /* mp_to_xxx error state, can't convert */
Vanger 0:b86d15c6ba29 48 MP_SUB_E = -114, /* mp_sub error state, can't subtract */
Vanger 0:b86d15c6ba29 49 MP_ADD_E = -115, /* mp_add error state, can't add */
Vanger 0:b86d15c6ba29 50 MP_MUL_E = -116, /* mp_mul error state, can't multiply */
Vanger 0:b86d15c6ba29 51 MP_MULMOD_E = -117, /* mp_mulmod error state, can't multiply mod */
Vanger 0:b86d15c6ba29 52 MP_MOD_E = -118, /* mp_mod error state, can't mod */
Vanger 0:b86d15c6ba29 53 MP_INVMOD_E = -119, /* mp_invmod error state, can't inv mod */
Vanger 0:b86d15c6ba29 54 MP_CMP_E = -120, /* mp_cmp error state */
Vanger 0:b86d15c6ba29 55 MP_ZERO_E = -121, /* got a mp zero result, not expected */
Vanger 0:b86d15c6ba29 56
Vanger 0:b86d15c6ba29 57 MEMORY_E = -125, /* out of memory error */
Vanger 0:b86d15c6ba29 58
Vanger 0:b86d15c6ba29 59 RSA_WRONG_TYPE_E = -130, /* RSA wrong block type for RSA function */
Vanger 0:b86d15c6ba29 60 RSA_BUFFER_E = -131, /* RSA buffer error, output too small or
Vanger 0:b86d15c6ba29 61 input too large */
Vanger 0:b86d15c6ba29 62 BUFFER_E = -132, /* output buffer too small or input too large */
Vanger 0:b86d15c6ba29 63 ALGO_ID_E = -133, /* setting algo id error */
Vanger 0:b86d15c6ba29 64 PUBLIC_KEY_E = -134, /* setting public key error */
Vanger 0:b86d15c6ba29 65 DATE_E = -135, /* setting date validity error */
Vanger 0:b86d15c6ba29 66 SUBJECT_E = -136, /* setting subject name error */
Vanger 0:b86d15c6ba29 67 ISSUER_E = -137, /* setting issuer name error */
Vanger 0:b86d15c6ba29 68 CA_TRUE_E = -138, /* setting CA basic constraint true error */
Vanger 0:b86d15c6ba29 69 EXTENSIONS_E = -139, /* setting extensions error */
Vanger 0:b86d15c6ba29 70
Vanger 0:b86d15c6ba29 71 ASN_PARSE_E = -140, /* ASN parsing error, invalid input */
Vanger 0:b86d15c6ba29 72 ASN_VERSION_E = -141, /* ASN version error, invalid number */
Vanger 0:b86d15c6ba29 73 ASN_GETINT_E = -142, /* ASN get big int error, invalid data */
Vanger 0:b86d15c6ba29 74 ASN_RSA_KEY_E = -143, /* ASN key init error, invalid input */
Vanger 0:b86d15c6ba29 75 ASN_OBJECT_ID_E = -144, /* ASN object id error, invalid id */
Vanger 0:b86d15c6ba29 76 ASN_TAG_NULL_E = -145, /* ASN tag error, not null */
Vanger 0:b86d15c6ba29 77 ASN_EXPECT_0_E = -146, /* ASN expect error, not zero */
Vanger 0:b86d15c6ba29 78 ASN_BITSTR_E = -147, /* ASN bit string error, wrong id */
Vanger 0:b86d15c6ba29 79 ASN_UNKNOWN_OID_E = -148, /* ASN oid error, unknown sum id */
Vanger 0:b86d15c6ba29 80 ASN_DATE_SZ_E = -149, /* ASN date error, bad size */
Vanger 0:b86d15c6ba29 81 ASN_BEFORE_DATE_E = -150, /* ASN date error, current date before */
Vanger 0:b86d15c6ba29 82 ASN_AFTER_DATE_E = -151, /* ASN date error, current date after */
Vanger 0:b86d15c6ba29 83 ASN_SIG_OID_E = -152, /* ASN signature error, mismatched oid */
Vanger 0:b86d15c6ba29 84 ASN_TIME_E = -153, /* ASN time error, unknown time type */
Vanger 0:b86d15c6ba29 85 ASN_INPUT_E = -154, /* ASN input error, not enough data */
Vanger 0:b86d15c6ba29 86 ASN_SIG_CONFIRM_E = -155, /* ASN sig error, confirm failure */
Vanger 0:b86d15c6ba29 87 ASN_SIG_HASH_E = -156, /* ASN sig error, unsupported hash type */
Vanger 0:b86d15c6ba29 88 ASN_SIG_KEY_E = -157, /* ASN sig error, unsupported key type */
Vanger 0:b86d15c6ba29 89 ASN_DH_KEY_E = -158, /* ASN key init error, invalid input */
Vanger 0:b86d15c6ba29 90 ASN_NTRU_KEY_E = -159, /* ASN ntru key decode error, invalid input */
Vanger 0:b86d15c6ba29 91 ASN_CRIT_EXT_E = -160, /* ASN unsupported critical extension */
Vanger 0:b86d15c6ba29 92
Vanger 0:b86d15c6ba29 93 ECC_BAD_ARG_E = -170, /* ECC input argument of wrong type */
Vanger 0:b86d15c6ba29 94 ASN_ECC_KEY_E = -171, /* ASN ECC bad input */
Vanger 0:b86d15c6ba29 95 ECC_CURVE_OID_E = -172, /* Unsupported ECC OID curve type */
Vanger 0:b86d15c6ba29 96 BAD_FUNC_ARG = -173, /* Bad function argument provided */
Vanger 0:b86d15c6ba29 97 NOT_COMPILED_IN = -174, /* Feature not compiled in */
Vanger 0:b86d15c6ba29 98 UNICODE_SIZE_E = -175, /* Unicode password too big */
Vanger 0:b86d15c6ba29 99 NO_PASSWORD = -176, /* no password provided by user */
Vanger 0:b86d15c6ba29 100 ALT_NAME_E = -177, /* alt name size problem, too big */
Vanger 0:b86d15c6ba29 101
Vanger 0:b86d15c6ba29 102 AES_GCM_AUTH_E = -180, /* AES-GCM Authentication check failure */
Vanger 0:b86d15c6ba29 103 AES_CCM_AUTH_E = -181, /* AES-CCM Authentication check failure */
Vanger 0:b86d15c6ba29 104
Vanger 0:b86d15c6ba29 105 CAVIUM_INIT_E = -182, /* Cavium Init type error */
Vanger 0:b86d15c6ba29 106
Vanger 0:b86d15c6ba29 107 COMPRESS_INIT_E = -183, /* Compress init error */
Vanger 0:b86d15c6ba29 108 COMPRESS_E = -184, /* Compress error */
Vanger 0:b86d15c6ba29 109 DECOMPRESS_INIT_E = -185, /* DeCompress init error */
Vanger 0:b86d15c6ba29 110 DECOMPRESS_E = -186, /* DeCompress error */
Vanger 0:b86d15c6ba29 111
Vanger 0:b86d15c6ba29 112 BAD_ALIGN_E = -187, /* Bad alignment for operation, no alloc */
Vanger 0:b86d15c6ba29 113 ASN_NO_SIGNER_E = -188, /* ASN no signer to confirm failure */
Vanger 0:b86d15c6ba29 114 ASN_CRL_CONFIRM_E = -189, /* ASN CRL signature confirm failure */
Vanger 0:b86d15c6ba29 115 ASN_CRL_NO_SIGNER_E = -190, /* ASN CRL no signer to confirm failure */
Vanger 0:b86d15c6ba29 116 ASN_OCSP_CONFIRM_E = -191, /* ASN OCSP signature confirm failure */
Vanger 0:b86d15c6ba29 117
Vanger 0:b86d15c6ba29 118 BAD_ENC_STATE_E = -192, /* Bad ecc enc state operation */
Vanger 0:b86d15c6ba29 119 BAD_PADDING_E = -193, /* Bad padding, msg not correct length */
Vanger 0:b86d15c6ba29 120
Vanger 0:b86d15c6ba29 121 REQ_ATTRIBUTE_E = -194, /* setting cert request attributes error */
Vanger 0:b86d15c6ba29 122
Vanger 0:b86d15c6ba29 123 PKCS7_OID_E = -195, /* PKCS#7, mismatched OID error */
Vanger 0:b86d15c6ba29 124 PKCS7_RECIP_E = -196, /* PKCS#7, recipient error */
Vanger 0:b86d15c6ba29 125 FIPS_NOT_ALLOWED_E = -197, /* FIPS not allowed error */
Vanger 0:b86d15c6ba29 126 ASN_NAME_INVALID_E = -198, /* ASN name constraint error */
Vanger 0:b86d15c6ba29 127
Vanger 0:b86d15c6ba29 128 RNG_FAILURE_E = -199, /* RNG Failed, Reinitialize */
Vanger 0:b86d15c6ba29 129 HMAC_MIN_KEYLEN_E = -200, /* FIPS Mode HMAC Minimum Key Length error */
Vanger 0:b86d15c6ba29 130 RSA_PAD_E = -201, /* RSA Padding Error */
Vanger 0:b86d15c6ba29 131 LENGTH_ONLY_E = -202, /* Returning output length only */
Vanger 0:b86d15c6ba29 132
Vanger 0:b86d15c6ba29 133 IN_CORE_FIPS_E = -203, /* In Core Integrity check failure */
Vanger 0:b86d15c6ba29 134 AES_KAT_FIPS_E = -204, /* AES KAT failure */
Vanger 0:b86d15c6ba29 135 DES3_KAT_FIPS_E = -205, /* DES3 KAT failure */
Vanger 0:b86d15c6ba29 136 HMAC_KAT_FIPS_E = -206, /* HMAC KAT failure */
Vanger 0:b86d15c6ba29 137 RSA_KAT_FIPS_E = -207, /* RSA KAT failure */
Vanger 0:b86d15c6ba29 138 DRBG_KAT_FIPS_E = -208, /* HASH DRBG KAT failure */
Vanger 0:b86d15c6ba29 139 DRBG_CONT_FIPS_E = -209, /* HASH DRBG Continious test failure */
Vanger 0:b86d15c6ba29 140 AESGCM_KAT_FIPS_E = -210, /* AESGCM KAT failure */
Vanger 0:b86d15c6ba29 141
Vanger 0:b86d15c6ba29 142 MIN_CODE_E = -300 /* errors -101 - -299 */
Vanger 0:b86d15c6ba29 143 };
Vanger 0:b86d15c6ba29 144
Vanger 0:b86d15c6ba29 145
Vanger 0:b86d15c6ba29 146 CYASSL_API void CTaoCryptErrorString(int err, char* buff);
Vanger 0:b86d15c6ba29 147 CYASSL_API const char* CTaoCryptGetErrorString(int error);
Vanger 0:b86d15c6ba29 148
Vanger 0:b86d15c6ba29 149
Vanger 0:b86d15c6ba29 150 #ifdef __cplusplus
Vanger 0:b86d15c6ba29 151 } /* extern "C" */
Vanger 0:b86d15c6ba29 152 #endif
Vanger 0:b86d15c6ba29 153
Vanger 0:b86d15c6ba29 154 #endif /* CTAO_CRYPT_ERROR_H */
Vanger 0:b86d15c6ba29 155
Vanger 0:b86d15c6ba29 156