This is a port of cyaSSL 2.7.0.

Dependents:   CyaSSL_DTLS_Cellular CyaSSL_DTLS_Ethernet

Committer:
ashleymills
Date:
Thu Sep 05 15:55:50 2013 +0000
Revision:
1:c0ce1562443a
Parent:
0:714293de3836
Nothing;

Who changed what in which revision?

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