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

Dependents:   CyaSSL-Twitter-OAuth4Tw Example-client-tls-cert TwitterReader TweetTest ... more

Committer:
wolfSSL
Date:
Fri Jun 05 00:11:07 2020 +0000
Revision:
17:a5f916481144
Parent:
16:8e0d178b1d1e
wolfSSL 4.4.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 15:117db924cf7c 1 /* error-ssl.h
wolfSSL 15:117db924cf7c 2 *
wolfSSL 16:8e0d178b1d1e 3 * Copyright (C) 2006-2020 wolfSSL Inc.
wolfSSL 15:117db924cf7c 4 *
wolfSSL 15:117db924cf7c 5 * This file is part of wolfSSL.
wolfSSL 15:117db924cf7c 6 *
wolfSSL 15:117db924cf7c 7 * wolfSSL is free software; you can redistribute it and/or modify
wolfSSL 15:117db924cf7c 8 * it under the terms of the GNU General Public License as published by
wolfSSL 15:117db924cf7c 9 * the Free Software Foundation; either version 2 of the License, or
wolfSSL 15:117db924cf7c 10 * (at your option) any later version.
wolfSSL 15:117db924cf7c 11 *
wolfSSL 15:117db924cf7c 12 * wolfSSL is distributed in the hope that it will be useful,
wolfSSL 15:117db924cf7c 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
wolfSSL 15:117db924cf7c 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wolfSSL 15:117db924cf7c 15 * GNU General Public License for more details.
wolfSSL 15:117db924cf7c 16 *
wolfSSL 15:117db924cf7c 17 * You should have received a copy of the GNU General Public License
wolfSSL 15:117db924cf7c 18 * along with this program; if not, write to the Free Software
wolfSSL 15:117db924cf7c 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
wolfSSL 15:117db924cf7c 20 */
wolfSSL 15:117db924cf7c 21
wolfSSL 15:117db924cf7c 22
wolfSSL 15:117db924cf7c 23
wolfSSL 15:117db924cf7c 24 #ifndef WOLFSSL_ERROR_H
wolfSSL 15:117db924cf7c 25 #define WOLFSSL_ERROR_H
wolfSSL 15:117db924cf7c 26
wolfSSL 15:117db924cf7c 27 #include <wolfssl/wolfcrypt/error-crypt.h> /* pull in wolfCrypt errors */
wolfSSL 15:117db924cf7c 28
wolfSSL 15:117db924cf7c 29 #ifdef __cplusplus
wolfSSL 15:117db924cf7c 30 extern "C" {
wolfSSL 15:117db924cf7c 31 #endif
wolfSSL 15:117db924cf7c 32
wolfSSL 15:117db924cf7c 33 enum wolfSSL_ErrorCodes {
wolfSSL 15:117db924cf7c 34 INPUT_CASE_ERROR = -301, /* process input state error */
wolfSSL 15:117db924cf7c 35 PREFIX_ERROR = -302, /* bad index to key rounds */
wolfSSL 15:117db924cf7c 36 MEMORY_ERROR = -303, /* out of memory */
wolfSSL 15:117db924cf7c 37 VERIFY_FINISHED_ERROR = -304, /* verify problem on finished */
wolfSSL 15:117db924cf7c 38 VERIFY_MAC_ERROR = -305, /* verify mac problem */
wolfSSL 15:117db924cf7c 39 PARSE_ERROR = -306, /* parse error on header */
wolfSSL 15:117db924cf7c 40 UNKNOWN_HANDSHAKE_TYPE = -307, /* weird handshake type */
wolfSSL 15:117db924cf7c 41 SOCKET_ERROR_E = -308, /* error state on socket */
wolfSSL 15:117db924cf7c 42 SOCKET_NODATA = -309, /* expected data, not there */
wolfSSL 15:117db924cf7c 43 INCOMPLETE_DATA = -310, /* don't have enough data to
wolfSSL 15:117db924cf7c 44 complete task */
wolfSSL 15:117db924cf7c 45 UNKNOWN_RECORD_TYPE = -311, /* unknown type in record hdr */
wolfSSL 15:117db924cf7c 46 DECRYPT_ERROR = -312, /* error during decryption */
wolfSSL 15:117db924cf7c 47 FATAL_ERROR = -313, /* recvd alert fatal error */
wolfSSL 15:117db924cf7c 48 ENCRYPT_ERROR = -314, /* error during encryption */
wolfSSL 15:117db924cf7c 49 FREAD_ERROR = -315, /* fread problem */
wolfSSL 15:117db924cf7c 50 NO_PEER_KEY = -316, /* need peer's key */
wolfSSL 15:117db924cf7c 51 NO_PRIVATE_KEY = -317, /* need the private key */
wolfSSL 15:117db924cf7c 52 RSA_PRIVATE_ERROR = -318, /* error during rsa priv op */
wolfSSL 15:117db924cf7c 53 NO_DH_PARAMS = -319, /* server missing DH params */
wolfSSL 15:117db924cf7c 54 BUILD_MSG_ERROR = -320, /* build message failure */
wolfSSL 15:117db924cf7c 55
wolfSSL 15:117db924cf7c 56 BAD_HELLO = -321, /* client hello malformed */
wolfSSL 15:117db924cf7c 57 DOMAIN_NAME_MISMATCH = -322, /* peer subject name mismatch */
wolfSSL 15:117db924cf7c 58 WANT_READ = -323, /* want read, call again */
wolfSSL 15:117db924cf7c 59 NOT_READY_ERROR = -324, /* handshake layer not ready */
wolfSSL 16:8e0d178b1d1e 60 IPADDR_MISMATCH = -325, /* peer ip address mismatch */
wolfSSL 15:117db924cf7c 61 VERSION_ERROR = -326, /* record layer version error */
wolfSSL 15:117db924cf7c 62 WANT_WRITE = -327, /* want write, call again */
wolfSSL 15:117db924cf7c 63 BUFFER_ERROR = -328, /* malformed buffer input */
wolfSSL 15:117db924cf7c 64 VERIFY_CERT_ERROR = -329, /* verify cert error */
wolfSSL 15:117db924cf7c 65 VERIFY_SIGN_ERROR = -330, /* verify sign error */
wolfSSL 15:117db924cf7c 66 CLIENT_ID_ERROR = -331, /* psk client identity error */
wolfSSL 15:117db924cf7c 67 SERVER_HINT_ERROR = -332, /* psk server hint error */
wolfSSL 15:117db924cf7c 68 PSK_KEY_ERROR = -333, /* psk key error */
wolfSSL 15:117db924cf7c 69
wolfSSL 15:117db924cf7c 70 GETTIME_ERROR = -337, /* gettimeofday failed ??? */
wolfSSL 15:117db924cf7c 71 GETITIMER_ERROR = -338, /* getitimer failed ??? */
wolfSSL 15:117db924cf7c 72 SIGACT_ERROR = -339, /* sigaction failed ??? */
wolfSSL 15:117db924cf7c 73 SETITIMER_ERROR = -340, /* setitimer failed ??? */
wolfSSL 15:117db924cf7c 74 LENGTH_ERROR = -341, /* record layer length error */
wolfSSL 15:117db924cf7c 75 PEER_KEY_ERROR = -342, /* can't decode peer key */
wolfSSL 15:117db924cf7c 76 ZERO_RETURN = -343, /* peer sent close notify */
wolfSSL 15:117db924cf7c 77 SIDE_ERROR = -344, /* wrong client/server type */
wolfSSL 15:117db924cf7c 78 NO_PEER_CERT = -345, /* peer didn't send key */
wolfSSL 15:117db924cf7c 79 NTRU_KEY_ERROR = -346, /* NTRU key error */
wolfSSL 15:117db924cf7c 80 NTRU_DRBG_ERROR = -347, /* NTRU drbg error */
wolfSSL 15:117db924cf7c 81 NTRU_ENCRYPT_ERROR = -348, /* NTRU encrypt error */
wolfSSL 15:117db924cf7c 82 NTRU_DECRYPT_ERROR = -349, /* NTRU decrypt error */
wolfSSL 15:117db924cf7c 83 ECC_CURVETYPE_ERROR = -350, /* Bad ECC Curve Type */
wolfSSL 15:117db924cf7c 84 ECC_CURVE_ERROR = -351, /* Bad ECC Curve */
wolfSSL 15:117db924cf7c 85 ECC_PEERKEY_ERROR = -352, /* Bad Peer ECC Key */
wolfSSL 15:117db924cf7c 86 ECC_MAKEKEY_ERROR = -353, /* Bad Make ECC Key */
wolfSSL 15:117db924cf7c 87 ECC_EXPORT_ERROR = -354, /* Bad ECC Export Key */
wolfSSL 15:117db924cf7c 88 ECC_SHARED_ERROR = -355, /* Bad ECC Shared Secret */
wolfSSL 15:117db924cf7c 89 NOT_CA_ERROR = -357, /* Not a CA cert error */
wolfSSL 15:117db924cf7c 90
wolfSSL 15:117db924cf7c 91 BAD_CERT_MANAGER_ERROR = -359, /* Bad Cert Manager */
wolfSSL 15:117db924cf7c 92 OCSP_CERT_REVOKED = -360, /* OCSP Certificate revoked */
wolfSSL 15:117db924cf7c 93 CRL_CERT_REVOKED = -361, /* CRL Certificate revoked */
wolfSSL 15:117db924cf7c 94 CRL_MISSING = -362, /* CRL Not loaded */
wolfSSL 15:117db924cf7c 95 MONITOR_SETUP_E = -363, /* CRL Monitor setup error */
wolfSSL 15:117db924cf7c 96 THREAD_CREATE_E = -364, /* Thread Create Error */
wolfSSL 15:117db924cf7c 97 OCSP_NEED_URL = -365, /* OCSP need an URL for lookup */
wolfSSL 15:117db924cf7c 98 OCSP_CERT_UNKNOWN = -366, /* OCSP responder doesn't know */
wolfSSL 15:117db924cf7c 99 OCSP_LOOKUP_FAIL = -367, /* OCSP lookup not successful */
wolfSSL 15:117db924cf7c 100 MAX_CHAIN_ERROR = -368, /* max chain depth exceeded */
wolfSSL 15:117db924cf7c 101 COOKIE_ERROR = -369, /* dtls cookie error */
wolfSSL 15:117db924cf7c 102 SEQUENCE_ERROR = -370, /* dtls sequence error */
wolfSSL 15:117db924cf7c 103 SUITES_ERROR = -371, /* suites pointer error */
wolfSSL 15:117db924cf7c 104
wolfSSL 15:117db924cf7c 105 OUT_OF_ORDER_E = -373, /* out of order message */
wolfSSL 15:117db924cf7c 106 BAD_KEA_TYPE_E = -374, /* bad KEA type found */
wolfSSL 15:117db924cf7c 107 SANITY_CIPHER_E = -375, /* sanity check on cipher error */
wolfSSL 16:8e0d178b1d1e 108 RECV_OVERFLOW_E = -376, /* RXCB returned more than read */
wolfSSL 15:117db924cf7c 109 GEN_COOKIE_E = -377, /* Generate Cookie Error */
wolfSSL 15:117db924cf7c 110 NO_PEER_VERIFY = -378, /* Need peer cert verify Error */
wolfSSL 15:117db924cf7c 111 FWRITE_ERROR = -379, /* fwrite problem */
wolfSSL 16:8e0d178b1d1e 112 CACHE_MATCH_ERROR = -380, /* Cache hdr match error */
wolfSSL 15:117db924cf7c 113 UNKNOWN_SNI_HOST_NAME_E = -381, /* Unrecognized host name Error */
wolfSSL 15:117db924cf7c 114 UNKNOWN_MAX_FRAG_LEN_E = -382, /* Unrecognized max frag len Error */
wolfSSL 15:117db924cf7c 115 KEYUSE_SIGNATURE_E = -383, /* KeyUse digSignature error */
wolfSSL 15:117db924cf7c 116 KEYUSE_ENCIPHER_E = -385, /* KeyUse keyEncipher error */
wolfSSL 15:117db924cf7c 117 EXTKEYUSE_AUTH_E = -386, /* ExtKeyUse server|client_auth */
wolfSSL 15:117db924cf7c 118 SEND_OOB_READ_E = -387, /* Send Cb out of bounds read */
wolfSSL 15:117db924cf7c 119 SECURE_RENEGOTIATION_E = -388, /* Invalid Renegotiation Info */
wolfSSL 15:117db924cf7c 120 SESSION_TICKET_LEN_E = -389, /* Session Ticket too large */
wolfSSL 15:117db924cf7c 121 SESSION_TICKET_EXPECT_E = -390, /* Session Ticket missing */
wolfSSL 15:117db924cf7c 122 SCR_DIFFERENT_CERT_E = -391, /* SCR Different cert error */
wolfSSL 15:117db924cf7c 123 SESSION_SECRET_CB_E = -392, /* Session secret Cb fcn failure */
wolfSSL 15:117db924cf7c 124 NO_CHANGE_CIPHER_E = -393, /* Finished before change cipher */
wolfSSL 15:117db924cf7c 125 SANITY_MSG_E = -394, /* Sanity check on msg order error */
wolfSSL 15:117db924cf7c 126 DUPLICATE_MSG_E = -395, /* Duplicate message error */
wolfSSL 15:117db924cf7c 127 SNI_UNSUPPORTED = -396, /* SSL 3.0 does not support SNI */
wolfSSL 15:117db924cf7c 128 SOCKET_PEER_CLOSED_E = -397, /* Underlying transport closed */
wolfSSL 15:117db924cf7c 129 BAD_TICKET_KEY_CB_SZ = -398, /* Bad session ticket key cb size */
wolfSSL 15:117db924cf7c 130 BAD_TICKET_MSG_SZ = -399, /* Bad session ticket msg size */
wolfSSL 15:117db924cf7c 131 BAD_TICKET_ENCRYPT = -400, /* Bad user ticket encrypt */
wolfSSL 15:117db924cf7c 132 DH_KEY_SIZE_E = -401, /* DH Key too small */
wolfSSL 15:117db924cf7c 133 SNI_ABSENT_ERROR = -402, /* No SNI request. */
wolfSSL 15:117db924cf7c 134 RSA_SIGN_FAULT = -403, /* RSA Sign fault */
wolfSSL 15:117db924cf7c 135 HANDSHAKE_SIZE_ERROR = -404, /* Handshake message too large */
wolfSSL 15:117db924cf7c 136 UNKNOWN_ALPN_PROTOCOL_NAME_E = -405, /* Unrecognized protocol name Error*/
wolfSSL 15:117db924cf7c 137 BAD_CERTIFICATE_STATUS_ERROR = -406, /* Bad certificate status message */
wolfSSL 15:117db924cf7c 138 OCSP_INVALID_STATUS = -407, /* Invalid OCSP Status */
wolfSSL 15:117db924cf7c 139 OCSP_WANT_READ = -408, /* OCSP callback response WOLFSSL_CBIO_ERR_WANT_READ */
wolfSSL 15:117db924cf7c 140 RSA_KEY_SIZE_E = -409, /* RSA key too small */
wolfSSL 15:117db924cf7c 141 ECC_KEY_SIZE_E = -410, /* ECC key too small */
wolfSSL 15:117db924cf7c 142 DTLS_EXPORT_VER_E = -411, /* export version error */
wolfSSL 15:117db924cf7c 143 INPUT_SIZE_E = -412, /* input size too big error */
wolfSSL 15:117db924cf7c 144 CTX_INIT_MUTEX_E = -413, /* initialize ctx mutex error */
wolfSSL 15:117db924cf7c 145 EXT_MASTER_SECRET_NEEDED_E = -414, /* need EMS enabled to resume */
wolfSSL 15:117db924cf7c 146 DTLS_POOL_SZ_E = -415, /* exceeded DTLS pool size */
wolfSSL 15:117db924cf7c 147 DECODE_E = -416, /* decode handshake message error */
wolfSSL 15:117db924cf7c 148 HTTP_TIMEOUT = -417, /* HTTP timeout for OCSP or CRL req */
wolfSSL 15:117db924cf7c 149 WRITE_DUP_READ_E = -418, /* Write dup write side can't read */
wolfSSL 15:117db924cf7c 150 WRITE_DUP_WRITE_E = -419, /* Write dup read side can't write */
wolfSSL 15:117db924cf7c 151 INVALID_CERT_CTX_E = -420, /* TLS cert ctx not matching */
wolfSSL 15:117db924cf7c 152 BAD_KEY_SHARE_DATA = -421, /* Key Share data invalid */
wolfSSL 15:117db924cf7c 153 MISSING_HANDSHAKE_DATA = -422, /* Handshake message missing data */
wolfSSL 15:117db924cf7c 154 BAD_BINDER = -423, /* Binder does not match */
wolfSSL 15:117db924cf7c 155 EXT_NOT_ALLOWED = -424, /* Extension not allowed in msg */
wolfSSL 15:117db924cf7c 156 INVALID_PARAMETER = -425, /* Security parameter invalid */
wolfSSL 15:117db924cf7c 157 MCAST_HIGHWATER_CB_E = -426, /* Multicast highwater cb err */
wolfSSL 15:117db924cf7c 158 ALERT_COUNT_E = -427, /* Alert Count exceeded err */
wolfSSL 15:117db924cf7c 159 EXT_MISSING = -428, /* Required extension not found */
wolfSSL 15:117db924cf7c 160 UNSUPPORTED_EXTENSION = -429, /* TLSX not requested by client */
wolfSSL 16:8e0d178b1d1e 161 PRF_MISSING = -430, /* PRF not compiled in */
wolfSSL 16:8e0d178b1d1e 162 DTLS_RETX_OVER_TX = -431, /* Retransmit DTLS flight over */
wolfSSL 16:8e0d178b1d1e 163 DH_PARAMS_NOT_FFDHE_E = -432, /* DH params from server not FFDHE */
wolfSSL 16:8e0d178b1d1e 164 TCA_INVALID_ID_TYPE = -433, /* TLSX TCA ID type invalid */
wolfSSL 16:8e0d178b1d1e 165 TCA_ABSENT_ERROR = -434, /* TLSX TCA ID no response */
wolfSSL 16:8e0d178b1d1e 166 TSIP_MAC_DIGSZ_E = -435, /* Invalid MAC size for TSIP */
wolfSSL 16:8e0d178b1d1e 167 CLIENT_CERT_CB_ERROR = -436, /* Client cert callback error */
wolfSSL 16:8e0d178b1d1e 168 SSL_SHUTDOWN_ALREADY_DONE_E = -437, /* Shutdown called redundantly */
wolfSSL 16:8e0d178b1d1e 169 TLS13_SECRET_CB_E = -438, /* TLS1.3 secret Cb fcn failure */
wolfSSL 16:8e0d178b1d1e 170
wolfSSL 15:117db924cf7c 171 /* add strings to wolfSSL_ERR_reason_error_string in internal.c !!!!! */
wolfSSL 15:117db924cf7c 172
wolfSSL 15:117db924cf7c 173 /* begin negotiation parameter errors */
wolfSSL 15:117db924cf7c 174 UNSUPPORTED_SUITE = -500, /* unsupported cipher suite */
wolfSSL 15:117db924cf7c 175 MATCH_SUITE_ERROR = -501, /* can't match cipher suite */
wolfSSL 15:117db924cf7c 176 COMPRESSION_ERROR = -502, /* compression mismatch */
wolfSSL 15:117db924cf7c 177 KEY_SHARE_ERROR = -503, /* key share mismatch */
wolfSSL 15:117db924cf7c 178 POST_HAND_AUTH_ERROR = -504, /* client won't do post-hand auth */
wolfSSL 15:117db924cf7c 179 HRR_COOKIE_ERROR = -505 /* HRR msg cookie mismatch */
wolfSSL 15:117db924cf7c 180 /* end negotiation parameter errors only 10 for now */
wolfSSL 15:117db924cf7c 181 /* add strings to wolfSSL_ERR_reason_error_string in internal.c !!!!! */
wolfSSL 15:117db924cf7c 182
wolfSSL 15:117db924cf7c 183 /* no error stings go down here, add above negotiation errors !!!! */
wolfSSL 15:117db924cf7c 184 };
wolfSSL 15:117db924cf7c 185
wolfSSL 15:117db924cf7c 186
wolfSSL 15:117db924cf7c 187 #if defined(WOLFSSL_CALLBACKS) || defined(OPENSSL_EXTRA)
wolfSSL 15:117db924cf7c 188 enum {
wolfSSL 15:117db924cf7c 189 MIN_PARAM_ERR = UNSUPPORTED_SUITE,
wolfSSL 15:117db924cf7c 190 MAX_PARAM_ERR = MIN_PARAM_ERR - 10
wolfSSL 15:117db924cf7c 191 };
wolfSSL 15:117db924cf7c 192 #endif
wolfSSL 15:117db924cf7c 193
wolfSSL 15:117db924cf7c 194
wolfSSL 15:117db924cf7c 195 WOLFSSL_LOCAL
wolfSSL 15:117db924cf7c 196 void SetErrorString(int err, char* buff);
wolfSSL 15:117db924cf7c 197
wolfSSL 15:117db924cf7c 198
wolfSSL 15:117db924cf7c 199 #ifdef __cplusplus
wolfSSL 15:117db924cf7c 200 } /* extern "C" */
wolfSSL 15:117db924cf7c 201 #endif
wolfSSL 15:117db924cf7c 202
wolfSSL 15:117db924cf7c 203
wolfSSL 15:117db924cf7c 204 #endif /* wolfSSL_ERROR_H */
wolfSSL 15:117db924cf7c 205