]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Source/WolfSSL/cyassl/error-ssl.h
71778ec1567cb1ace6009585ea5c7440f664c1c3
[freertos] / FreeRTOS-Plus / Source / WolfSSL / cyassl / error-ssl.h
1 /* error-ssl.h
2  *
3  * Copyright (C) 2006-2014 wolfSSL Inc.
4  *
5  * This file is part of CyaSSL.
6  *
7  * CyaSSL 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  * CyaSSL 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-1301, USA
20  */
21
22
23 #ifndef CYASSL_ERROR_H
24 #define CYASSL_ERROR_H
25
26 #include <cyassl/ctaocrypt/error-crypt.h>   /* pull in CTaoCrypt errors */
27
28 #ifdef __cplusplus
29     extern "C" {
30 #endif
31
32 enum CyaSSL_ErrorCodes {
33     INPUT_CASE_ERROR        = -301,        /* process input state error */
34     PREFIX_ERROR            = -302,        /* bad index to key rounds  */
35     MEMORY_ERROR            = -303,        /* out of memory            */
36     VERIFY_FINISHED_ERROR   = -304,        /* verify problem on finished */
37     VERIFY_MAC_ERROR        = -305,        /* verify mac problem       */
38     PARSE_ERROR             = -306,        /* parse error on header    */
39     UNKNOWN_HANDSHAKE_TYPE  = -307,        /* weird handshake type     */
40     SOCKET_ERROR_E          = -308,        /* error state on socket    */
41     SOCKET_NODATA           = -309,        /* expected data, not there */
42     INCOMPLETE_DATA         = -310,        /* don't have enough data to
43                                               complete task            */
44     UNKNOWN_RECORD_TYPE     = -311,        /* unknown type in record hdr */
45     DECRYPT_ERROR           = -312,        /* error during decryption  */
46     FATAL_ERROR             = -313,        /* recvd alert fatal error  */
47     ENCRYPT_ERROR           = -314,        /* error during encryption  */
48     FREAD_ERROR             = -315,        /* fread problem            */
49     NO_PEER_KEY             = -316,        /* need peer's key          */
50     NO_PRIVATE_KEY          = -317,        /* need the private key     */
51     RSA_PRIVATE_ERROR       = -318,        /* error during rsa priv op */
52     NO_DH_PARAMS            = -319,        /* server missing DH params */
53     BUILD_MSG_ERROR         = -320,        /* build message failure    */
54
55     BAD_HELLO               = -321,        /* client hello malformed   */
56     DOMAIN_NAME_MISMATCH    = -322,        /* peer subject name mismatch */
57     WANT_READ               = -323,        /* want read, call again    */
58     NOT_READY_ERROR         = -324,        /* handshake layer not ready */
59     PMS_VERSION_ERROR       = -325,        /* pre m secret version error */
60     VERSION_ERROR           = -326,        /* record layer version error */
61     WANT_WRITE              = -327,        /* want write, call again   */
62     BUFFER_ERROR            = -328,        /* malformed buffer input   */
63     VERIFY_CERT_ERROR       = -329,        /* verify cert error        */
64     VERIFY_SIGN_ERROR       = -330,        /* verify sign error        */
65     CLIENT_ID_ERROR         = -331,        /* psk client identity error  */
66     SERVER_HINT_ERROR       = -332,        /* psk server hint error  */
67     PSK_KEY_ERROR           = -333,        /* psk key error  */
68     ZLIB_INIT_ERROR         = -334,        /* zlib init error  */
69     ZLIB_COMPRESS_ERROR     = -335,        /* zlib compression error  */
70     ZLIB_DECOMPRESS_ERROR   = -336,        /* zlib decompression error  */
71
72     GETTIME_ERROR           = -337,        /* gettimeofday failed ??? */
73     GETITIMER_ERROR         = -338,        /* getitimer failed ??? */
74     SIGACT_ERROR            = -339,        /* sigaction failed ??? */
75     SETITIMER_ERROR         = -340,        /* setitimer failed ??? */
76     LENGTH_ERROR            = -341,        /* record layer length error */
77     PEER_KEY_ERROR          = -342,        /* can't decode peer key */
78     ZERO_RETURN             = -343,        /* peer sent close notify */
79     SIDE_ERROR              = -344,        /* wrong client/server type */
80     NO_PEER_CERT            = -345,        /* peer didn't send key */
81     NTRU_KEY_ERROR          = -346,        /* NTRU key error  */
82     NTRU_DRBG_ERROR         = -347,        /* NTRU drbg error  */
83     NTRU_ENCRYPT_ERROR      = -348,        /* NTRU encrypt error  */
84     NTRU_DECRYPT_ERROR      = -349,        /* NTRU decrypt error  */
85     ECC_CURVETYPE_ERROR     = -350,        /* Bad ECC Curve Type */
86     ECC_CURVE_ERROR         = -351,        /* Bad ECC Curve */
87     ECC_PEERKEY_ERROR       = -352,        /* Bad Peer ECC Key */
88     ECC_MAKEKEY_ERROR       = -353,        /* Bad Make ECC Key */
89     ECC_EXPORT_ERROR        = -354,        /* Bad ECC Export Key */
90     ECC_SHARED_ERROR        = -355,        /* Bad ECC Shared Secret */
91     NOT_CA_ERROR            = -357,        /* Not a CA cert error */
92     BAD_PATH_ERROR          = -358,        /* Bad path for opendir */
93     BAD_CERT_MANAGER_ERROR  = -359,        /* Bad Cert Manager */
94     OCSP_CERT_REVOKED       = -360,        /* OCSP Certificate revoked */
95     CRL_CERT_REVOKED        = -361,        /* CRL Certificate revoked */
96     CRL_MISSING             = -362,        /* CRL Not loaded */
97     MONITOR_RUNNING_E       = -363,        /* CRL Monitor already running */
98     THREAD_CREATE_E         = -364,        /* Thread Create Error */
99     OCSP_NEED_URL           = -365,        /* OCSP need an URL for lookup */
100     OCSP_CERT_UNKNOWN       = -366,        /* OCSP responder doesn't know */
101     OCSP_LOOKUP_FAIL        = -367,        /* OCSP lookup not successful */
102     MAX_CHAIN_ERROR         = -368,        /* max chain depth exceeded */
103     COOKIE_ERROR            = -369,        /* dtls cookie error */
104     SEQUENCE_ERROR          = -370,        /* dtls sequence error */
105     SUITES_ERROR            = -371,        /* suites pointer error */
106     SSL_NO_PEM_HEADER       = -372,        /* no PEM header found */
107     OUT_OF_ORDER_E          = -373,        /* out of order message */
108     BAD_KEA_TYPE_E          = -374,        /* bad KEA type found */
109     SANITY_CIPHER_E         = -375,        /* sanity check on cipher error */
110     RECV_OVERFLOW_E         = -376,        /* RXCB returned more than rqed */
111     GEN_COOKIE_E            = -377,        /* Generate Cookie Error */
112     NO_PEER_VERIFY          = -378,        /* Need peer cert verify Error */
113     FWRITE_ERROR            = -379,        /* fwrite problem */
114     CACHE_MATCH_ERROR       = -380,        /* chache hdr match error */
115     UNKNOWN_SNI_HOST_NAME_E = -381,        /* Unrecognized host name Error */
116     UNKNOWN_MAX_FRAG_LEN_E  = -382,        /* Unrecognized max frag len Error */
117     KEYUSE_SIGNATURE_E      = -383,        /* KeyUse digSignature error */
118     KEYUSE_ENCIPHER_E       = -385,        /* KeyUse keyEncipher error */
119     EXTKEYUSE_AUTH_E        = -386,        /* ExtKeyUse server|client_auth */
120     SEND_OOB_READ_E         = -387,        /* Send Cb out of bounds read */
121     /* add strings to SetErrorString !!!!! */
122
123     /* begin negotiation parameter errors */
124     UNSUPPORTED_SUITE       = -390,        /* unsupported cipher suite */
125     MATCH_SUITE_ERROR       = -391         /* can't match cipher suite */
126     /* end negotiation parameter errors only 10 for now */
127     /* add strings to SetErrorString !!!!! */
128 };
129
130
131 #ifdef CYASSL_CALLBACKS
132     enum {
133         MIN_PARAM_ERR = UNSUPPORTED_SUITE,
134         MAX_PARAM_ERR = MIN_PARAM_ERR - 10
135     };
136 #endif
137
138
139 CYASSL_LOCAL
140 void SetErrorString(int err, char* buff);
141
142
143 #ifdef __cplusplus
144     }  /* extern "C" */
145 #endif
146
147
148 #endif /* CyaSSL_ERROR_H */
149
150