CyaSSL is an SSL library for devices like mbed.

Dependents:   cyassl-client Sync

Committer:
toddouska
Date:
Sat Feb 05 01:09:17 2011 +0000
Revision:
0:5045d2638c29
Beta Version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
toddouska 0:5045d2638c29 1 /* cyassl_error.h
toddouska 0:5045d2638c29 2 *
toddouska 0:5045d2638c29 3 * Copyright (C) 2006-2009 Sawtooth Consulting Ltd.
toddouska 0:5045d2638c29 4 *
toddouska 0:5045d2638c29 5 * This file is part of CyaSSL.
toddouska 0:5045d2638c29 6 *
toddouska 0:5045d2638c29 7 * CyaSSL is free software; you can redistribute it and/or modify
toddouska 0:5045d2638c29 8 * it under the terms of the GNU General Public License as published by
toddouska 0:5045d2638c29 9 * the Free Software Foundation; either version 2 of the License, or
toddouska 0:5045d2638c29 10 * (at your option) any later version.
toddouska 0:5045d2638c29 11 *
toddouska 0:5045d2638c29 12 * CyaSSL is distributed in the hope that it will be useful,
toddouska 0:5045d2638c29 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
toddouska 0:5045d2638c29 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
toddouska 0:5045d2638c29 15 * GNU General Public License for more details.
toddouska 0:5045d2638c29 16 *
toddouska 0:5045d2638c29 17 * You should have received a copy of the GNU General Public License
toddouska 0:5045d2638c29 18 * along with this program; if not, write to the Free Software
toddouska 0:5045d2638c29 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
toddouska 0:5045d2638c29 20 */
toddouska 0:5045d2638c29 21
toddouska 0:5045d2638c29 22
toddouska 0:5045d2638c29 23
toddouska 0:5045d2638c29 24 #ifndef CYASSL_ERROR_H
toddouska 0:5045d2638c29 25 #define CYASSL_ERROR_H
toddouska 0:5045d2638c29 26
toddouska 0:5045d2638c29 27 #include "error.h" /* CTaoCrypt errors */
toddouska 0:5045d2638c29 28
toddouska 0:5045d2638c29 29 #ifdef __cplusplus
toddouska 0:5045d2638c29 30 extern "C" {
toddouska 0:5045d2638c29 31 #endif
toddouska 0:5045d2638c29 32
toddouska 0:5045d2638c29 33 enum CyaSSL_ErrorCodes {
toddouska 0:5045d2638c29 34 PREFIX_ERROR = -202, /* bad index to key rounds */
toddouska 0:5045d2638c29 35 MEMORY_ERROR = -203, /* out of memory */
toddouska 0:5045d2638c29 36 VERIFY_FINISHED_ERROR = -204, /* verify problem on finished */
toddouska 0:5045d2638c29 37 VERIFY_MAC_ERROR = -205, /* verify mac problem */
toddouska 0:5045d2638c29 38 PARSE_ERROR = -206, /* parse error on header */
toddouska 0:5045d2638c29 39 UNKNOWN_HANDSHAKE_TYPE = -207, /* weird handshake type */
toddouska 0:5045d2638c29 40 SOCKET_ERROR_E = -208, /* error state on socket */
toddouska 0:5045d2638c29 41 SOCKET_NODATA = -209, /* expected data, not there */
toddouska 0:5045d2638c29 42 INCOMPLETE_DATA = -210, /* don't have enough data to
toddouska 0:5045d2638c29 43 complete task */
toddouska 0:5045d2638c29 44 UNKNOWN_RECORD_TYPE = -211, /* unknown type in record hdr */
toddouska 0:5045d2638c29 45 DECRYPT_ERROR = -212, /* error during decryption */
toddouska 0:5045d2638c29 46 FATAL_ERROR = -213, /* revcd alert fatal error */
toddouska 0:5045d2638c29 47 ENCRYPT_ERROR = -214, /* error during encryption */
toddouska 0:5045d2638c29 48 FREAD_ERROR = -215, /* fread problem */
toddouska 0:5045d2638c29 49 NO_PEER_KEY = -216, /* need peer's key */
toddouska 0:5045d2638c29 50 NO_PRIVATE_KEY = -217, /* need the private key */
toddouska 0:5045d2638c29 51 RSA_PRIVATE_ERROR = -218, /* error during rsa priv op */
toddouska 0:5045d2638c29 52 BUILD_MSG_ERROR = -220, /* build message failure */
toddouska 0:5045d2638c29 53
toddouska 0:5045d2638c29 54 BAD_HELLO = -221, /* client hello malformed */
toddouska 0:5045d2638c29 55 DOMAIN_NAME_MISMATCH = -222, /* peer subject name mismatch */
toddouska 0:5045d2638c29 56 WANT_READ = -223, /* want read, call again */
toddouska 0:5045d2638c29 57 NOT_READY_ERROR = -224, /* handshake layer not ready */
toddouska 0:5045d2638c29 58 PMS_VERSION_ERROR = -225, /* pre m secret version error */
toddouska 0:5045d2638c29 59 VERSION_ERROR = -226, /* record layer version error */
toddouska 0:5045d2638c29 60 WANT_WRITE = -227, /* want write, call again */
toddouska 0:5045d2638c29 61 BUFFER_ERROR = -228, /* malformed buffer input */
toddouska 0:5045d2638c29 62 VERIFY_CERT_ERROR = -229, /* verify cert error */
toddouska 0:5045d2638c29 63 VERIFY_SIGN_ERROR = -230, /* verify sign error */
toddouska 0:5045d2638c29 64 CLIENT_ID_ERROR = -231, /* psk client identity error */
toddouska 0:5045d2638c29 65 SERVER_HINT_ERROR = -232, /* psk server hint error */
toddouska 0:5045d2638c29 66 PSK_KEY_ERROR = -233, /* psk key error */
toddouska 0:5045d2638c29 67 ZLIB_INIT_ERROR = -234, /* zlib init error */
toddouska 0:5045d2638c29 68 ZLIB_COMPRESS_ERROR = -235, /* zlib compression error */
toddouska 0:5045d2638c29 69 ZLIB_DECOMPRESS_ERROR = -236, /* zlib decompression error */
toddouska 0:5045d2638c29 70
toddouska 0:5045d2638c29 71 GETTIME_ERROR = -237, /* gettimeofday failed ??? */
toddouska 0:5045d2638c29 72 GETITIMER_ERROR = -238, /* getitimer failed ??? */
toddouska 0:5045d2638c29 73 SIGACT_ERROR = -239, /* sigaction failed ??? */
toddouska 0:5045d2638c29 74 SETITIMER_ERROR = -240, /* setitimer failed ??? */
toddouska 0:5045d2638c29 75 LENGTH_ERROR = -241, /* record layer length error */
toddouska 0:5045d2638c29 76 PEER_KEY_ERROR = -242, /* cant decode peer key */
toddouska 0:5045d2638c29 77 ZERO_RETURN = -243, /* peer sent close notify */
toddouska 0:5045d2638c29 78 SIDE_ERROR = -244, /* wrong client/server type */
toddouska 0:5045d2638c29 79 NO_PEER_CERT = -245, /* peer didn't send key */
toddouska 0:5045d2638c29 80 NTRU_KEY_ERROR = -246, /* NTRU key error */
toddouska 0:5045d2638c29 81 NTRU_DRBG_ERROR = -247, /* NTRU drbg error */
toddouska 0:5045d2638c29 82 NTRU_ENCRYPT_ERROR = -248, /* NTRU encrypt error */
toddouska 0:5045d2638c29 83 NTRU_DECRYPT_ERROR = -249, /* NTRU decrypt error */
toddouska 0:5045d2638c29 84 /* add strings to SetErrorString !!!!! */
toddouska 0:5045d2638c29 85
toddouska 0:5045d2638c29 86 /* begin negotiation parameter errors */
toddouska 0:5045d2638c29 87 UNSUPPORTED_SUITE = -260, /* unsupported cipher suite */
toddouska 0:5045d2638c29 88 MATCH_SUITE_ERROR = -261 /* can't match cipher suite */
toddouska 0:5045d2638c29 89 /* end negotiation parameter errors only 10 for now */
toddouska 0:5045d2638c29 90 /* add strings to SetErrorString !!!!! */
toddouska 0:5045d2638c29 91 };
toddouska 0:5045d2638c29 92
toddouska 0:5045d2638c29 93
toddouska 0:5045d2638c29 94 #ifdef CYASSL_CALLBACKS
toddouska 0:5045d2638c29 95 enum {
toddouska 0:5045d2638c29 96 MIN_PARAM_ERR = UNSUPPORTED_SUITE,
toddouska 0:5045d2638c29 97 MAX_PARAM_ERR = MIN_PARAM_ERR - 10
toddouska 0:5045d2638c29 98 };
toddouska 0:5045d2638c29 99 #endif
toddouska 0:5045d2638c29 100
toddouska 0:5045d2638c29 101
toddouska 0:5045d2638c29 102 void SetErrorString(int error, char* buffer);
toddouska 0:5045d2638c29 103
toddouska 0:5045d2638c29 104
toddouska 0:5045d2638c29 105 #ifdef __cplusplus
toddouska 0:5045d2638c29 106 } /* extern "C" */
toddouska 0:5045d2638c29 107 #endif
toddouska 0:5045d2638c29 108
toddouska 0:5045d2638c29 109
toddouska 0:5045d2638c29 110 #endif /* CyaSSL_ERROR_H */
toddouska 0:5045d2638c29 111