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