wolfSSL SSL/TLS library, support up to TLS1.3

Dependents:   OS

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers error-ssl.h Source File

error-ssl.h

00001 /* error-ssl.h
00002  *
00003  * Copyright (C) 2006-2017 wolfSSL Inc.
00004  *
00005  * This file is part of wolfSSL.
00006  *
00007  * wolfSSL 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  * wolfSSL 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
00020  */
00021 
00022 
00023 
00024 #ifndef WOLFSSL_ERROR_H
00025 #define WOLFSSL_ERROR_H
00026 
00027 #include <wolfcrypt/error-crypt.h>   /* pull in wolfCrypt errors */
00028 
00029 #ifdef __cplusplus
00030     extern "C" {
00031 #endif
00032 
00033 enum wolfSSL_ErrorCodes {
00034     INPUT_CASE_ERROR             = -301,   /* process input state error */
00035     PREFIX_ERROR                 = -302,   /* bad index to key rounds  */
00036     MEMORY_ERROR                 = -303,   /* out of memory            */
00037     VERIFY_FINISHED_ERROR        = -304,   /* verify problem on finished */
00038     VERIFY_MAC_ERROR             = -305,   /* verify mac problem       */
00039     PARSE_ERROR                  = -306,   /* parse error on header    */
00040     UNKNOWN_HANDSHAKE_TYPE       = -307,   /* weird handshake type     */
00041     SOCKET_ERROR_E               = -308,   /* error state on socket    */
00042     SOCKET_NODATA                = -309,   /* expected data, not there */
00043     INCOMPLETE_DATA              = -310,   /* don't have enough data to
00044                                               complete task            */
00045     UNKNOWN_RECORD_TYPE          = -311,   /* unknown type in record hdr */
00046     DECRYPT_ERROR                = -312,   /* error during decryption  */
00047     FATAL_ERROR                  = -313,   /* recvd alert fatal error  */
00048     ENCRYPT_ERROR                = -314,   /* error during encryption  */
00049     FREAD_ERROR                  = -315,   /* fread problem            */
00050     NO_PEER_KEY                  = -316,   /* need peer's key          */
00051     NO_PRIVATE_KEY               = -317,   /* need the private key     */
00052     RSA_PRIVATE_ERROR            = -318,   /* error during rsa priv op */
00053     NO_DH_PARAMS                 = -319,   /* server missing DH params */
00054     BUILD_MSG_ERROR              = -320,   /* build message failure    */
00055 
00056     BAD_HELLO                    = -321,   /* client hello malformed   */
00057     DOMAIN_NAME_MISMATCH         = -322,   /* peer subject name mismatch */
00058     WANT_READ                    = -323,   /* want read, call again    */
00059     NOT_READY_ERROR              = -324,   /* handshake layer not ready */
00060 
00061     VERSION_ERROR                = -326,   /* record layer version error */
00062     WANT_WRITE                   = -327,   /* want write, call again   */
00063     BUFFER_ERROR                 = -328,   /* malformed buffer input   */
00064     VERIFY_CERT_ERROR            = -329,   /* verify cert error        */
00065     VERIFY_SIGN_ERROR            = -330,   /* verify sign error        */
00066     CLIENT_ID_ERROR              = -331,   /* psk client identity error  */
00067     SERVER_HINT_ERROR            = -332,   /* psk server hint error  */
00068     PSK_KEY_ERROR                = -333,   /* psk key error  */
00069     ZLIB_INIT_ERROR              = -334,   /* zlib init error  */
00070     ZLIB_COMPRESS_ERROR          = -335,   /* zlib compression error  */
00071     ZLIB_DECOMPRESS_ERROR        = -336,   /* zlib decompression error  */
00072 
00073     GETTIME_ERROR                = -337,   /* gettimeofday failed ??? */
00074     GETITIMER_ERROR              = -338,   /* getitimer failed ??? */
00075     SIGACT_ERROR                 = -339,   /* sigaction failed ??? */
00076     SETITIMER_ERROR              = -340,   /* setitimer failed ??? */
00077     LENGTH_ERROR                 = -341,   /* record layer length error */
00078     PEER_KEY_ERROR               = -342,   /* can't decode peer key */
00079     ZERO_RETURN                  = -343,   /* peer sent close notify */
00080     SIDE_ERROR                   = -344,   /* wrong client/server type */
00081     NO_PEER_CERT                 = -345,   /* peer didn't send key */
00082     NTRU_KEY_ERROR               = -346,   /* NTRU key error  */
00083     NTRU_DRBG_ERROR              = -347,   /* NTRU drbg error  */
00084     NTRU_ENCRYPT_ERROR           = -348,   /* NTRU encrypt error  */
00085     NTRU_DECRYPT_ERROR           = -349,   /* NTRU decrypt error  */
00086     ECC_CURVETYPE_ERROR          = -350,   /* Bad ECC Curve Type */
00087     ECC_CURVE_ERROR              = -351,   /* Bad ECC Curve */
00088     ECC_PEERKEY_ERROR            = -352,   /* Bad Peer ECC Key */
00089     ECC_MAKEKEY_ERROR            = -353,   /* Bad Make ECC Key */
00090     ECC_EXPORT_ERROR             = -354,   /* Bad ECC Export Key */
00091     ECC_SHARED_ERROR             = -355,   /* Bad ECC Shared Secret */
00092     NOT_CA_ERROR                 = -357,   /* Not a CA cert error */
00093 
00094     BAD_CERT_MANAGER_ERROR       = -359,   /* Bad Cert Manager */
00095     OCSP_CERT_REVOKED            = -360,   /* OCSP Certificate revoked */
00096     CRL_CERT_REVOKED             = -361,   /* CRL Certificate revoked */
00097     CRL_MISSING                  = -362,   /* CRL Not loaded */
00098     MONITOR_SETUP_E              = -363,   /* CRL Monitor setup error */
00099     THREAD_CREATE_E              = -364,   /* Thread Create Error */
00100     OCSP_NEED_URL                = -365,   /* OCSP need an URL for lookup */
00101     OCSP_CERT_UNKNOWN            = -366,   /* OCSP responder doesn't know */
00102     OCSP_LOOKUP_FAIL             = -367,   /* OCSP lookup not successful */
00103     MAX_CHAIN_ERROR              = -368,   /* max chain depth exceeded */
00104     COOKIE_ERROR                 = -369,   /* dtls cookie error */
00105     SEQUENCE_ERROR               = -370,   /* dtls sequence error */
00106     SUITES_ERROR                 = -371,   /* suites pointer error */
00107 
00108     OUT_OF_ORDER_E               = -373,   /* out of order message */
00109     BAD_KEA_TYPE_E               = -374,   /* bad KEA type found */
00110     SANITY_CIPHER_E              = -375,   /* sanity check on cipher error */
00111     RECV_OVERFLOW_E              = -376,   /* RXCB returned more than rqed */
00112     GEN_COOKIE_E                 = -377,   /* Generate Cookie Error */
00113     NO_PEER_VERIFY               = -378,   /* Need peer cert verify Error */
00114     FWRITE_ERROR                 = -379,   /* fwrite problem */
00115     CACHE_MATCH_ERROR            = -380,   /* chache hdr match error */
00116     UNKNOWN_SNI_HOST_NAME_E      = -381,   /* Unrecognized host name Error */
00117     UNKNOWN_MAX_FRAG_LEN_E       = -382,   /* Unrecognized max frag len Error */
00118     KEYUSE_SIGNATURE_E           = -383,   /* KeyUse digSignature error */
00119     KEYUSE_ENCIPHER_E            = -385,   /* KeyUse keyEncipher error */
00120     EXTKEYUSE_AUTH_E             = -386,   /* ExtKeyUse server|client_auth */
00121     SEND_OOB_READ_E              = -387,   /* Send Cb out of bounds read */
00122     SECURE_RENEGOTIATION_E       = -388,   /* Invalid Renegotiation Info */
00123     SESSION_TICKET_LEN_E         = -389,   /* Session Ticket too large */
00124     SESSION_TICKET_EXPECT_E      = -390,   /* Session Ticket missing   */
00125     SCR_DIFFERENT_CERT_E         = -391,   /* SCR Different cert error  */
00126     SESSION_SECRET_CB_E          = -392,   /* Session secret Cb fcn failure */
00127     NO_CHANGE_CIPHER_E           = -393,   /* Finished before change cipher */
00128     SANITY_MSG_E                 = -394,   /* Sanity check on msg order error */
00129     DUPLICATE_MSG_E              = -395,   /* Duplicate message error */
00130     SNI_UNSUPPORTED              = -396,   /* SSL 3.0 does not support SNI */
00131     SOCKET_PEER_CLOSED_E         = -397,   /* Underlying transport closed */
00132 
00133     BAD_TICKET_KEY_CB_SZ         = -398,   /* Bad session ticket key cb size */
00134     BAD_TICKET_MSG_SZ            = -399,   /* Bad session ticket msg size    */
00135     BAD_TICKET_ENCRYPT           = -400,   /* Bad user ticket encrypt        */
00136 
00137     DH_KEY_SIZE_E                = -401,   /* DH Key too small */
00138     SNI_ABSENT_ERROR             = -402,   /* No SNI request. */
00139     RSA_SIGN_FAULT               = -403,   /* RSA Sign fault */
00140     HANDSHAKE_SIZE_ERROR         = -404,   /* Handshake message too large */
00141 
00142     UNKNOWN_ALPN_PROTOCOL_NAME_E = -405,   /* Unrecognized protocol name Error*/
00143     BAD_CERTIFICATE_STATUS_ERROR = -406,   /* Bad certificate status message */
00144     OCSP_INVALID_STATUS          = -407,   /* Invalid OCSP Status */
00145     OCSP_WANT_READ               = -408,   /* OCSP callback response WOLFSSL_CBIO_ERR_WANT_READ */
00146     RSA_KEY_SIZE_E               = -409,   /* RSA key too small */
00147     ECC_KEY_SIZE_E               = -410,   /* ECC key too small */
00148 
00149     DTLS_EXPORT_VER_E            = -411,   /* export version error */
00150     INPUT_SIZE_E                 = -412,   /* input size too big error */
00151     CTX_INIT_MUTEX_E             = -413,   /* initialize ctx mutex error */
00152     EXT_MASTER_SECRET_NEEDED_E   = -414,   /* need EMS enabled to resume */
00153     DTLS_POOL_SZ_E               = -415,   /* exceeded DTLS pool size */
00154     DECODE_E                     = -416,   /* decode handshake message error */
00155     HTTP_TIMEOUT                 = -417,   /* HTTP timeout for OCSP or CRL req */
00156     WRITE_DUP_READ_E             = -418,   /* Write dup write side can't read */
00157     WRITE_DUP_WRITE_E            = -419,   /* Write dup read side can't write */
00158     INVALID_CERT_CTX_E           = -420,   /* TLS cert ctx not matching */
00159     BAD_KEY_SHARE_DATA           = -421,   /* Key Share data invalid */
00160     MISSING_HANDSHAKE_DATA       = -422,   /* Handshake message missing data */
00161     BAD_BINDER                   = -423,   /* Binder does not match */
00162     EXT_NOT_ALLOWED              = -424,   /* Extension not allowed in msg */
00163     INVALID_PARAMETER            = -425,   /* Security parameter invalid */
00164     MCAST_HIGHWATER_CB_E         = -426,   /* Multicast highwater cb err */
00165     ALERT_COUNT_E                = -427,   /* Alert Count exceeded err */
00166     EXT_MISSING                  = -428,   /* Required extension not found */
00167     UNSUPPORTED_EXTENSION        = -429,   /* TLSX not requested by client */
00168     /* add strings to wolfSSL_ERR_reason_error_string in internal.c !!!!! */
00169 
00170     /* begin negotiation parameter errors */
00171     UNSUPPORTED_SUITE            = -500,   /* unsupported cipher suite */
00172     MATCH_SUITE_ERROR            = -501,   /* can't match cipher suite */
00173     COMPRESSION_ERROR            = -502,   /* compression mismatch */
00174     KEY_SHARE_ERROR              = -503,   /* key share mismatch */
00175     POST_HAND_AUTH_ERROR         = -504,   /* client won't do post-hand auth */
00176     HRR_COOKIE_ERROR             = -505    /* HRR msg cookie mismatch */
00177     /* end negotiation parameter errors only 10 for now */
00178     /* add strings to wolfSSL_ERR_reason_error_string in internal.c !!!!! */
00179 
00180     /* no error stings go down here, add above negotiation errors !!!! */
00181 };
00182 
00183 
00184 #if defined(WOLFSSL_CALLBACKS) || defined(OPENSSL_EXTRA)
00185     enum {
00186         MIN_PARAM_ERR = UNSUPPORTED_SUITE,
00187         MAX_PARAM_ERR = MIN_PARAM_ERR - 10
00188     };
00189 #endif
00190 
00191 
00192 WOLFSSL_LOCAL
00193 void SetErrorString(int err, char* buff);
00194 
00195 
00196 #ifdef __cplusplus
00197     }  /* extern "C" */
00198 #endif
00199 
00200 
00201 #endif /* wolfSSL_ERROR_H */
00202