cya_u
Fork of CyaSSL-forEncrypt by
error.h@2:d0516dc143b1, 2017-05-10 (annotated)
- Committer:
- vbahl2
- Date:
- Wed May 10 18:20:47 2017 +0000
- Revision:
- 2:d0516dc143b1
- Parent:
- 0:5045d2638c29
updated
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
toddouska | 0:5045d2638c29 | 1 | /* error.h |
toddouska | 0:5045d2638c29 | 2 | * |
toddouska | 0:5045d2638c29 | 3 | * Copyright (C) 2006-2009 Sawtooth Consulting Ltd. |
toddouska | 0:5045d2638c29 | 4 | * |
toddouska | 0:5045d2638c29 | 5 | * This file is part of CyaSSL. |
toddouska | 0:5045d2638c29 | 6 | * |
toddouska | 0:5045d2638c29 | 7 | * CyaSSL is free software; you can redistribute it and/or modify |
toddouska | 0:5045d2638c29 | 8 | * it under the terms of the GNU General Public License as published by |
toddouska | 0:5045d2638c29 | 9 | * the Free Software Foundation; either version 2 of the License, or |
toddouska | 0:5045d2638c29 | 10 | * (at your option) any later version. |
toddouska | 0:5045d2638c29 | 11 | * |
toddouska | 0:5045d2638c29 | 12 | * CyaSSL is distributed in the hope that it will be useful, |
toddouska | 0:5045d2638c29 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
toddouska | 0:5045d2638c29 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
toddouska | 0:5045d2638c29 | 15 | * GNU General Public License for more details. |
toddouska | 0:5045d2638c29 | 16 | * |
toddouska | 0:5045d2638c29 | 17 | * You should have received a copy of the GNU General Public License |
toddouska | 0:5045d2638c29 | 18 | * along with this program; if not, write to the Free Software |
toddouska | 0:5045d2638c29 | 19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
toddouska | 0:5045d2638c29 | 20 | */ |
toddouska | 0:5045d2638c29 | 21 | |
toddouska | 0:5045d2638c29 | 22 | |
toddouska | 0:5045d2638c29 | 23 | #ifndef CTAO_CRYPT_ERROR_H |
toddouska | 0:5045d2638c29 | 24 | #define CTAO_CRYPT_ERROR_H |
toddouska | 0:5045d2638c29 | 25 | |
toddouska | 0:5045d2638c29 | 26 | #include "types.h" |
toddouska | 0:5045d2638c29 | 27 | |
toddouska | 0:5045d2638c29 | 28 | |
toddouska | 0:5045d2638c29 | 29 | #ifdef __cplusplus |
toddouska | 0:5045d2638c29 | 30 | extern "C" { |
toddouska | 0:5045d2638c29 | 31 | #endif |
toddouska | 0:5045d2638c29 | 32 | |
toddouska | 0:5045d2638c29 | 33 | |
toddouska | 0:5045d2638c29 | 34 | /* error codes */ |
toddouska | 0:5045d2638c29 | 35 | enum { |
toddouska | 0:5045d2638c29 | 36 | MAX_ERROR_SZ = 80, /* max size of error string */ |
toddouska | 0:5045d2638c29 | 37 | MAX_CODE_E = -100, /* errors -101 - -199 */ |
toddouska | 0:5045d2638c29 | 38 | OPEN_RAN_E = -101, /* opening random device error */ |
toddouska | 0:5045d2638c29 | 39 | READ_RAN_E = -102, /* reading random device error */ |
toddouska | 0:5045d2638c29 | 40 | WINCRYPT_E = -103, /* windows crypt init error */ |
toddouska | 0:5045d2638c29 | 41 | CRYPTGEN_E = -104, /* windows crypt generation error */ |
toddouska | 0:5045d2638c29 | 42 | RAN_BLOCK_E = -105, /* reading random device would block */ |
toddouska | 0:5045d2638c29 | 43 | |
toddouska | 0:5045d2638c29 | 44 | MP_INIT_E = -110, /* mp_init error state */ |
toddouska | 0:5045d2638c29 | 45 | MP_READ_E = -111, /* mp_read error state */ |
toddouska | 0:5045d2638c29 | 46 | MP_EXPTMOD_E = -112, /* mp_exptmod error state */ |
toddouska | 0:5045d2638c29 | 47 | MP_TO_E = -113, /* mp_to_xxx error state, can't convert */ |
toddouska | 0:5045d2638c29 | 48 | MP_SUB_E = -114, /* mp_sub error state, can't subtract */ |
toddouska | 0:5045d2638c29 | 49 | MP_ADD_E = -115, /* mp_add error state, can't add */ |
toddouska | 0:5045d2638c29 | 50 | MP_MUL_E = -116, /* mp_mul error state, can't multiply */ |
toddouska | 0:5045d2638c29 | 51 | MP_MULMOD_E = -117, /* mp_mulmod error state, can't multiply mod */ |
toddouska | 0:5045d2638c29 | 52 | MP_MOD_E = -118, /* mp_mod error state, can't mod */ |
toddouska | 0:5045d2638c29 | 53 | MP_INVMOD_E = -119, /* mp_invmod error state, can't inv mod */ |
toddouska | 0:5045d2638c29 | 54 | MP_CMP_E = -120, /* mp_cmp error state */ |
toddouska | 0:5045d2638c29 | 55 | |
toddouska | 0:5045d2638c29 | 56 | MEMORY_E = -125, /* out of memory error */ |
toddouska | 0:5045d2638c29 | 57 | |
toddouska | 0:5045d2638c29 | 58 | RSA_WRONG_TYPE_E = -130, /* RSA wrong block type for RSA function */ |
toddouska | 0:5045d2638c29 | 59 | RSA_BUFFER_E = -131, /* RSA buffer error, output too small or |
toddouska | 0:5045d2638c29 | 60 | input too large */ |
toddouska | 0:5045d2638c29 | 61 | BUFFER_E = -132, /* output buffer too small or input too large */ |
toddouska | 0:5045d2638c29 | 62 | ALGO_ID_E = -133, /* setting algo id error */ |
toddouska | 0:5045d2638c29 | 63 | PUBLIC_KEY_E = -134, /* setting public key error */ |
toddouska | 0:5045d2638c29 | 64 | DATE_E = -135, /* setting date validity error */ |
toddouska | 0:5045d2638c29 | 65 | SUBJECT_E = -136, /* setting subject name error */ |
toddouska | 0:5045d2638c29 | 66 | ISSUER_E = -137, /* setting issuer name error */ |
toddouska | 0:5045d2638c29 | 67 | |
toddouska | 0:5045d2638c29 | 68 | ASN_PARSE_E = -140, /* ASN parsing error, invalid input */ |
toddouska | 0:5045d2638c29 | 69 | ASN_VERSION_E = -141, /* ASN version error, invalid number */ |
toddouska | 0:5045d2638c29 | 70 | ASN_GETINT_E = -142, /* ASN get big int error, invalid data */ |
toddouska | 0:5045d2638c29 | 71 | ASN_RSA_KEY_E = -143, /* ASN key init error, invalid input */ |
toddouska | 0:5045d2638c29 | 72 | ASN_OBJECT_ID_E = -144, /* ASN object id error, invalid id */ |
toddouska | 0:5045d2638c29 | 73 | ASN_TAG_NULL_E = -145, /* ASN tag error, not null */ |
toddouska | 0:5045d2638c29 | 74 | ASN_EXPECT_0_E = -146, /* ASN expect error, not zero */ |
toddouska | 0:5045d2638c29 | 75 | ASN_BITSTR_E = -147, /* ASN bit string error, wrong id */ |
toddouska | 0:5045d2638c29 | 76 | ASN_UNKNOWN_OID_E = -148, /* ASN oid error, unknown sum id */ |
toddouska | 0:5045d2638c29 | 77 | ASN_DATE_SZ_E = -149, /* ASN date error, bad size */ |
toddouska | 0:5045d2638c29 | 78 | ASN_BEFORE_DATE_E = -150, /* ASN date error, current date before */ |
toddouska | 0:5045d2638c29 | 79 | ASN_AFTER_DATE_E = -151, /* ASN date error, current date after */ |
toddouska | 0:5045d2638c29 | 80 | ASN_SIG_OID_E = -152, /* ASN signature error, mismatched oid */ |
toddouska | 0:5045d2638c29 | 81 | ASN_TIME_E = -153, /* ASN time error, unkown time type */ |
toddouska | 0:5045d2638c29 | 82 | ASN_INPUT_E = -154, /* ASN input error, not enough data */ |
toddouska | 0:5045d2638c29 | 83 | ASN_SIG_CONFIRM_E = -155, /* ASN sig error, confirm failure */ |
toddouska | 0:5045d2638c29 | 84 | ASN_SIG_HASH_E = -156, /* ASN sig error, unsupported hash type */ |
toddouska | 0:5045d2638c29 | 85 | ASN_SIG_KEY_E = -157, /* ASN sig error, unsupported key type */ |
toddouska | 0:5045d2638c29 | 86 | ASN_DH_KEY_E = -158, /* ASN key init error, invalid input */ |
toddouska | 0:5045d2638c29 | 87 | ASN_NTRU_KEY_E = -159, /* ASN ntru key decode error, invalid input */ |
toddouska | 0:5045d2638c29 | 88 | MIN_CODE_E = -200 /* errors -101 - -199 */ |
toddouska | 0:5045d2638c29 | 89 | }; |
toddouska | 0:5045d2638c29 | 90 | |
toddouska | 0:5045d2638c29 | 91 | |
toddouska | 0:5045d2638c29 | 92 | void CTaoCryptErrorString(int error, char* buffer); |
toddouska | 0:5045d2638c29 | 93 | |
toddouska | 0:5045d2638c29 | 94 | |
toddouska | 0:5045d2638c29 | 95 | #ifdef __cplusplus |
toddouska | 0:5045d2638c29 | 96 | } /* extern "C" */ |
toddouska | 0:5045d2638c29 | 97 | #endif |
toddouska | 0:5045d2638c29 | 98 | |
toddouska | 0:5045d2638c29 | 99 | #endif /* CTAO_CRYPT_ERROR_H */ |
toddouska | 0:5045d2638c29 | 100 |