CyaSSL 3.0.0

Dependents:   HTTPClient-SSL HTTPClient HTTPClient-SSL http_access ... more

Committer:
wolfSSL
Date:
Wed Dec 03 05:24:18 2014 +0000
Revision:
3:64d4f7cb83d5
Parent:
0:1239e9b70ca2
added IGNORE_KEY_EXTENSIONS

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 0:1239e9b70ca2 1 /* error-ssl.h
wolfSSL 0:1239e9b70ca2 2 *
wolfSSL 0:1239e9b70ca2 3 * Copyright (C) 2006-2014 wolfSSL Inc.
wolfSSL 0:1239e9b70ca2 4 *
wolfSSL 0:1239e9b70ca2 5 * This file is part of CyaSSL.
wolfSSL 0:1239e9b70ca2 6 *
wolfSSL 0:1239e9b70ca2 7 * CyaSSL is free software; you can redistribute it and/or modify
wolfSSL 0:1239e9b70ca2 8 * it under the terms of the GNU General Public License as published by
wolfSSL 0:1239e9b70ca2 9 * the Free Software Foundation; either version 2 of the License, or
wolfSSL 0:1239e9b70ca2 10 * (at your option) any later version.
wolfSSL 0:1239e9b70ca2 11 *
wolfSSL 0:1239e9b70ca2 12 * CyaSSL is distributed in the hope that it will be useful,
wolfSSL 0:1239e9b70ca2 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
wolfSSL 0:1239e9b70ca2 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wolfSSL 0:1239e9b70ca2 15 * GNU General Public License for more details.
wolfSSL 0:1239e9b70ca2 16 *
wolfSSL 0:1239e9b70ca2 17 * You should have received a copy of the GNU General Public License
wolfSSL 0:1239e9b70ca2 18 * along with this program; if not, write to the Free Software
wolfSSL 0:1239e9b70ca2 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
wolfSSL 0:1239e9b70ca2 20 */
wolfSSL 0:1239e9b70ca2 21
wolfSSL 0:1239e9b70ca2 22
wolfSSL 0:1239e9b70ca2 23 #ifndef CYASSL_ERROR_H
wolfSSL 0:1239e9b70ca2 24 #define CYASSL_ERROR_H
wolfSSL 0:1239e9b70ca2 25
wolfSSL 0:1239e9b70ca2 26 #include <cyassl/ctaocrypt/error-crypt.h> /* pull in CTaoCrypt errors */
wolfSSL 0:1239e9b70ca2 27
wolfSSL 0:1239e9b70ca2 28 #ifdef __cplusplus
wolfSSL 0:1239e9b70ca2 29 extern "C" {
wolfSSL 0:1239e9b70ca2 30 #endif
wolfSSL 0:1239e9b70ca2 31
wolfSSL 0:1239e9b70ca2 32 enum CyaSSL_ErrorCodes {
wolfSSL 0:1239e9b70ca2 33 INPUT_CASE_ERROR = -201, /* process input state error */
wolfSSL 0:1239e9b70ca2 34 PREFIX_ERROR = -202, /* bad index to key rounds */
wolfSSL 0:1239e9b70ca2 35 MEMORY_ERROR = -203, /* out of memory */
wolfSSL 0:1239e9b70ca2 36 VERIFY_FINISHED_ERROR = -204, /* verify problem on finished */
wolfSSL 0:1239e9b70ca2 37 VERIFY_MAC_ERROR = -205, /* verify mac problem */
wolfSSL 0:1239e9b70ca2 38 PARSE_ERROR = -206, /* parse error on header */
wolfSSL 0:1239e9b70ca2 39 UNKNOWN_HANDSHAKE_TYPE = -207, /* weird handshake type */
wolfSSL 0:1239e9b70ca2 40 SOCKET_ERROR_E = -208, /* error state on socket */
wolfSSL 0:1239e9b70ca2 41 SOCKET_NODATA = -209, /* expected data, not there */
wolfSSL 0:1239e9b70ca2 42 INCOMPLETE_DATA = -210, /* don't have enough data to
wolfSSL 0:1239e9b70ca2 43 complete task */
wolfSSL 0:1239e9b70ca2 44 UNKNOWN_RECORD_TYPE = -211, /* unknown type in record hdr */
wolfSSL 0:1239e9b70ca2 45 DECRYPT_ERROR = -212, /* error during decryption */
wolfSSL 0:1239e9b70ca2 46 FATAL_ERROR = -213, /* recvd alert fatal error */
wolfSSL 0:1239e9b70ca2 47 ENCRYPT_ERROR = -214, /* error during encryption */
wolfSSL 0:1239e9b70ca2 48 FREAD_ERROR = -215, /* fread problem */
wolfSSL 0:1239e9b70ca2 49 NO_PEER_KEY = -216, /* need peer's key */
wolfSSL 0:1239e9b70ca2 50 NO_PRIVATE_KEY = -217, /* need the private key */
wolfSSL 0:1239e9b70ca2 51 RSA_PRIVATE_ERROR = -218, /* error during rsa priv op */
wolfSSL 0:1239e9b70ca2 52 NO_DH_PARAMS = -219, /* server missing DH params */
wolfSSL 0:1239e9b70ca2 53 BUILD_MSG_ERROR = -220, /* build message failure */
wolfSSL 0:1239e9b70ca2 54
wolfSSL 0:1239e9b70ca2 55 BAD_HELLO = -221, /* client hello malformed */
wolfSSL 0:1239e9b70ca2 56 DOMAIN_NAME_MISMATCH = -222, /* peer subject name mismatch */
wolfSSL 0:1239e9b70ca2 57 WANT_READ = -223, /* want read, call again */
wolfSSL 0:1239e9b70ca2 58 NOT_READY_ERROR = -224, /* handshake layer not ready */
wolfSSL 0:1239e9b70ca2 59 PMS_VERSION_ERROR = -225, /* pre m secret version error */
wolfSSL 0:1239e9b70ca2 60 VERSION_ERROR = -226, /* record layer version error */
wolfSSL 0:1239e9b70ca2 61 WANT_WRITE = -227, /* want write, call again */
wolfSSL 0:1239e9b70ca2 62 BUFFER_ERROR = -228, /* malformed buffer input */
wolfSSL 0:1239e9b70ca2 63 VERIFY_CERT_ERROR = -229, /* verify cert error */
wolfSSL 0:1239e9b70ca2 64 VERIFY_SIGN_ERROR = -230, /* verify sign error */
wolfSSL 0:1239e9b70ca2 65 CLIENT_ID_ERROR = -231, /* psk client identity error */
wolfSSL 0:1239e9b70ca2 66 SERVER_HINT_ERROR = -232, /* psk server hint error */
wolfSSL 0:1239e9b70ca2 67 PSK_KEY_ERROR = -233, /* psk key error */
wolfSSL 0:1239e9b70ca2 68 ZLIB_INIT_ERROR = -234, /* zlib init error */
wolfSSL 0:1239e9b70ca2 69 ZLIB_COMPRESS_ERROR = -235, /* zlib compression error */
wolfSSL 0:1239e9b70ca2 70 ZLIB_DECOMPRESS_ERROR = -236, /* zlib decompression error */
wolfSSL 0:1239e9b70ca2 71
wolfSSL 0:1239e9b70ca2 72 GETTIME_ERROR = -237, /* gettimeofday failed ??? */
wolfSSL 0:1239e9b70ca2 73 GETITIMER_ERROR = -238, /* getitimer failed ??? */
wolfSSL 0:1239e9b70ca2 74 SIGACT_ERROR = -239, /* sigaction failed ??? */
wolfSSL 0:1239e9b70ca2 75 SETITIMER_ERROR = -240, /* setitimer failed ??? */
wolfSSL 0:1239e9b70ca2 76 LENGTH_ERROR = -241, /* record layer length error */
wolfSSL 0:1239e9b70ca2 77 PEER_KEY_ERROR = -242, /* can't decode peer key */
wolfSSL 0:1239e9b70ca2 78 ZERO_RETURN = -243, /* peer sent close notify */
wolfSSL 0:1239e9b70ca2 79 SIDE_ERROR = -244, /* wrong client/server type */
wolfSSL 0:1239e9b70ca2 80 NO_PEER_CERT = -245, /* peer didn't send key */
wolfSSL 0:1239e9b70ca2 81 NTRU_KEY_ERROR = -246, /* NTRU key error */
wolfSSL 0:1239e9b70ca2 82 NTRU_DRBG_ERROR = -247, /* NTRU drbg error */
wolfSSL 0:1239e9b70ca2 83 NTRU_ENCRYPT_ERROR = -248, /* NTRU encrypt error */
wolfSSL 0:1239e9b70ca2 84 NTRU_DECRYPT_ERROR = -249, /* NTRU decrypt error */
wolfSSL 0:1239e9b70ca2 85 ECC_CURVETYPE_ERROR = -250, /* Bad ECC Curve Type */
wolfSSL 0:1239e9b70ca2 86 ECC_CURVE_ERROR = -251, /* Bad ECC Curve */
wolfSSL 0:1239e9b70ca2 87 ECC_PEERKEY_ERROR = -252, /* Bad Peer ECC Key */
wolfSSL 0:1239e9b70ca2 88 ECC_MAKEKEY_ERROR = -253, /* Bad Make ECC Key */
wolfSSL 0:1239e9b70ca2 89 ECC_EXPORT_ERROR = -254, /* Bad ECC Export Key */
wolfSSL 0:1239e9b70ca2 90 ECC_SHARED_ERROR = -255, /* Bad ECC Shared Secret */
wolfSSL 0:1239e9b70ca2 91 NOT_CA_ERROR = -257, /* Not a CA cert error */
wolfSSL 0:1239e9b70ca2 92 BAD_PATH_ERROR = -258, /* Bad path for opendir */
wolfSSL 0:1239e9b70ca2 93 BAD_CERT_MANAGER_ERROR = -259, /* Bad Cert Manager */
wolfSSL 0:1239e9b70ca2 94 OCSP_CERT_REVOKED = -260, /* OCSP Certificate revoked */
wolfSSL 0:1239e9b70ca2 95 CRL_CERT_REVOKED = -261, /* CRL Certificate revoked */
wolfSSL 0:1239e9b70ca2 96 CRL_MISSING = -262, /* CRL Not loaded */
wolfSSL 0:1239e9b70ca2 97 MONITOR_RUNNING_E = -263, /* CRL Monitor already running */
wolfSSL 0:1239e9b70ca2 98 THREAD_CREATE_E = -264, /* Thread Create Error */
wolfSSL 0:1239e9b70ca2 99 OCSP_NEED_URL = -265, /* OCSP need an URL for lookup */
wolfSSL 0:1239e9b70ca2 100 OCSP_CERT_UNKNOWN = -266, /* OCSP responder doesn't know */
wolfSSL 0:1239e9b70ca2 101 OCSP_LOOKUP_FAIL = -267, /* OCSP lookup not successful */
wolfSSL 0:1239e9b70ca2 102 MAX_CHAIN_ERROR = -268, /* max chain depth exceeded */
wolfSSL 0:1239e9b70ca2 103 COOKIE_ERROR = -269, /* dtls cookie error */
wolfSSL 0:1239e9b70ca2 104 SEQUENCE_ERROR = -270, /* dtls sequence error */
wolfSSL 0:1239e9b70ca2 105 SUITES_ERROR = -271, /* suites pointer error */
wolfSSL 0:1239e9b70ca2 106 SSL_NO_PEM_HEADER = -272, /* no PEM header found */
wolfSSL 0:1239e9b70ca2 107 OUT_OF_ORDER_E = -273, /* out of order message */
wolfSSL 0:1239e9b70ca2 108 BAD_KEA_TYPE_E = -274, /* bad KEA type found */
wolfSSL 0:1239e9b70ca2 109 SANITY_CIPHER_E = -275, /* sanity check on cipher error */
wolfSSL 0:1239e9b70ca2 110 RECV_OVERFLOW_E = -276, /* RXCB returned more than rqed */
wolfSSL 0:1239e9b70ca2 111 GEN_COOKIE_E = -277, /* Generate Cookie Error */
wolfSSL 0:1239e9b70ca2 112 NO_PEER_VERIFY = -278, /* Need peer cert verify Error */
wolfSSL 0:1239e9b70ca2 113 FWRITE_ERROR = -279, /* fwrite problem */
wolfSSL 0:1239e9b70ca2 114 CACHE_MATCH_ERROR = -280, /* chache hdr match error */
wolfSSL 0:1239e9b70ca2 115 UNKNOWN_SNI_HOST_NAME_E = -281, /* Unrecognized host name Error */
wolfSSL 0:1239e9b70ca2 116 UNKNOWN_MAX_FRAG_LEN_E = -282, /* Unrecognized max frag len Error */
wolfSSL 0:1239e9b70ca2 117 /* add strings to SetErrorString !!!!! */
wolfSSL 0:1239e9b70ca2 118 KEYUSE_SIGNATURE_E = -283, /* KeyUse digSignature error */
wolfSSL 0:1239e9b70ca2 119 KEYUSE_ENCIPHER_E = -285, /* KeyUse keyEncipher error */
wolfSSL 0:1239e9b70ca2 120 EXTKEYUSE_AUTH_E = -286, /* ExtKeyUse server|client_auth */
wolfSSL 0:1239e9b70ca2 121
wolfSSL 0:1239e9b70ca2 122 /* begin negotiation parameter errors */
wolfSSL 0:1239e9b70ca2 123 UNSUPPORTED_SUITE = -290, /* unsupported cipher suite */
wolfSSL 0:1239e9b70ca2 124 MATCH_SUITE_ERROR = -291 /* can't match cipher suite */
wolfSSL 0:1239e9b70ca2 125 /* end negotiation parameter errors only 10 for now */
wolfSSL 0:1239e9b70ca2 126 /* add strings to SetErrorString !!!!! */
wolfSSL 0:1239e9b70ca2 127 };
wolfSSL 0:1239e9b70ca2 128
wolfSSL 0:1239e9b70ca2 129
wolfSSL 0:1239e9b70ca2 130 #ifdef CYASSL_CALLBACKS
wolfSSL 0:1239e9b70ca2 131 enum {
wolfSSL 0:1239e9b70ca2 132 MIN_PARAM_ERR = UNSUPPORTED_SUITE,
wolfSSL 0:1239e9b70ca2 133 MAX_PARAM_ERR = MIN_PARAM_ERR - 10
wolfSSL 0:1239e9b70ca2 134 };
wolfSSL 0:1239e9b70ca2 135 #endif
wolfSSL 0:1239e9b70ca2 136
wolfSSL 0:1239e9b70ca2 137
wolfSSL 0:1239e9b70ca2 138 CYASSL_LOCAL
wolfSSL 0:1239e9b70ca2 139 void SetErrorString(int err, char* buff);
wolfSSL 0:1239e9b70ca2 140
wolfSSL 0:1239e9b70ca2 141
wolfSSL 0:1239e9b70ca2 142 #ifdef __cplusplus
wolfSSL 0:1239e9b70ca2 143 } /* extern "C" */
wolfSSL 0:1239e9b70ca2 144 #endif
wolfSSL 0:1239e9b70ca2 145
wolfSSL 0:1239e9b70ca2 146
wolfSSL 0:1239e9b70ca2 147 #endif /* CyaSSL_ERROR_H */
wolfSSL 0:1239e9b70ca2 148
wolfSSL 0:1239e9b70ca2 149
wolfSSL 0:1239e9b70ca2 150