SSL/TLS Library

Dependents:  

CyaSSL is SSL/TLS library for embedded systems.

wolfssl.com

Committer:
wolfSSL
Date:
Sun Apr 20 12:40:57 2014 +0000
Revision:
0:9d17e4342598
CyaSSL SSL/TLS Library 2.9.4;

Who changed what in which revision?

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