cyassl re-port with cellular comms, PSK test

Dependencies:   VodafoneUSBModem_bleedingedge2 mbed-rtos mbed-src

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers error.h Source File

error.h

00001 /* error.h
00002  *
00003  * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
00004  *
00005  * This file is part of CyaSSL.
00006  *
00007  * CyaSSL is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * CyaSSL is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
00020  */
00021 
00022 
00023 #ifndef CYASSL_ERROR_H
00024 #define CYASSL_ERROR_H
00025 
00026 #include <cyassl/ctaocrypt/error.h>   /* pull in CTaoCrypt errors */
00027 
00028 #ifdef __cplusplus
00029     extern "C" {
00030 #endif
00031 
00032 enum CyaSSL_ErrorCodes {
00033     INPUT_CASE_ERROR       = -201,            /* process input state error */
00034     PREFIX_ERROR           = -202,            /* bad index to key rounds  */
00035     MEMORY_ERROR           = -203,            /* out of memory            */
00036     VERIFY_FINISHED_ERROR  = -204,            /* verify problem on finished */
00037     VERIFY_MAC_ERROR       = -205,            /* verify mac problem       */
00038     PARSE_ERROR            = -206,            /* parse error on header    */
00039     UNKNOWN_HANDSHAKE_TYPE = -207,            /* weird handshake type     */
00040     SOCKET_ERROR_E         = -208,            /* error state on socket    */
00041     SOCKET_NODATA          = -209,            /* expected data, not there */
00042     INCOMPLETE_DATA        = -210,            /* don't have enough data to 
00043                                                  complete task            */
00044     UNKNOWN_RECORD_TYPE    = -211,            /* unknown type in record hdr */
00045     DECRYPT_ERROR          = -212,            /* error during decryption  */
00046     FATAL_ERROR            = -213,            /* recvd alert fatal error  */
00047     ENCRYPT_ERROR          = -214,            /* error during encryption  */
00048     FREAD_ERROR            = -215,            /* fread problem            */
00049     NO_PEER_KEY            = -216,            /* need peer's key          */
00050     NO_PRIVATE_KEY         = -217,            /* need the private key     */
00051     RSA_PRIVATE_ERROR      = -218,            /* error during rsa priv op */
00052     NO_DH_PARAMS           = -219,            /* server missing DH params */
00053     BUILD_MSG_ERROR        = -220,            /* build message failure    */
00054 
00055     BAD_HELLO              = -221,            /* client hello malformed   */
00056     DOMAIN_NAME_MISMATCH   = -222,            /* peer subject name mismatch */
00057     WANT_READ              = -223,            /* want read, call again    */
00058     NOT_READY_ERROR        = -224,            /* handshake layer not ready */
00059     PMS_VERSION_ERROR      = -225,            /* pre m secret version error */
00060     VERSION_ERROR          = -226,            /* record layer version error */
00061     WANT_WRITE             = -227,            /* want write, call again   */
00062     BUFFER_ERROR           = -228,            /* malformed buffer input   */
00063     VERIFY_CERT_ERROR      = -229,            /* verify cert error        */
00064     VERIFY_SIGN_ERROR      = -230,            /* verify sign error        */
00065     CLIENT_ID_ERROR        = -231,            /* psk client identity error  */
00066     SERVER_HINT_ERROR      = -232,            /* psk server hint error  */
00067     PSK_KEY_ERROR          = -233,            /* psk key error  */
00068     ZLIB_INIT_ERROR        = -234,            /* zlib init error  */
00069     ZLIB_COMPRESS_ERROR    = -235,            /* zlib compression error  */
00070     ZLIB_DECOMPRESS_ERROR  = -236,            /* zlib decompression error  */
00071 
00072     GETTIME_ERROR          = -237,            /* gettimeofday failed ??? */
00073     GETITIMER_ERROR        = -238,            /* getitimer failed ??? */
00074     SIGACT_ERROR           = -239,            /* sigaction failed ??? */
00075     SETITIMER_ERROR        = -240,            /* setitimer failed ??? */
00076     LENGTH_ERROR           = -241,            /* record layer length error */
00077     PEER_KEY_ERROR         = -242,            /* can't decode peer key */
00078     ZERO_RETURN            = -243,            /* peer sent close notify */
00079     SIDE_ERROR             = -244,            /* wrong client/server type */
00080     NO_PEER_CERT           = -245,            /* peer didn't send key */
00081     NTRU_KEY_ERROR         = -246,            /* NTRU key error  */
00082     NTRU_DRBG_ERROR        = -247,            /* NTRU drbg error  */
00083     NTRU_ENCRYPT_ERROR     = -248,            /* NTRU encrypt error  */
00084     NTRU_DECRYPT_ERROR     = -249,            /* NTRU decrypt error  */
00085     ECC_CURVETYPE_ERROR    = -250,            /* Bad ECC Curve Type */
00086     ECC_CURVE_ERROR        = -251,            /* Bad ECC Curve */
00087     ECC_PEERKEY_ERROR      = -252,            /* Bad Peer ECC Key */
00088     ECC_MAKEKEY_ERROR      = -253,            /* Bad Make ECC Key */
00089     ECC_EXPORT_ERROR       = -254,            /* Bad ECC Export Key */
00090     ECC_SHARED_ERROR       = -255,            /* Bad ECC Shared Secret */
00091     BAD_MUTEX_ERROR        = -256,            /* Bad mutex */
00092     NOT_CA_ERROR           = -257,            /* Not a CA cert error */
00093     BAD_PATH_ERROR         = -258,            /* Bad path for opendir */
00094     BAD_CERT_MANAGER_ERROR = -259,            /* Bad Cert Manager */
00095     OCSP_CERT_REVOKED      = -260,            /* OCSP Certificate revoked */
00096     CRL_CERT_REVOKED       = -261,            /* CRL Certificate revoked */
00097     CRL_MISSING            = -262,            /* CRL Not loaded */
00098     MONITOR_RUNNING_E      = -263,            /* CRL Monitor already running */
00099     THREAD_CREATE_E        = -264,            /* Thread Create Error */
00100     OCSP_NEED_URL          = -265,            /* OCSP need an URL for lookup */
00101     OCSP_CERT_UNKNOWN      = -266,            /* OCSP responder doesn't know */
00102     OCSP_LOOKUP_FAIL       = -267,            /* OCSP lookup not successful */
00103     MAX_CHAIN_ERROR        = -268,            /* max chain depth exceeded */
00104     COOKIE_ERROR           = -269,            /* dtls cookie error */
00105     SEQUENCE_ERROR         = -270,            /* dtls sequence error */
00106     SUITES_ERROR           = -271,            /* suites pointer error */
00107     SSL_NO_PEM_HEADER      = -272,            /* no PEM header found */
00108     OUT_OF_ORDER_E         = -273,            /* out of order message */
00109     BAD_KEA_TYPE_E         = -274,            /* bad KEA type found */
00110     SANITY_CIPHER_E        = -275,            /* sanity check on cipher error */
00111     RECV_OVERFLOW_E        = -276,            /* RXCB returned more than rqed */
00112     /* add strings to SetErrorString !!!!! */
00113 
00114     /* begin negotiation parameter errors */
00115     UNSUPPORTED_SUITE      = -290,            /* unsupported cipher suite */
00116     MATCH_SUITE_ERROR      = -291             /* can't match cipher suite */
00117     /* end negotiation parameter errors only 10 for now */
00118     /* add strings to SetErrorString !!!!! */
00119 };
00120 
00121 
00122 #ifdef CYASSL_CALLBACKS
00123     enum {
00124         MIN_PARAM_ERR = UNSUPPORTED_SUITE,
00125         MAX_PARAM_ERR = MIN_PARAM_ERR - 10
00126     };
00127 #endif
00128 
00129 
00130 CYASSL_LOCAL
00131 void SetErrorString(int error, char* buffer);
00132 
00133 
00134 #ifdef __cplusplus
00135     }  /* extern "C" */
00136 #endif
00137 
00138 
00139 #endif /* CyaSSL_ERROR_H */
00140