CyaSSL is an SSL library for devices like mbed.
Dependents: cyassl-client Sync
error.h
00001 /* error.h 00002 * 00003 * Copyright (C) 2006-2009 Sawtooth Consulting Ltd. 00004 * 00005 * This file is part of CyaSSL. 00006 * 00007 * CyaSSL is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * CyaSSL is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 00020 */ 00021 00022 00023 #ifndef CTAO_CRYPT_ERROR_H 00024 #define CTAO_CRYPT_ERROR_H 00025 00026 #include "types.h" 00027 00028 00029 #ifdef __cplusplus 00030 extern "C" { 00031 #endif 00032 00033 00034 /* error codes */ 00035 enum { 00036 MAX_ERROR_SZ = 80, /* max size of error string */ 00037 MAX_CODE_E = -100, /* errors -101 - -199 */ 00038 OPEN_RAN_E = -101, /* opening random device error */ 00039 READ_RAN_E = -102, /* reading random device error */ 00040 WINCRYPT_E = -103, /* windows crypt init error */ 00041 CRYPTGEN_E = -104, /* windows crypt generation error */ 00042 RAN_BLOCK_E = -105, /* reading random device would block */ 00043 00044 MP_INIT_E = -110, /* mp_init error state */ 00045 MP_READ_E = -111, /* mp_read error state */ 00046 MP_EXPTMOD_E = -112, /* mp_exptmod error state */ 00047 MP_TO_E = -113, /* mp_to_xxx error state, can't convert */ 00048 MP_SUB_E = -114, /* mp_sub error state, can't subtract */ 00049 MP_ADD_E = -115, /* mp_add error state, can't add */ 00050 MP_MUL_E = -116, /* mp_mul error state, can't multiply */ 00051 MP_MULMOD_E = -117, /* mp_mulmod error state, can't multiply mod */ 00052 MP_MOD_E = -118, /* mp_mod error state, can't mod */ 00053 MP_INVMOD_E = -119, /* mp_invmod error state, can't inv mod */ 00054 MP_CMP_E = -120, /* mp_cmp error state */ 00055 00056 MEMORY_E = -125, /* out of memory error */ 00057 00058 RSA_WRONG_TYPE_E = -130, /* RSA wrong block type for RSA function */ 00059 RSA_BUFFER_E = -131, /* RSA buffer error, output too small or 00060 input too large */ 00061 BUFFER_E = -132, /* output buffer too small or input too large */ 00062 ALGO_ID_E = -133, /* setting algo id error */ 00063 PUBLIC_KEY_E = -134, /* setting public key error */ 00064 DATE_E = -135, /* setting date validity error */ 00065 SUBJECT_E = -136, /* setting subject name error */ 00066 ISSUER_E = -137, /* setting issuer name error */ 00067 00068 ASN_PARSE_E = -140, /* ASN parsing error, invalid input */ 00069 ASN_VERSION_E = -141, /* ASN version error, invalid number */ 00070 ASN_GETINT_E = -142, /* ASN get big int error, invalid data */ 00071 ASN_RSA_KEY_E = -143, /* ASN key init error, invalid input */ 00072 ASN_OBJECT_ID_E = -144, /* ASN object id error, invalid id */ 00073 ASN_TAG_NULL_E = -145, /* ASN tag error, not null */ 00074 ASN_EXPECT_0_E = -146, /* ASN expect error, not zero */ 00075 ASN_BITSTR_E = -147, /* ASN bit string error, wrong id */ 00076 ASN_UNKNOWN_OID_E = -148, /* ASN oid error, unknown sum id */ 00077 ASN_DATE_SZ_E = -149, /* ASN date error, bad size */ 00078 ASN_BEFORE_DATE_E = -150, /* ASN date error, current date before */ 00079 ASN_AFTER_DATE_E = -151, /* ASN date error, current date after */ 00080 ASN_SIG_OID_E = -152, /* ASN signature error, mismatched oid */ 00081 ASN_TIME_E = -153, /* ASN time error, unkown time type */ 00082 ASN_INPUT_E = -154, /* ASN input error, not enough data */ 00083 ASN_SIG_CONFIRM_E = -155, /* ASN sig error, confirm failure */ 00084 ASN_SIG_HASH_E = -156, /* ASN sig error, unsupported hash type */ 00085 ASN_SIG_KEY_E = -157, /* ASN sig error, unsupported key type */ 00086 ASN_DH_KEY_E = -158, /* ASN key init error, invalid input */ 00087 ASN_NTRU_KEY_E = -159, /* ASN ntru key decode error, invalid input */ 00088 MIN_CODE_E = -200 /* errors -101 - -199 */ 00089 }; 00090 00091 00092 void CTaoCryptErrorString(int error, char* buffer); 00093 00094 00095 #ifdef __cplusplus 00096 } /* extern "C" */ 00097 #endif 00098 00099 #endif /* CTAO_CRYPT_ERROR_H */ 00100
Generated on Tue Jul 12 2022 18:43:19 by 1.7.2