cyassl re-port with cellular comms, PSK test

Dependencies:   VodafoneUSBModem_bleedingedge2 mbed-rtos mbed-src

Committer:
ashleymills
Date:
Fri Apr 26 16:59:36 2013 +0000
Revision:
1:b211d97b0068
Parent:
0:e979170e02e7
nothing

Who changed what in which revision?

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