Xuyi Wang / wolfSSL

Dependents:   OS

Committer:
wolfSSL
Date:
Tue May 30 01:44:10 2017 +0000
Revision:
11:cee25a834751
wolfSSL 3.11.0

Who changed what in which revision?

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