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 26 00:39:20 2015 +0000
Revision:
0:d92f9d21154c
wolfSSL 3.6.0

Who changed what in which revision?

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