Back to index

lightning-sunbird  0.9+nobinonly
sslerr.h
Go to the documentation of this file.
00001 /*
00002  * Enumeration of all SSL-specific error codes.
00003  *
00004  * ***** BEGIN LICENSE BLOCK *****
00005  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00006  *
00007  * The contents of this file are subject to the Mozilla Public License Version
00008  * 1.1 (the "License"); you may not use this file except in compliance with
00009  * the License. You may obtain a copy of the License at
00010  * http://www.mozilla.org/MPL/
00011  *
00012  * Software distributed under the License is distributed on an "AS IS" basis,
00013  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00014  * for the specific language governing rights and limitations under the
00015  * License.
00016  *
00017  * The Original Code is the Netscape security libraries.
00018  *
00019  * The Initial Developer of the Original Code is
00020  * Netscape Communications Corporation.
00021  * Portions created by the Initial Developer are Copyright (C) 1994-2000
00022  * the Initial Developer. All Rights Reserved.
00023  *
00024  * Contributor(s):
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 /* $Id: sslerr.h,v 1.4.28.1 2006/04/13 07:41:16 nelson%bolyard.com Exp $ */
00040 #ifndef __SSL_ERR_H_
00041 #define __SSL_ERR_H_
00042 
00043 
00044 #define SSL_ERROR_BASE                           (-0x3000)
00045 #define SSL_ERROR_LIMIT                          (SSL_ERROR_BASE + 1000)
00046 
00047 #define IS_SSL_ERROR(code) \
00048     (((code) >= SSL_ERROR_BASE) && ((code) < SSL_ERROR_LIMIT))
00049 
00050 #ifndef NO_SECURITY_ERROR_ENUM
00051 typedef enum {
00052 SSL_ERROR_EXPORT_ONLY_SERVER              = (SSL_ERROR_BASE +  0),
00053 SSL_ERROR_US_ONLY_SERVER           = (SSL_ERROR_BASE +  1),
00054 SSL_ERROR_NO_CYPHER_OVERLAP               = (SSL_ERROR_BASE +  2),
00055 /* 
00056  * Received an alert reporting what we did wrong.  (more alerts below)
00057  */
00058 SSL_ERROR_NO_CERTIFICATE /*_ALERT */      = (SSL_ERROR_BASE +  3),
00059 SSL_ERROR_BAD_CERTIFICATE                 = (SSL_ERROR_BASE +  4),
00060                                    /* error 5 is obsolete */
00061 SSL_ERROR_BAD_CLIENT                      = (SSL_ERROR_BASE +  6),
00062 SSL_ERROR_BAD_SERVER                      = (SSL_ERROR_BASE +  7),
00063 SSL_ERROR_UNSUPPORTED_CERTIFICATE_TYPE    = (SSL_ERROR_BASE +  8),
00064 SSL_ERROR_UNSUPPORTED_VERSION             = (SSL_ERROR_BASE +  9),
00065                                    /* error 10 is obsolete */
00066 SSL_ERROR_WRONG_CERTIFICATE        = (SSL_ERROR_BASE + 11),
00067 SSL_ERROR_BAD_CERT_DOMAIN          = (SSL_ERROR_BASE + 12),
00068 SSL_ERROR_POST_WARNING                    = (SSL_ERROR_BASE + 13),
00069 SSL_ERROR_SSL2_DISABLED            = (SSL_ERROR_BASE + 14),
00070 SSL_ERROR_BAD_MAC_READ                    = (SSL_ERROR_BASE + 15),
00071 /* 
00072  * Received an alert reporting what we did wrong.
00073  * (two more alerts above, and many more below)
00074  */
00075 SSL_ERROR_BAD_MAC_ALERT            = (SSL_ERROR_BASE + 16),
00076 SSL_ERROR_BAD_CERT_ALERT                = (SSL_ERROR_BASE + 17),
00077 SSL_ERROR_REVOKED_CERT_ALERT              = (SSL_ERROR_BASE + 18),
00078 SSL_ERROR_EXPIRED_CERT_ALERT              = (SSL_ERROR_BASE + 19),
00079 
00080 SSL_ERROR_SSL_DISABLED                    = (SSL_ERROR_BASE + 20),
00081 SSL_ERROR_FORTEZZA_PQG                    = (SSL_ERROR_BASE + 21),
00082 SSL_ERROR_UNKNOWN_CIPHER_SUITE            = (SSL_ERROR_BASE + 22),
00083 SSL_ERROR_NO_CIPHERS_SUPPORTED            = (SSL_ERROR_BASE + 23),
00084 SSL_ERROR_BAD_BLOCK_PADDING        = (SSL_ERROR_BASE + 24),
00085 SSL_ERROR_RX_RECORD_TOO_LONG              = (SSL_ERROR_BASE + 25),
00086 SSL_ERROR_TX_RECORD_TOO_LONG              = (SSL_ERROR_BASE + 26),
00087 /* 
00088  * Received a malformed (too long or short) SSL handshake.
00089  */
00090 SSL_ERROR_RX_MALFORMED_HELLO_REQUEST      = (SSL_ERROR_BASE + 27),
00091 SSL_ERROR_RX_MALFORMED_CLIENT_HELLO       = (SSL_ERROR_BASE + 28),
00092 SSL_ERROR_RX_MALFORMED_SERVER_HELLO       = (SSL_ERROR_BASE + 29),
00093 SSL_ERROR_RX_MALFORMED_CERTIFICATE = (SSL_ERROR_BASE + 30),
00094 SSL_ERROR_RX_MALFORMED_SERVER_KEY_EXCH    = (SSL_ERROR_BASE + 31),
00095 SSL_ERROR_RX_MALFORMED_CERT_REQUEST       = (SSL_ERROR_BASE + 32),
00096 SSL_ERROR_RX_MALFORMED_HELLO_DONE  = (SSL_ERROR_BASE + 33),
00097 SSL_ERROR_RX_MALFORMED_CERT_VERIFY = (SSL_ERROR_BASE + 34),
00098 SSL_ERROR_RX_MALFORMED_CLIENT_KEY_EXCH    = (SSL_ERROR_BASE + 35),
00099 SSL_ERROR_RX_MALFORMED_FINISHED    = (SSL_ERROR_BASE + 36),
00100 /* 
00101  * Received a malformed (too long or short) SSL record.
00102  */
00103 SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER      = (SSL_ERROR_BASE + 37),
00104 SSL_ERROR_RX_MALFORMED_ALERT              = (SSL_ERROR_BASE + 38),
00105 SSL_ERROR_RX_MALFORMED_HANDSHAKE   = (SSL_ERROR_BASE + 39),
00106 SSL_ERROR_RX_MALFORMED_APPLICATION_DATA   = (SSL_ERROR_BASE + 40),
00107 /*
00108  * Received an SSL handshake that was inappropriate for the state we're in.
00109  * E.g. Server received message from server, or wrong state in state machine.
00110  */
00111 SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST     = (SSL_ERROR_BASE + 41),
00112 SSL_ERROR_RX_UNEXPECTED_CLIENT_HELLO      = (SSL_ERROR_BASE + 42),
00113 SSL_ERROR_RX_UNEXPECTED_SERVER_HELLO      = (SSL_ERROR_BASE + 43),
00114 SSL_ERROR_RX_UNEXPECTED_CERTIFICATE       = (SSL_ERROR_BASE + 44),
00115 SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH   = (SSL_ERROR_BASE + 45),
00116 SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST      = (SSL_ERROR_BASE + 46),
00117 SSL_ERROR_RX_UNEXPECTED_HELLO_DONE = (SSL_ERROR_BASE + 47),
00118 SSL_ERROR_RX_UNEXPECTED_CERT_VERIFY       = (SSL_ERROR_BASE + 48),
00119 SSL_ERROR_RX_UNEXPECTED_CLIENT_KEY_EXCH   = (SSL_ERROR_BASE + 49),
00120 SSL_ERROR_RX_UNEXPECTED_FINISHED   = (SSL_ERROR_BASE + 50),
00121 /*
00122  * Received an SSL record that was inappropriate for the state we're in.
00123  */
00124 SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER     = (SSL_ERROR_BASE + 51),
00125 SSL_ERROR_RX_UNEXPECTED_ALERT             = (SSL_ERROR_BASE + 52),
00126 SSL_ERROR_RX_UNEXPECTED_HANDSHAKE  = (SSL_ERROR_BASE + 53),
00127 SSL_ERROR_RX_UNEXPECTED_APPLICATION_DATA= (SSL_ERROR_BASE + 54),
00128 /*
00129  * Received record/message with unknown discriminant.
00130  */
00131 SSL_ERROR_RX_UNKNOWN_RECORD_TYPE   = (SSL_ERROR_BASE + 55),
00132 SSL_ERROR_RX_UNKNOWN_HANDSHAKE            = (SSL_ERROR_BASE + 56),
00133 SSL_ERROR_RX_UNKNOWN_ALERT         = (SSL_ERROR_BASE + 57),
00134 /* 
00135  * Received an alert reporting what we did wrong.  (more alerts above)
00136  */
00137 SSL_ERROR_CLOSE_NOTIFY_ALERT              = (SSL_ERROR_BASE + 58),
00138 SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT      = (SSL_ERROR_BASE + 59),
00139 SSL_ERROR_DECOMPRESSION_FAILURE_ALERT     = (SSL_ERROR_BASE + 60),
00140 SSL_ERROR_HANDSHAKE_FAILURE_ALERT  = (SSL_ERROR_BASE + 61),
00141 SSL_ERROR_ILLEGAL_PARAMETER_ALERT  = (SSL_ERROR_BASE + 62),
00142 SSL_ERROR_UNSUPPORTED_CERT_ALERT   = (SSL_ERROR_BASE + 63),
00143 SSL_ERROR_CERTIFICATE_UNKNOWN_ALERT       = (SSL_ERROR_BASE + 64),
00144 
00145 SSL_ERROR_GENERATE_RANDOM_FAILURE  = (SSL_ERROR_BASE + 65),
00146 SSL_ERROR_SIGN_HASHES_FAILURE             = (SSL_ERROR_BASE + 66),
00147 SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE      = (SSL_ERROR_BASE + 67),
00148 SSL_ERROR_SERVER_KEY_EXCHANGE_FAILURE     = (SSL_ERROR_BASE + 68),
00149 SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE     = (SSL_ERROR_BASE + 69),
00150 
00151 SSL_ERROR_ENCRYPTION_FAILURE              = (SSL_ERROR_BASE + 70),
00152 SSL_ERROR_DECRYPTION_FAILURE              = (SSL_ERROR_BASE + 71),
00153 SSL_ERROR_SOCKET_WRITE_FAILURE            = (SSL_ERROR_BASE + 72),
00154 
00155 SSL_ERROR_MD5_DIGEST_FAILURE              = (SSL_ERROR_BASE + 73),
00156 SSL_ERROR_SHA_DIGEST_FAILURE              = (SSL_ERROR_BASE + 74),
00157 SSL_ERROR_MAC_COMPUTATION_FAILURE  = (SSL_ERROR_BASE + 75),
00158 SSL_ERROR_SYM_KEY_CONTEXT_FAILURE  = (SSL_ERROR_BASE + 76),
00159 SSL_ERROR_SYM_KEY_UNWRAP_FAILURE   = (SSL_ERROR_BASE + 77),
00160 SSL_ERROR_PUB_KEY_SIZE_LIMIT_EXCEEDED     = (SSL_ERROR_BASE + 78),
00161 SSL_ERROR_IV_PARAM_FAILURE         = (SSL_ERROR_BASE + 79),
00162 SSL_ERROR_INIT_CIPHER_SUITE_FAILURE       = (SSL_ERROR_BASE + 80),
00163 SSL_ERROR_SESSION_KEY_GEN_FAILURE  = (SSL_ERROR_BASE + 81),
00164 SSL_ERROR_NO_SERVER_KEY_FOR_ALG           = (SSL_ERROR_BASE + 82),
00165 SSL_ERROR_TOKEN_INSERTION_REMOVAL  = (SSL_ERROR_BASE + 83),
00166 SSL_ERROR_TOKEN_SLOT_NOT_FOUND            = (SSL_ERROR_BASE + 84),
00167 SSL_ERROR_NO_COMPRESSION_OVERLAP   = (SSL_ERROR_BASE + 85),
00168 SSL_ERROR_HANDSHAKE_NOT_COMPLETED  = (SSL_ERROR_BASE + 86),
00169 SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE = (SSL_ERROR_BASE + 87),
00170 SSL_ERROR_CERT_KEA_MISMATCH        = (SSL_ERROR_BASE + 88),
00171 SSL_ERROR_NO_TRUSTED_SSL_CLIENT_CA = (SSL_ERROR_BASE + 89),
00172 SSL_ERROR_SESSION_NOT_FOUND        = (SSL_ERROR_BASE + 90),
00173 
00174 SSL_ERROR_DECRYPTION_FAILED_ALERT  = (SSL_ERROR_BASE + 91),
00175 SSL_ERROR_RECORD_OVERFLOW_ALERT           = (SSL_ERROR_BASE + 92),
00176 SSL_ERROR_UNKNOWN_CA_ALERT         = (SSL_ERROR_BASE + 93),
00177 SSL_ERROR_ACCESS_DENIED_ALERT             = (SSL_ERROR_BASE + 94),
00178 SSL_ERROR_DECODE_ERROR_ALERT              = (SSL_ERROR_BASE + 95),
00179 SSL_ERROR_DECRYPT_ERROR_ALERT             = (SSL_ERROR_BASE + 96),
00180 SSL_ERROR_EXPORT_RESTRICTION_ALERT = (SSL_ERROR_BASE + 97),
00181 SSL_ERROR_PROTOCOL_VERSION_ALERT   = (SSL_ERROR_BASE + 98),
00182 SSL_ERROR_INSUFFICIENT_SECURITY_ALERT     = (SSL_ERROR_BASE + 99),
00183 SSL_ERROR_INTERNAL_ERROR_ALERT            = (SSL_ERROR_BASE + 100),
00184 SSL_ERROR_USER_CANCELED_ALERT             = (SSL_ERROR_BASE + 101),
00185 SSL_ERROR_NO_RENEGOTIATION_ALERT   = (SSL_ERROR_BASE + 102),
00186 
00187 SSL_ERROR_SERVER_CACHE_NOT_CONFIGURED     = (SSL_ERROR_BASE + 103),
00188 
00189 SSL_ERROR_UNSUPPORTED_EXTENSION_ALERT            = (SSL_ERROR_BASE + 104),
00190 SSL_ERROR_CERTIFICATE_UNOBTAINABLE_ALERT  = (SSL_ERROR_BASE + 105),
00191 SSL_ERROR_UNRECOGNIZED_NAME_ALERT         = (SSL_ERROR_BASE + 106),
00192 SSL_ERROR_BAD_CERT_STATUS_RESPONSE_ALERT  = (SSL_ERROR_BASE + 107),
00193 SSL_ERROR_BAD_CERT_HASH_VALUE_ALERT              = (SSL_ERROR_BASE + 108),
00194 
00195 SSL_ERROR_END_OF_LIST       /* let the c compiler determine the value of this. */
00196 } SSLErrorCodes;
00197 #endif /* NO_SECURITY_ERROR_ENUM */
00198 
00199 #endif /* __SSL_ERR_H_ */