xref: /illumos-gate/usr/src/lib/libldap5/sources/ldap/ssldap/sslerrstrs.h (revision 915894ef19890baaed00080f85f6b69e225cda98)
1 /*
2  * Copyright (c) 2001 by Sun Microsystems, Inc.
3  * All rights reserved.
4  */
5 
6 #pragma ident	"%Z%%M%	%I%	%E% SMI"
7 
8 /*
9  * The contents of this file are subject to the Netscape Public
10  * License Version 1.1 (the "License"); you may not use this file
11  * except in compliance with the License. You may obtain a copy of
12  * the License at http://www.mozilla.org/NPL/
13  *
14  * Software distributed under the License is distributed on an "AS
15  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
16  * implied. See the License for the specific language governing
17  * rights and limitations under the License.
18  *
19  * The Original Code is Mozilla Communicator client code, released
20  * March 31, 1998.
21  *
22  * The Initial Developer of the Original Code is Netscape
23  * Communications Corporation. Portions created by Netscape are
24  * Copyright (C) 1998-1999 Netscape Communications Corporation. All
25  * Rights Reserved.
26  *
27  * Contributor(s):
28  */
29 /*
30  * sslerrstrs.h - map SSL errors to strings (used by errormap.c)
31  *
32  */
33 
34 /*
35  ****************************************************************************
36  * The code below this point was provided by Nelson Bolyard <nelsonb> of the
37  *	Netscape Certificate Server team on 27-March-1998.
38  *	Taken from the file ns/security/cmd/lib/SSLerrs.h on NSS_1_BRANCH.
39  *	Last updated from there: 24-July-1998 by Mark Smith <mcs>
40  *
41  * All of the Directory Server specific changes are enclosed inside
42  *	#ifdef NS_DIRECTORY.
43  ****************************************************************************
44  */
45 
46 /* SSL-specific security error codes  */
47 /* caller must include "sslerr.h" */
48 
49 ER3(SSL_ERROR_EXPORT_ONLY_SERVER,			SSL_ERROR_BASE + 0,
50 dgettext(TEXT_DOMAIN,
51 "Unable to communicate securely.  Peer does not support high-grade encryption."))
52 
53 ER3(SSL_ERROR_US_ONLY_SERVER,				SSL_ERROR_BASE + 1,
54 dgettext(TEXT_DOMAIN,
55 "Unable to communicate securely.  Peer requires high-grade encryption which is not supported."))
56 
57 ER3(SSL_ERROR_NO_CYPHER_OVERLAP,			SSL_ERROR_BASE + 2,
58 dgettext(TEXT_DOMAIN,
59 "Cannot communicate securely with peer: no common encryption algorithm(s)."))
60 
61 ER3(SSL_ERROR_NO_CERTIFICATE,				SSL_ERROR_BASE + 3,
62 dgettext(TEXT_DOMAIN,
63 "Unable to find the certificate or key necessary for authentication."))
64 
65 ER3(SSL_ERROR_BAD_CERTIFICATE,				SSL_ERROR_BASE + 4,
66 dgettext(TEXT_DOMAIN,
67 "Unable to communicate securely with peer: peers's certificate was rejected."))
68 
69 /* unused						(SSL_ERROR_BASE + 5),*/
70 
71 ER3(SSL_ERROR_BAD_CLIENT,				SSL_ERROR_BASE + 6,
72 dgettext(TEXT_DOMAIN,
73 "The server has encountered bad data from the client."))
74 
75 ER3(SSL_ERROR_BAD_SERVER,				SSL_ERROR_BASE + 7,
76 dgettext(TEXT_DOMAIN,
77 "The client has encountered bad data from the server."))
78 
79 ER3(SSL_ERROR_UNSUPPORTED_CERTIFICATE_TYPE,		SSL_ERROR_BASE + 8,
80 dgettext(TEXT_DOMAIN,
81 "Unsupported certificate type."))
82 
83 ER3(SSL_ERROR_UNSUPPORTED_VERSION,			SSL_ERROR_BASE + 9,
84 dgettext(TEXT_DOMAIN,
85 "Peer using unsupported version of security protocol."))
86 
87 /* unused						(SSL_ERROR_BASE + 10),*/
88 
89 ER3(SSL_ERROR_WRONG_CERTIFICATE,			SSL_ERROR_BASE + 11,
90 dgettext(TEXT_DOMAIN,
91 "Client authentication failed: private key in key database does not match public key in certificate database."))
92 
93 ER3(SSL_ERROR_BAD_CERT_DOMAIN,				SSL_ERROR_BASE + 12,
94 dgettext(TEXT_DOMAIN,
95 "Unable to communicate securely with peer: requested domain name does not match the server's certificate."))
96 
97 /* SSL_ERROR_POST_WARNING				(SSL_ERROR_BASE + 13),
98    defined in sslerr.h
99 */
100 
101 ER3(SSL_ERROR_SSL2_DISABLED,				(SSL_ERROR_BASE + 14),
102 dgettext(TEXT_DOMAIN,
103 "Peer only supports SSL version 2, which is locally disabled."))
104 
105 
106 ER3(SSL_ERROR_BAD_MAC_READ,				(SSL_ERROR_BASE + 15),
107 dgettext(TEXT_DOMAIN,
108 "SSL received a record with an incorrect Message Authentication Code."))
109 
110 ER3(SSL_ERROR_BAD_MAC_ALERT,				(SSL_ERROR_BASE + 16),
111 dgettext(TEXT_DOMAIN,
112 "SSL peer reports incorrect Message Authentication Code."))
113 
114 ER3(SSL_ERROR_BAD_CERT_ALERT,				(SSL_ERROR_BASE + 17),
115 dgettext(TEXT_DOMAIN,
116 "SSL peer cannot verify your certificate."))
117 
118 ER3(SSL_ERROR_REVOKED_CERT_ALERT,			(SSL_ERROR_BASE + 18),
119 dgettext(TEXT_DOMAIN,
120 "SSL peer rejected your certificate as revoked."))
121 
122 ER3(SSL_ERROR_EXPIRED_CERT_ALERT,			(SSL_ERROR_BASE + 19),
123 dgettext(TEXT_DOMAIN,
124 "SSL peer rejected your certificate as expired."))
125 
126 ER3(SSL_ERROR_SSL_DISABLED,				(SSL_ERROR_BASE + 20),
127 dgettext(TEXT_DOMAIN,
128 "Cannot connect: SSL is disabled."))
129 
130 ER3(SSL_ERROR_FORTEZZA_PQG,				(SSL_ERROR_BASE + 21),
131 dgettext(TEXT_DOMAIN,
132 "Cannot connect: SSL peer is in another FORTEZZA domain."))
133 
134 ER3(SSL_ERROR_UNKNOWN_CIPHER_SUITE          , (SSL_ERROR_BASE + 22),
135 dgettext(TEXT_DOMAIN,
136 "An unknown SSL cipher suite has been requested."))
137 
138 ER3(SSL_ERROR_NO_CIPHERS_SUPPORTED          , (SSL_ERROR_BASE + 23),
139 dgettext(TEXT_DOMAIN,
140 "No cipher suites are present and enabled in this program."))
141 
142 ER3(SSL_ERROR_BAD_BLOCK_PADDING             , (SSL_ERROR_BASE + 24),
143 dgettext(TEXT_DOMAIN,
144 "SSL received a record with bad block padding."))
145 
146 ER3(SSL_ERROR_RX_RECORD_TOO_LONG            , (SSL_ERROR_BASE + 25),
147 dgettext(TEXT_DOMAIN,
148 "SSL received a record that exceeded the maximum permissible length."))
149 
150 ER3(SSL_ERROR_TX_RECORD_TOO_LONG            , (SSL_ERROR_BASE + 26),
151 dgettext(TEXT_DOMAIN,
152 "SSL attempted to send a record that exceeded the maximum permissible length."))
153 
154 /*
155  * Received a malformed (too long or short or invalid content) SSL handshake.
156  */
157 ER3(SSL_ERROR_RX_MALFORMED_HELLO_REQUEST    , (SSL_ERROR_BASE + 27),
158 dgettext(TEXT_DOMAIN,
159 "SSL received a malformed Hello Request handshake message."))
160 
161 ER3(SSL_ERROR_RX_MALFORMED_CLIENT_HELLO     , (SSL_ERROR_BASE + 28),
162 dgettext(TEXT_DOMAIN,
163 "SSL received a malformed Client Hello handshake message."))
164 
165 ER3(SSL_ERROR_RX_MALFORMED_SERVER_HELLO     , (SSL_ERROR_BASE + 29),
166 dgettext(TEXT_DOMAIN,
167 "SSL received a malformed Server Hello handshake message."))
168 
169 ER3(SSL_ERROR_RX_MALFORMED_CERTIFICATE      , (SSL_ERROR_BASE + 30),
170 dgettext(TEXT_DOMAIN,
171 "SSL received a malformed Certificate handshake message."))
172 
173 ER3(SSL_ERROR_RX_MALFORMED_SERVER_KEY_EXCH  , (SSL_ERROR_BASE + 31),
174 dgettext(TEXT_DOMAIN,
175 "SSL received a malformed Server Key Exchange handshake message."))
176 
177 ER3(SSL_ERROR_RX_MALFORMED_CERT_REQUEST     , (SSL_ERROR_BASE + 32),
178 dgettext(TEXT_DOMAIN,
179 "SSL received a malformed Certificate Request handshake message."))
180 
181 ER3(SSL_ERROR_RX_MALFORMED_HELLO_DONE       , (SSL_ERROR_BASE + 33),
182 dgettext(TEXT_DOMAIN,
183 "SSL received a malformed Server Hello Done handshake message."))
184 
185 ER3(SSL_ERROR_RX_MALFORMED_CERT_VERIFY      , (SSL_ERROR_BASE + 34),
186 dgettext(TEXT_DOMAIN,
187 "SSL received a malformed Certificate Verify handshake message."))
188 
189 ER3(SSL_ERROR_RX_MALFORMED_CLIENT_KEY_EXCH  , (SSL_ERROR_BASE + 35),
190 dgettext(TEXT_DOMAIN,
191 "SSL received a malformed Client Key Exchange handshake message."))
192 
193 ER3(SSL_ERROR_RX_MALFORMED_FINISHED         , (SSL_ERROR_BASE + 36),
194 dgettext(TEXT_DOMAIN,
195 "SSL received a malformed Finished handshake message."))
196 
197 /*
198  * Received a malformed (too long or short) SSL record.
199  */
200 ER3(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER    , (SSL_ERROR_BASE + 37),
201 dgettext(TEXT_DOMAIN,
202 "SSL received a malformed Change Cipher Spec record."))
203 
204 ER3(SSL_ERROR_RX_MALFORMED_ALERT            , (SSL_ERROR_BASE + 38),
205 dgettext(TEXT_DOMAIN,
206 "SSL received a malformed Alert record."))
207 
208 ER3(SSL_ERROR_RX_MALFORMED_HANDSHAKE        , (SSL_ERROR_BASE + 39),
209 dgettext(TEXT_DOMAIN,
210 "SSL received a malformed Handshake record."))
211 
212 ER3(SSL_ERROR_RX_MALFORMED_APPLICATION_DATA , (SSL_ERROR_BASE + 40),
213 dgettext(TEXT_DOMAIN,
214 "SSL received a malformed Application Data record."))
215 
216 /*
217  * Received an SSL handshake that was inappropriate for the state we're in.
218  * E.g. Server received message from server, or wrong state in state machine.
219  */
220 ER3(SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST   , (SSL_ERROR_BASE + 41),
221 dgettext(TEXT_DOMAIN,
222 "SSL received an unexpected Hello Request handshake message."))
223 
224 ER3(SSL_ERROR_RX_UNEXPECTED_CLIENT_HELLO    , (SSL_ERROR_BASE + 42),
225 dgettext(TEXT_DOMAIN,
226 "SSL received an unexpected Client Hello handshake message."))
227 
228 ER3(SSL_ERROR_RX_UNEXPECTED_SERVER_HELLO    , (SSL_ERROR_BASE + 43),
229 dgettext(TEXT_DOMAIN,
230 "SSL received an unexpected Server Hello handshake message."))
231 
232 ER3(SSL_ERROR_RX_UNEXPECTED_CERTIFICATE     , (SSL_ERROR_BASE + 44),
233 dgettext(TEXT_DOMAIN,
234 "SSL received an unexpected Certificate handshake message."))
235 
236 ER3(SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH , (SSL_ERROR_BASE + 45),
237 dgettext(TEXT_DOMAIN,
238 "SSL received an unexpected Server Key Exchange handshake message."))
239 
240 ER3(SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST    , (SSL_ERROR_BASE + 46),
241 dgettext(TEXT_DOMAIN,
242 "SSL received an unexpected Certificate Request handshake message."))
243 
244 ER3(SSL_ERROR_RX_UNEXPECTED_HELLO_DONE      , (SSL_ERROR_BASE + 47),
245 dgettext(TEXT_DOMAIN,
246 "SSL received an unexpected Server Hello Done handshake message."))
247 
248 ER3(SSL_ERROR_RX_UNEXPECTED_CERT_VERIFY     , (SSL_ERROR_BASE + 48),
249 dgettext(TEXT_DOMAIN,
250 "SSL received an unexpected Certificate Verify handshake message."))
251 
252 ER3(SSL_ERROR_RX_UNEXPECTED_CLIENT_KEY_EXCH , (SSL_ERROR_BASE + 49),
253 dgettext(TEXT_DOMAIN,
254 "SSL received an unexpected Cllient Key Exchange handshake message."))
255 
256 ER3(SSL_ERROR_RX_UNEXPECTED_FINISHED        , (SSL_ERROR_BASE + 50),
257 dgettext(TEXT_DOMAIN,
258 "SSL received an unexpected Finished handshake message."))
259 
260 /*
261  * Received an SSL record that was inappropriate for the state we're in.
262  */
263 ER3(SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER   , (SSL_ERROR_BASE + 51),
264 dgettext(TEXT_DOMAIN,
265 "SSL received an unexpected Change Cipher Spec record."))
266 
267 ER3(SSL_ERROR_RX_UNEXPECTED_ALERT           , (SSL_ERROR_BASE + 52),
268 dgettext(TEXT_DOMAIN,
269 "SSL received an unexpected Alert record."))
270 
271 ER3(SSL_ERROR_RX_UNEXPECTED_HANDSHAKE       , (SSL_ERROR_BASE + 53),
272 dgettext(TEXT_DOMAIN,
273 "SSL received an unexpected Handshake record."))
274 
275 ER3(SSL_ERROR_RX_UNEXPECTED_APPLICATION_DATA, (SSL_ERROR_BASE + 54),
276 dgettext(TEXT_DOMAIN,
277 "SSL received an unexpected Application Data record."))
278 
279 /*
280  * Received record/message with unknown discriminant.
281  */
282 ER3(SSL_ERROR_RX_UNKNOWN_RECORD_TYPE        , (SSL_ERROR_BASE + 55),
283 dgettext(TEXT_DOMAIN,
284 "SSL received a record with an unknown content type."))
285 
286 ER3(SSL_ERROR_RX_UNKNOWN_HANDSHAKE          , (SSL_ERROR_BASE + 56),
287 dgettext(TEXT_DOMAIN,
288 "SSL received a handshake message with an unknown message type."))
289 
290 ER3(SSL_ERROR_RX_UNKNOWN_ALERT              , (SSL_ERROR_BASE + 57),
291 dgettext(TEXT_DOMAIN,
292 "SSL received an alert record with an unknown alert description."))
293 
294 /*
295  * Received an alert reporting what we did wrong.  (more alerts above)
296  */
297 ER3(SSL_ERROR_CLOSE_NOTIFY_ALERT            , (SSL_ERROR_BASE + 58),
298 dgettext(TEXT_DOMAIN,
299 "SSL peer has closed this connection."))
300 
301 ER3(SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT    , (SSL_ERROR_BASE + 59),
302 dgettext(TEXT_DOMAIN,
303 "SSL peer was not expecting a handshake message it received."))
304 
305 ER3(SSL_ERROR_DECOMPRESSION_FAILURE_ALERT   , (SSL_ERROR_BASE + 60),
306 dgettext(TEXT_DOMAIN,
307 "SSL peer was unable to succesfully decompress an SSL record it received."))
308 
309 ER3(SSL_ERROR_HANDSHAKE_FAILURE_ALERT       , (SSL_ERROR_BASE + 61),
310 dgettext(TEXT_DOMAIN,
311 "SSL peer was unable to negotiate an acceptable set of security parameters."))
312 
313 ER3(SSL_ERROR_ILLEGAL_PARAMETER_ALERT       , (SSL_ERROR_BASE + 62),
314 dgettext(TEXT_DOMAIN,
315 "SSL peer rejected a handshake message for unacceptable content."))
316 
317 ER3(SSL_ERROR_UNSUPPORTED_CERT_ALERT        , (SSL_ERROR_BASE + 63),
318 dgettext(TEXT_DOMAIN,
319 "SSL peer does not support certificates of the type it received."))
320 
321 ER3(SSL_ERROR_CERTIFICATE_UNKNOWN_ALERT     , (SSL_ERROR_BASE + 64),
322 dgettext(TEXT_DOMAIN,
323 "SSL peer had some unspecified issue with the certificate it received."))
324 
325 ER3(SSL_ERROR_GENERATE_RANDOM_FAILURE       , (SSL_ERROR_BASE + 65),
326 dgettext(TEXT_DOMAIN,
327 "SSL experienced a failure of its random number generator."))
328 
329 ER3(SSL_ERROR_SIGN_HASHES_FAILURE           , (SSL_ERROR_BASE + 66),
330 dgettext(TEXT_DOMAIN,
331 "Unable to digitally sign data required to verify your certificate."))
332 
333 ER3(SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE    , (SSL_ERROR_BASE + 67),
334 dgettext(TEXT_DOMAIN,
335 "SSL was unable to extract the public key from the peer's certificate."))
336 
337 ER3(SSL_ERROR_SERVER_KEY_EXCHANGE_FAILURE   , (SSL_ERROR_BASE + 68),
338 dgettext(TEXT_DOMAIN,
339 "Unspecified failure while processing SSL Server Key Exchange handshake."))
340 
341 ER3(SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE   , (SSL_ERROR_BASE + 69),
342 dgettext(TEXT_DOMAIN,
343 "Unspecified failure while processing SSL Client Key Exchange handshake."))
344 
345 ER3(SSL_ERROR_ENCRYPTION_FAILURE            , (SSL_ERROR_BASE + 70),
346 dgettext(TEXT_DOMAIN,
347 "Bulk data encryption algorithm failed in selected cipher suite."))
348 
349 ER3(SSL_ERROR_DECRYPTION_FAILURE            , (SSL_ERROR_BASE + 71),
350 dgettext(TEXT_DOMAIN,
351 "Bulk data decryption algorithm failed in selected cipher suite."))
352 
353 ER3(SSL_ERROR_SOCKET_WRITE_FAILURE          , (SSL_ERROR_BASE + 72),
354 dgettext(TEXT_DOMAIN,
355 "Attempt to write encrypted data to underlying socket failed."))
356 
357 ER3(SSL_ERROR_MD5_DIGEST_FAILURE            , (SSL_ERROR_BASE + 73),
358 dgettext(TEXT_DOMAIN,
359 "MD5 digest function failed."))
360 
361 ER3(SSL_ERROR_SHA_DIGEST_FAILURE            , (SSL_ERROR_BASE + 74),
362 dgettext(TEXT_DOMAIN,
363 "SHA-1 digest function failed."))
364 
365 ER3(SSL_ERROR_MAC_COMPUTATION_FAILURE       , (SSL_ERROR_BASE + 75),
366 dgettext(TEXT_DOMAIN,
367 "MAC computation failed."))
368 
369 ER3(SSL_ERROR_SYM_KEY_CONTEXT_FAILURE       , (SSL_ERROR_BASE + 76),
370 dgettext(TEXT_DOMAIN,
371 "Failure to create Symmetric Key context."))
372 
373 ER3(SSL_ERROR_SYM_KEY_UNWRAP_FAILURE        , (SSL_ERROR_BASE + 77),
374 dgettext(TEXT_DOMAIN,
375 "Failure to unwrap the Symmetric key in Client Key Exchange message."))
376 
377 ER3(SSL_ERROR_PUB_KEY_SIZE_LIMIT_EXCEEDED   , (SSL_ERROR_BASE + 78),
378 dgettext(TEXT_DOMAIN,
379 "SSL Server attempted to use domestic-grade public key with export cipher suite."))
380 
381 ER3(SSL_ERROR_IV_PARAM_FAILURE              , (SSL_ERROR_BASE + 79),
382 dgettext(TEXT_DOMAIN,
383 "PKCS11 code failed to translate an IV into a param."))
384 
385 ER3(SSL_ERROR_INIT_CIPHER_SUITE_FAILURE     , (SSL_ERROR_BASE + 80),
386 dgettext(TEXT_DOMAIN,
387 "Failed to initialize the selected cipher suite."))
388 
389 ER3(SSL_ERROR_SESSION_KEY_GEN_FAILURE       , (SSL_ERROR_BASE + 81),
390 dgettext(TEXT_DOMAIN,
391 "Client failed to generate session keys for SSL session."))
392 
393 ER3(SSL_ERROR_NO_SERVER_KEY_FOR_ALG         , (SSL_ERROR_BASE + 82),
394 dgettext(TEXT_DOMAIN,
395 "Server has no key for the attempted key exchange algorithm."))
396 
397 ER3(SSL_ERROR_TOKEN_INSERTION_REMOVAL       , (SSL_ERROR_BASE + 83),
398 dgettext(TEXT_DOMAIN,
399 "PKCS#11 token was inserted or removed while operation was in progress."))
400 
401 ER3(SSL_ERROR_TOKEN_SLOT_NOT_FOUND          , (SSL_ERROR_BASE + 84),
402 dgettext(TEXT_DOMAIN,
403 "No PKCS#11 token could be found to do a required operation."))
404 
405 ER3(SSL_ERROR_NO_COMPRESSION_OVERLAP        , (SSL_ERROR_BASE + 85),
406 dgettext(TEXT_DOMAIN,
407 "Cannot communicate securely with peer: no common compression algorithm(s)."))
408 
409 ER3(SSL_ERROR_HANDSHAKE_NOT_COMPLETED       , (SSL_ERROR_BASE + 86),
410 dgettext(TEXT_DOMAIN,
411 "Cannot initiate another SSL handshake until current handshake is complete."))
412 
413 ER3(SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE      , (SSL_ERROR_BASE + 87),
414 dgettext(TEXT_DOMAIN,
415 "Received incorrect handshakes hash values from peer."))
416 
417 ER3(SSL_ERROR_CERT_KEA_MISMATCH             , (SSL_ERROR_BASE + 88),
418 dgettext(TEXT_DOMAIN,
419 "The certificate provided cannot be used with the selected key exchange algorithm."))
420