]> begriffs open source - freertos/blob - FreeRTOS-Plus/Source/WolfSSL/wolfssl/error-ssl.h
Create minor optimisations (just an asm instruction or two) by using consts in a...
[freertos] / FreeRTOS-Plus / Source / WolfSSL / wolfssl / error-ssl.h
1 /* error-ssl.h
2  *
3  * Copyright (C) 2006-2015 wolfSSL Inc.
4  *
5  * This file is part of wolfSSL. (formerly known as CyaSSL)
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-1301, USA
20  */
21
22
23 #ifndef WOLFSSL_ERROR_H
24 #define WOLFSSL_ERROR_H
25
26 #include <wolfssl/wolfcrypt/error-crypt.h>   /* pull in wolfCrypt errors */
27
28 #ifdef __cplusplus
29     extern "C" {
30 #endif
31
32 enum wolfSSL_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     SECURE_RENEGOTIATION_E  = -388,        /* Invalid Renegotiation Info */
122     SESSION_TICKET_LEN_E    = -389,        /* Session Ticket too large */
123     SESSION_TICKET_EXPECT_E = -390,        /* Session Ticket missing   */
124     SCR_DIFFERENT_CERT_E    = -391,        /* SCR Different cert error  */
125     SESSION_SECRET_CB_E     = -392,        /* Session secret Cb fcn failure */
126     NO_CHANGE_CIPHER_E      = -393,        /* Finished before change cipher */
127     SANITY_MSG_E            = -394,        /* Sanity check on msg order error */
128     DUPLICATE_MSG_E         = -395,        /* Duplicate message error */
129     SNI_UNSUPPORTED         = -396,        /* SSL 3.0 does not support SNI */
130     SOCKET_PEER_CLOSED_E    = -397,        /* Underlying transport closed */
131
132     BAD_TICKET_KEY_CB_SZ    = -398,        /* Bad session ticket key cb size */
133     BAD_TICKET_MSG_SZ       = -399,        /* Bad session ticket msg size    */
134     BAD_TICKET_ENCRYPT      = -400,        /* Bad user ticket encrypt        */
135
136     DH_KEY_SIZE_E           = -401,        /* DH Key too small */
137
138     /* add strings to SetErrorString !!!!! */
139
140     /* begin negotiation parameter errors */
141     UNSUPPORTED_SUITE       = -500,        /* unsupported cipher suite */
142     MATCH_SUITE_ERROR       = -501         /* can't match cipher suite */
143     /* end negotiation parameter errors only 10 for now */
144     /* add strings to SetErrorString !!!!! */
145
146     /* no error stings go down here, add above negotiation errors !!!! */
147 };
148
149
150 #ifdef WOLFSSL_CALLBACKS
151     enum {
152         MIN_PARAM_ERR = UNSUPPORTED_SUITE,
153         MAX_PARAM_ERR = MIN_PARAM_ERR - 10
154     };
155 #endif
156
157
158 WOLFSSL_LOCAL
159 void SetErrorString(int err, char* buff);
160
161
162 #ifdef __cplusplus
163     }  /* extern "C" */
164 #endif
165
166
167 #endif /* wolfSSL_ERROR_H */
168
169