README: document *next* branch etc.
[s-mailx.git] / nsserr.c
blob79cf128a4d4a4d88000d159cdb6696f6b208062f
1 /*
2 * S-nail - a mail user agent derived from Berkeley Mail.
4 * Copyright (c) 2000-2005 Gunnar Ritter, Freiburg i. Br., Germany.
5 * Copyright (c) 2012 Steffen "Daode" Nurpmeso.
6 */
7 /*
8 * Generated from
9 * <http://www.mozilla.org/projects/nspr/reference/html/prerr.html#26127>.
11 * The contents of this file are subject to the Mozilla Public License
12 * Version 1.1 (the "License"); you may not use this file except in
13 * compliance with the License. You may obtain a copy of the License
14 * at http://www.mozilla.org/MPL/
16 * Software distributed under the License is distributed on an "AS
17 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
18 * implied. See the License for the specific language governing
19 * rights and limitations under the License.
21 * The Original Code is the Netscape security libraries.
23 * The Initial Developer of the Original Code is Netscape
24 * Communications Corporation. Portions created by Netscape are
25 * Copyright (C) 1994-2000 Netscape Communications Corporation. All
26 * Rights Reserved.
29 #include <sslerr.h>
30 #include <secerr.h>
32 static const char *
33 nss_strerror(int ec)
35 const char *cp;
36 static char eb[30];
38 switch (ec) {
39 default:
40 snprintf(eb, sizeof eb, "Unknown error %d", ec);
41 cp = eb;
42 break;
43 case SSL_ERROR_EXPORT_ONLY_SERVER:
44 cp = "Unable to communicate securely. Peer does not support high-grade encryption";
45 break;
46 case SSL_ERROR_US_ONLY_SERVER:
47 cp = "Unable to communicate securely. Peer requires high-grade encryption which is not supported";
48 break;
49 case SSL_ERROR_NO_CYPHER_OVERLAP:
50 cp = "Cannot communicate securely with peer: no common encryption algorithm(s)";
51 break;
52 case SSL_ERROR_NO_CERTIFICATE:
53 cp = "Unable to find the certificate or key necessary for authentication";
54 break;
55 case SSL_ERROR_BAD_CERTIFICATE:
56 cp = "Unable to communicate securely with peer: peers's certificate was rejected";
57 break;
58 case SSL_ERROR_BAD_CLIENT:
59 cp = "The server has encountered bad data from the client";
60 break;
61 case SSL_ERROR_BAD_SERVER:
62 cp = "The client has encountered bad data from the server";
63 break;
64 case SSL_ERROR_UNSUPPORTED_CERTIFICATE_TYPE:
65 cp = "Unsupported certificate type";
66 break;
67 case SSL_ERROR_UNSUPPORTED_VERSION:
68 cp = "Peer using unsupported version of security protocol";
69 break;
70 case SSL_ERROR_WRONG_CERTIFICATE:
71 cp = "Client authentication failed: private key in key database does not correspond to public key in certificate database";
72 break;
73 case SSL_ERROR_BAD_CERT_DOMAIN:
74 cp = "Unable to communicate securely with peer: requested domain name does not match the server's certificate";
75 break;
76 case SSL_ERROR_POST_WARNING:
77 cp = "(unused)";
78 break;
79 case SSL_ERROR_SSL2_DISABLED:
80 cp = "Peer only supports SSL version 2, which is locally disabled";
81 break;
82 case SSL_ERROR_BAD_MAC_READ:
83 cp = "SSL received a record with an incorrect Message Authentication Code";
84 break;
85 case SSL_ERROR_BAD_MAC_ALERT:
86 cp = "SSL peer reports incorrect Message Authentication Code";
87 break;
88 case SSL_ERROR_BAD_CERT_ALERT:
89 cp = "SSL peer cannot verify your certificate";
90 break;
91 case SSL_ERROR_REVOKED_CERT_ALERT:
92 cp = "SSL peer rejected your certificate as revoked";
93 break;
94 case SSL_ERROR_EXPIRED_CERT_ALERT:
95 cp = "SSL peer rejected your certificate as expired";
96 break;
97 case SSL_ERROR_SSL_DISABLED:
98 cp = "Cannot connect: SSL is disabled";
99 break;
100 case SSL_ERROR_FORTEZZA_PQG:
101 cp = "Cannot connect: SSL peer is in another FORTEZZA domain";
102 break;
103 case SSL_ERROR_UNKNOWN_CIPHER_SUITE:
104 cp = "An unknown SSL cipher suite has been requested";
105 break;
106 case SSL_ERROR_NO_CIPHERS_SUPPORTED:
107 cp = "No cipher suites are present and enabled in this program";
108 break;
109 case SSL_ERROR_BAD_BLOCK_PADDING:
110 cp = "SSL received a record with bad block padding";
111 break;
112 case SSL_ERROR_RX_RECORD_TOO_LONG:
113 cp = "SSL received a record that exceeded the maximum permissible length";
114 break;
115 case SSL_ERROR_TX_RECORD_TOO_LONG:
116 cp = "SSL attempted to send a record that exceeded the maximum permissible length";
117 break;
118 case SSL_ERROR_CLOSE_NOTIFY_ALERT:
119 cp = "SSL peer has closed this connection";
120 break;
121 case SSL_ERROR_PUB_KEY_SIZE_LIMIT_EXCEEDED:
122 cp = "SSL Server attempted to use domestic-grade public key with export cipher suite";
123 break;
124 case SSL_ERROR_NO_SERVER_KEY_FOR_ALG:
125 cp = "Server has no key for the attempted key exchange algorithm";
126 break;
127 case SSL_ERROR_TOKEN_INSERTION_REMOVAL:
128 cp = "PKCS #11 token was inserted or removed while operation was in progress";
129 break;
130 case SSL_ERROR_TOKEN_SLOT_NOT_FOUND:
131 cp = "No PKCS#11 token could be found to do a required operation";
132 break;
133 case SSL_ERROR_NO_COMPRESSION_OVERLAP:
134 cp = "Cannot communicate securely with peer: no common compression algorithm(s)";
135 break;
136 case SSL_ERROR_HANDSHAKE_NOT_COMPLETED:
137 cp = "Cannot initiate another SSL handshake until current handshake is complete";
138 break;
139 case SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE:
140 cp = "Received incorrect handshakes hash values from peer";
141 break;
142 case SSL_ERROR_CERT_KEA_MISMATCH:
143 cp = "The certificate provided cannot be used with the selected key exchange algorithm";
144 break;
145 case SSL_ERROR_NO_TRUSTED_SSL_CLIENT_CA:
146 cp = "No certificate authority is trusted for SSL client authentication";
147 break;
148 case SSL_ERROR_SESSION_NOT_FOUND:
149 cp = "Client's SSL session ID not found in server's session cache";
150 break;
151 case SSL_ERROR_RX_MALFORMED_HELLO_REQUEST:
152 cp = "SSL received a malformed Hello Request handshake message";
153 break;
154 case SSL_ERROR_RX_MALFORMED_CLIENT_HELLO:
155 cp = "SSL received a malformed Client Hello handshake message";
156 break;
157 case SSL_ERROR_RX_MALFORMED_SERVER_HELLO:
158 cp = "SSL received a malformed Server Hello handshake message";
159 break;
160 case SSL_ERROR_RX_MALFORMED_CERTIFICATE:
161 cp = "SSL received a malformed Certificate handshake message";
162 break;
163 case SSL_ERROR_RX_MALFORMED_SERVER_KEY_EXCH:
164 cp = "SSL received a malformed Server Key Exchange handshake message";
165 break;
166 case SSL_ERROR_RX_MALFORMED_CERT_REQUEST:
167 cp = "SSL received a malformed Certificate Request handshake message";
168 break;
169 case SSL_ERROR_RX_MALFORMED_HELLO_DONE:
170 cp = "SSL received a malformed Server Hello Done handshake message";
171 break;
172 case SSL_ERROR_RX_MALFORMED_CERT_VERIFY:
173 cp = "SSL received a malformed Certificate Verify handshake message";
174 break;
175 case SSL_ERROR_RX_MALFORMED_CLIENT_KEY_EXCH:
176 cp = "SSL received a malformed Client Key Exchange handshake message";
177 break;
178 case SSL_ERROR_RX_MALFORMED_FINISHED:
179 cp = "SSL received a malformed Finished handshake message";
180 break;
181 case SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER:
182 cp = "SSL received a malformed Change Cipher Spec record";
183 break;
184 case SSL_ERROR_RX_MALFORMED_ALERT:
185 cp = "SSL received a malformed Alert record";
186 break;
187 case SSL_ERROR_RX_MALFORMED_HANDSHAKE:
188 cp = "SSL received a malformed Handshake record";
189 break;
190 case SSL_ERROR_RX_MALFORMED_APPLICATION_DATA:
191 cp = "SSL received a malformed Application Data record";
192 break;
193 case SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST:
194 cp = "SSL received an unexpected Hello Request handshake message";
195 break;
196 case SSL_ERROR_RX_UNEXPECTED_CLIENT_HELLO:
197 cp = "SSL received an unexpected Client Hello handshake message";
198 break;
199 case SSL_ERROR_RX_UNEXPECTED_SERVER_HELLO:
200 cp = "SSL received an unexpected Server Hello handshake message";
201 break;
202 case SSL_ERROR_RX_UNEXPECTED_CERTIFICATE:
203 cp = "SSL received an unexpected Certificate handshake message";
204 break;
205 case SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH:
206 cp = "SSL received an unexpected Server Key Exchange handshake message";
207 break;
208 case SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST:
209 cp = "SSL received an unexpected Certificate Request handshake message";
210 break;
211 case SSL_ERROR_RX_UNEXPECTED_HELLO_DONE:
212 cp = "SSL received an unexpected Server Hello Done handshake message";
213 break;
214 case SSL_ERROR_RX_UNEXPECTED_CERT_VERIFY:
215 cp = "SSL received an unexpected Certificate Verify handshake message";
216 break;
217 case SSL_ERROR_RX_UNEXPECTED_CLIENT_KEY_EXCH:
218 cp = "SSL received an unexpected Client Key Exchange handshake message";
219 break;
220 case SSL_ERROR_RX_UNEXPECTED_FINISHED:
221 cp = "SSL received an unexpected Finished handshake message";
222 break;
223 case SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER:
224 cp = "SSL received an unexpected Change Cipher Spec record";
225 break;
226 case SSL_ERROR_RX_UNEXPECTED_ALERT:
227 cp = "SSL received an unexpected Alert record";
228 break;
229 case SSL_ERROR_RX_UNEXPECTED_HANDSHAKE:
230 cp = "SSL received an unexpected Handshake record";
231 break;
232 case SSL_ERROR_RX_UNEXPECTED_APPLICATION_DATA:
233 cp = "SSL received an unexpected Application Data record";
234 break;
235 case SSL_ERROR_RX_UNKNOWN_RECORD_TYPE:
236 cp = "SSL received a record with an unknown content type";
237 break;
238 case SSL_ERROR_RX_UNKNOWN_HANDSHAKE:
239 cp = "SSL received a handshake message with an unknown message type";
240 break;
241 case SSL_ERROR_RX_UNKNOWN_ALERT:
242 cp = "SSL received an alert record with an unknown alert description";
243 break;
244 case SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT:
245 cp = "SSL peer was not expecting a handshake message it received";
246 break;
247 case SSL_ERROR_DECOMPRESSION_FAILURE_ALERT:
248 cp = "SSL peer was unable to successfully decompress an SSL record it received";
249 break;
250 case SSL_ERROR_HANDSHAKE_FAILURE_ALERT:
251 cp = "SSL peer was unable to negotiate an acceptable set of security parameters";
252 break;
253 case SSL_ERROR_ILLEGAL_PARAMETER_ALERT:
254 cp = "SSL peer rejected a handshake message for unacceptable content";
255 break;
256 case SSL_ERROR_UNSUPPORTED_CERT_ALERT:
257 cp = "SSL peer does not support certificates of the type it received";
258 break;
259 case SSL_ERROR_CERTIFICATE_UNKNOWN_ALERT:
260 cp = "SSL peer had some unspecified issue with the certificate it received";
261 break;
262 case SSL_ERROR_DECRYPTION_FAILED_ALERT:
263 cp = "Peer was unable to decrypt an SSL record it received";
264 break;
265 case SSL_ERROR_RECORD_OVERFLOW_ALERT:
266 cp = "Peer received an SSL record that was longer than is permitted";
267 break;
268 case SSL_ERROR_UNKNOWN_CA_ALERT:
269 cp = "Peer does not recognize and trust the CA that issued your certificate";
270 break;
271 case SSL_ERROR_ACCESS_DENIED_ALERT:
272 cp = "Peer received a valid certificate, but access was denied";
273 break;
274 case SSL_ERROR_DECODE_ERROR_ALERT:
275 cp = "Peer could not decode an SSL handshake message";
276 break;
277 case SSL_ERROR_DECRYPT_ERROR_ALERT:
278 cp = "Peer reports failure of signature verification or key exchange";
279 break;
280 case SSL_ERROR_EXPORT_RESTRICTION_ALERT:
281 cp = "Peer reports negotiation not in compliance with export regulations";
282 break;
283 case SSL_ERROR_PROTOCOL_VERSION_ALERT:
284 cp = "Peer reports incompatible or unsupported protocol version";
285 break;
286 case SSL_ERROR_INSUFFICIENT_SECURITY_ALERT:
287 cp = "Server requires ciphers more secure than those supported by client";
288 break;
289 case SSL_ERROR_INTERNAL_ERROR_ALERT:
290 cp = "Peer reports it experienced an internal error";
291 break;
292 case SSL_ERROR_USER_CANCELED_ALERT:
293 cp = "Peer user canceled handshake";
294 break;
295 case SSL_ERROR_NO_RENEGOTIATION_ALERT:
296 cp = "Peer does not permit renegotiation of SSL security parameters";
297 break;
298 case SSL_ERROR_GENERATE_RANDOM_FAILURE:
299 cp = "SSL experienced a failure of its random number generator";
300 break;
301 case SSL_ERROR_SIGN_HASHES_FAILURE:
302 cp = "Unable to digitally sign data required to verify your certificate";
303 break;
304 case SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE:
305 cp = "SSL was unable to extract the public key from the peer's certificate";
306 break;
307 case SSL_ERROR_SERVER_KEY_EXCHANGE_FAILURE:
308 cp = "Unspecified failure while processing SSL Server Key Exchange handshake";
309 break;
310 case SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE:
311 cp = "Unspecified failure while processing SSL Client Key Exchange handshake";
312 break;
313 case SSL_ERROR_ENCRYPTION_FAILURE:
314 cp = "Bulk data encryption algorithm failed in selected cipher suite";
315 break;
316 case SSL_ERROR_DECRYPTION_FAILURE:
317 cp = "Bulk data decryption algorithm failed in selected cipher suite";
318 break;
319 case SSL_ERROR_MD5_DIGEST_FAILURE:
320 cp = "MD5 digest function failed";
321 break;
322 case SSL_ERROR_SHA_DIGEST_FAILURE:
323 cp = "SHA-1 digest function failed";
324 break;
325 case SSL_ERROR_MAC_COMPUTATION_FAILURE:
326 cp = "Message Authentication Code computation failed";
327 break;
328 case SSL_ERROR_SYM_KEY_CONTEXT_FAILURE:
329 cp = "Failure to create Symmetric Key context";
330 break;
331 case SSL_ERROR_SYM_KEY_UNWRAP_FAILURE:
332 cp = "Failure to unwrap the Symmetric key in Client Key Exchange message";
333 break;
334 case SSL_ERROR_IV_PARAM_FAILURE:
335 cp = "PKCS11 code failed to translate an IV into a param";
336 break;
337 case SSL_ERROR_INIT_CIPHER_SUITE_FAILURE:
338 cp = "Failed to initialize the selected cipher suite";
339 break;
340 case SSL_ERROR_SOCKET_WRITE_FAILURE:
341 cp = "Attempt to write encrypted data to underlying socket failed";
342 break;
343 case SSL_ERROR_SESSION_KEY_GEN_FAILURE:
344 cp = "Failed to generate session keys for SSL session";
345 break;
346 case SEC_ERROR_IO:
347 cp = "An I/O error occurred during authentication";
348 break;
349 case SEC_ERROR_LIBRARY_FAILURE:
350 cp = "Security library failure";
351 break;
352 case SEC_ERROR_BAD_DATA:
353 cp = "Security library: received bad data";
354 break;
355 case SEC_ERROR_OUTPUT_LEN:
356 cp = "Security library: output length error";
357 break;
358 case SEC_ERROR_INPUT_LEN:
359 cp = "Security library: input length error";
360 break;
361 case SEC_ERROR_INVALID_ARGS:
362 cp = "Security library: invalid arguments";
363 break;
364 case SEC_ERROR_INVALID_ALGORITHM:
365 cp = "Security library: invalid algorithm";
366 break;
367 case SEC_ERROR_INVALID_AVA:
368 cp = "Security library: invalid AVA";
369 break;
370 case SEC_ERROR_INVALID_TIME:
371 cp = "Security library: invalid time";
372 break;
373 case SEC_ERROR_BAD_DER:
374 cp = "Security library: improperly formatted DER-encoded message";
375 break;
376 case SEC_ERROR_BAD_SIGNATURE:
377 cp = "Peer's certificate has an invalid signature";
378 break;
379 case SEC_ERROR_EXPIRED_CERTIFICATE:
380 cp = "Peer's certificate has expired";
381 break;
382 case SEC_ERROR_REVOKED_CERTIFICATE:
383 cp = "Peer's certificate has been revoked";
384 break;
385 case SEC_ERROR_UNKNOWN_ISSUER:
386 cp = "Peer's certificate issuer is not recognized";
387 break;
388 case SEC_ERROR_BAD_KEY:
389 cp = "Peer's public key is invalid";
390 break;
391 case SEC_ERROR_BAD_PASSWORD:
392 cp = "The password entered is incorrect";
393 break;
394 case SEC_ERROR_RETRY_PASSWORD:
395 cp = "New password entered incorrectly";
396 break;
397 case SEC_ERROR_NO_NODELOCK:
398 cp = "Security library: no nodelock";
399 break;
400 case SEC_ERROR_BAD_DATABASE:
401 cp = "Security library: bad database";
402 break;
403 case SEC_ERROR_NO_MEMORY:
404 cp = "Security library: memory allocation failure";
405 break;
406 case SEC_ERROR_UNTRUSTED_ISSUER:
407 cp = "Peer's certificate issuer has been marked as not trusted by the";
408 break;
409 case SEC_ERROR_UNTRUSTED_CERT:
410 cp = "Peer's certificate has been marked as not trusted by the user";
411 break;
412 case SEC_ERROR_DUPLICATE_CERT:
413 cp = "Certificate already exists in your database";
414 break;
415 case SEC_ERROR_DUPLICATE_CERT_NAME:
416 cp = "Downloaded certificate's name duplicates one already in your";
417 break;
418 case SEC_ERROR_ADDING_CERT:
419 cp = "Error adding certificate to database";
420 break;
421 case SEC_ERROR_FILING_KEY:
422 cp = "Error refiling the key for this certificate";
423 break;
424 case SEC_ERROR_NO_KEY:
425 cp = "The private key for this certificate cannot be found in key";
426 break;
427 case SEC_ERROR_CERT_VALID:
428 cp = "This certificate is valid";
429 break;
430 case SEC_ERROR_CERT_NOT_VALID:
431 cp = "This certificate is not valid";
432 break;
433 case SEC_ERROR_CERT_NO_RESPONSE:
434 cp = "Certificate library: no response";
435 break;
436 case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE:
437 cp = "The certificate issuer's certificate has expired";
438 break;
439 case SEC_ERROR_CRL_EXPIRED:
440 cp = "The CRL for the certificate's issuer has expired";
441 break;
442 case SEC_ERROR_CRL_BAD_SIGNATURE:
443 cp = "The CRL for the certificate's issuer has an invalid signature";
444 break;
445 case SEC_ERROR_CRL_INVALID:
446 cp = "New CRL has an invalid format";
447 break;
448 case SEC_ERROR_EXTENSION_VALUE_INVALID:
449 cp = "Certificate extension value is invalid";
450 break;
451 case SEC_ERROR_EXTENSION_NOT_FOUND:
452 cp = "Certificate extension not found";
453 break;
454 case SEC_ERROR_CA_CERT_INVALID:
455 cp = "Issuer certificate is invalid";
456 break;
457 case SEC_ERROR_PATH_LEN_CONSTRAINT_INVALID:
458 cp = "Certificate path length constraint is invalid";
459 break;
460 case SEC_ERROR_CERT_USAGES_INVALID:
461 cp = "Certificate usages field is invalid";
462 break;
463 case SEC_INTERNAL_ONLY:
464 cp = "Internal-only module";
465 break;
466 case SEC_ERROR_INVALID_KEY:
467 cp = "The key does not support the requested operation";
468 break;
469 case SEC_ERROR_UNKNOWN_CRITICAL_EXTENSION:
470 cp = "Certificate contains unknown critical extension";
471 break;
472 case SEC_ERROR_OLD_CRL:
473 cp = "New CRL is not later than the current one";
474 break;
475 case SEC_ERROR_NO_EMAIL_CERT:
476 cp = "Not encrypted or signed: you do not yet have an email certificate";
477 break;
478 case SEC_ERROR_NO_RECIPIENT_CERTS_QUERY:
479 cp = "Not encrypted: you do not have certificates for each of the";
480 break;
481 case SEC_ERROR_NOT_A_RECIPIENT:
482 cp = "Cannot decrypt: you are not a recipient, or matching certificate";
483 break;
484 case SEC_ERROR_PKCS7_KEYALG_MISMATCH:
485 cp = "Cannot decrypt: key encryption algorithm does not match your";
486 break;
487 case SEC_ERROR_PKCS7_BAD_SIGNATURE:
488 cp = "Signature verification failed: no signer found, too many signers";
489 break;
490 case SEC_ERROR_UNSUPPORTED_KEYALG:
491 cp = "Unsupported or unknown key algorithm";
492 break;
493 case SEC_ERROR_DECRYPTION_DISALLOWED:
494 cp = "Cannot decrypt: encrypted using a disallowed algorithm or key size";
495 break;
496 #ifdef notdef
497 case XP_EC_FORTEZZA_BAD_CARD:
498 cp = "FORTEZZA card has not been properly initialized";
499 break;
500 case XP_EC_FORTEZZA_NO_CARD:
501 cp = "No FORTEZZA cards found";
502 break;
503 case XP_EC_FORTEZZA_NONE_SELECTED:
504 cp = "No FORTEZZA card selected";
505 break;
506 case XP_EC_FORTEZZA_MORE_INFO:
507 cp = "Please select a personality to get more info on";
508 break;
509 case XP_EC_FORTEZZA_PERSON_NOT_FOUND:
510 cp = "Personality not found";
511 break;
512 case XP_EC_FORTEZZA_NO_MORE_INFO:
513 cp = "No more information on that personality";
514 break;
515 case XP_EC_FORTEZZA_BAD_PIN:
516 cp = "Invalid PIN";
517 break;
518 case XP_EC_FORTEZZA_PERSON_ERROR:
519 cp = "Couldn't initialize FORTEZZA personalities";
520 break;
521 #endif /* notdef */
522 case SEC_ERROR_NO_KRL:
523 cp = "No KRL for this site's certificate has been found";
524 break;
525 case SEC_ERROR_KRL_EXPIRED:
526 cp = "The KRL for this site's certificate has expired";
527 break;
528 case SEC_ERROR_KRL_BAD_SIGNATURE:
529 cp = "The KRL for this site's certificate has an invalid signature";
530 break;
531 case SEC_ERROR_REVOKED_KEY:
532 cp = "The key for this site's certificate has been revoked";
533 break;
534 case SEC_ERROR_KRL_INVALID:
535 cp = "New KRL has an invalid format";
536 break;
537 case SEC_ERROR_NEED_RANDOM:
538 cp = "Security library: need random data";
539 break;
540 case SEC_ERROR_NO_MODULE:
541 cp = "Security library: no security module can perform the requested";
542 break;
543 case SEC_ERROR_NO_TOKEN:
544 cp = "The security card or token does not exist, needs to be";
545 break;
546 case SEC_ERROR_READ_ONLY:
547 cp = "Security library: read-only database";
548 break;
549 case SEC_ERROR_NO_SLOT_SELECTED:
550 cp = "No slot or token was selected";
551 break;
552 case SEC_ERROR_CERT_NICKNAME_COLLISION:
553 cp = "A certificate with the same nickname already exists";
554 break;
555 case SEC_ERROR_KEY_NICKNAME_COLLISION:
556 cp = "A key with the same nickname already exists";
557 break;
558 case SEC_ERROR_SAFE_NOT_CREATED:
559 cp = "Error while creating safe object";
560 break;
561 case SEC_ERROR_BAGGAGE_NOT_CREATED:
562 cp = "Error while creating baggage object";
563 break;
564 #ifdef notdef
565 case XP_AVA_REMOVE_PRINCIPAL_ERROR:
566 cp = "Couldn't remove the principal";
567 break;
568 case XP_AVA_DELETE_PRIVILEGE_ERROR:
569 cp = "Couldn't delete the privilege";
570 break;
571 case XP_AVA_CERT_NOT_EXISTS_ERROR:
572 cp = "This principal doesn't have a certificate";
573 break;
574 #endif /* notdef */
575 case SEC_ERROR_BAD_EXPORT_ALGORITHM:
576 cp = "Required algorithm is not allowed";
577 break;
578 case SEC_ERROR_EXPORTING_CERTIFICATES:
579 cp = "Error attempting to export certificates";
580 break;
581 case SEC_ERROR_IMPORTING_CERTIFICATES:
582 cp = "Error attempting to import certificates";
583 break;
584 case SEC_ERROR_PKCS12_DECODING_PFX:
585 cp = "Unable to import. Decoding error. File not valid";
586 break;
587 case SEC_ERROR_PKCS12_INVALID_MAC:
588 cp = "Unable to import. Invalid MAC. Incorrect password or corrupt file";
589 break;
590 case SEC_ERROR_PKCS12_UNSUPPORTED_MAC_ALGORITHM:
591 cp = "Unable to import. MAC algorithm not supported";
592 break;
593 case SEC_ERROR_PKCS12_UNSUPPORTED_TRANSPORT_MODE:
594 cp = "Unable to import. Only password integrity and privacy modes";
595 break;
596 case SEC_ERROR_PKCS12_CORRUPT_PFX_STRUCTURE:
597 cp = "Unable to import. File structure is corrupt";
598 break;
599 case SEC_ERROR_PKCS12_UNSUPPORTED_PBE_ALGORITHM:
600 cp = "Unable to import. Encryption algorithm not supported";
601 break;
602 case SEC_ERROR_PKCS12_UNSUPPORTED_VERSION:
603 cp = "Unable to import. File version not supported";
604 break;
605 case SEC_ERROR_PKCS12_PRIVACY_PASSWORD_INCORRECT:
606 cp = "Unable to import. Incorrect privacy password";
607 break;
608 case SEC_ERROR_PKCS12_CERT_COLLISION:
609 cp = "Unable to import. Same nickname already exists in database";
610 break;
611 case SEC_ERROR_USER_CANCELLED:
612 cp = "The user clicked cancel";
613 break;
614 case SEC_ERROR_PKCS12_DUPLICATE_DATA:
615 cp = "Not imported, already in database";
616 break;
617 case SEC_ERROR_MESSAGE_SEND_ABORTED:
618 cp = "Message not sent";
619 break;
620 case SEC_ERROR_INADEQUATE_KEY_USAGE:
621 cp = "Certificate key usage inadequate for attempted operation";
622 break;
623 case SEC_ERROR_INADEQUATE_CERT_TYPE:
624 cp = "Certificate type not approved for application";
625 break;
626 case SEC_ERROR_CERT_ADDR_MISMATCH:
627 cp = "Address in signing certificate does not match address in message";
628 break;
629 case SEC_ERROR_PKCS12_UNABLE_TO_IMPORT_KEY:
630 cp = "Unable to import. Error attempting to import private key";
631 break;
632 case SEC_ERROR_PKCS12_IMPORTING_CERT_CHAIN:
633 cp = "Unable to import. Error attempting to import certificate chain";
634 break;
635 case SEC_ERROR_PKCS12_UNABLE_TO_LOCATE_OBJECT_BY_NAME:
636 cp = "Unable to export. Unable to locate certificate or key by nickname";
637 break;
638 case SEC_ERROR_PKCS12_UNABLE_TO_EXPORT_KEY:
639 cp = "Unable to export. Private key could not be located and exported";
640 break;
641 case SEC_ERROR_PKCS12_UNABLE_TO_WRITE:
642 cp = "Unable to export. Unable to write the export file";
643 break;
644 case SEC_ERROR_PKCS12_UNABLE_TO_READ:
645 cp = "Unable to import. Unable to read the import file";
646 break;
647 case SEC_ERROR_PKCS12_KEY_DATABASE_NOT_INITIALIZED:
648 cp = "Unable to export. Key database corrupt or deleted";
649 break;
650 case SEC_ERROR_KEYGEN_FAIL:
651 cp = "Unable to generate public-private key pair";
652 break;
653 case SEC_ERROR_INVALID_PASSWORD:
654 cp = "Password entered is invalid";
655 break;
656 case SEC_ERROR_RETRY_OLD_PASSWORD:
657 cp = "Old password entered incorrectly";
658 break;
659 case SEC_ERROR_BAD_NICKNAME:
660 cp = "Certificate nickname already in use";
661 break;
662 case SEC_ERROR_NOT_FORTEZZA_ISSUER:
663 cp = "Peer FORTEZZA chain has a non-FORTEZZA Certificate";
664 break;
665 case SEC_ERROR_CANNOT_MOVE_SENSITIVE_KEY:
666 cp = "A sensitive key cannot be moved to the slot where it is needed";
667 break;
668 case SEC_ERROR_JS_INVALID_MODULE_NAME:
669 cp = "Invalid module name";
670 break;
671 case SEC_ERROR_JS_INVALID_DLL:
672 cp = "Invalid module path/filename";
673 break;
674 case SEC_ERROR_JS_ADD_MOD_FAILURE:
675 cp = "Unable to add module";
676 break;
677 case SEC_ERROR_JS_DEL_MOD_FAILURE:
678 cp = "Unable to delete module";
679 break;
680 case SEC_ERROR_OLD_KRL:
681 cp = "New KRL is not later than the current one";
682 break;
683 case SEC_ERROR_CKL_CONFLICT:
684 cp = "New CKL has different issuer than current CKL";
685 break;
686 case SEC_ERROR_CERT_NOT_IN_NAME_SPACE:
687 cp = "Certificate issuer is not permitted to issue a certificate with";
688 break;
689 case SEC_ERROR_KRL_NOT_YET_VALID:
690 cp = "The key revocation list for this certificate is not yet valid";
691 break;
692 case SEC_ERROR_CRL_NOT_YET_VALID:
693 cp = "The certificate revocation list for this certificate is not yet valid";
694 break;
695 case SEC_ERROR_UNKNOWN_CERT:
696 cp = "The requested certificate could not be found";
697 break;
698 case SEC_ERROR_UNKNOWN_SIGNER:
699 cp = "The signer's certificate could not be found";
700 break;
701 case SEC_ERROR_CERT_BAD_ACCESS_LOCATION:
702 cp = "The location for the certificate status server has invalid format";
703 break;
704 case SEC_ERROR_OCSP_UNKNOWN_RESPONSE_TYPE:
705 cp = "The OCSP response cannot be fully decoded; it is of an unknown type";
706 break;
707 case SEC_ERROR_OCSP_BAD_HTTP_RESPONSE:
708 cp = "The OCSP server returned unexpected/invalid HTTP data";
709 break;
710 case SEC_ERROR_OCSP_MALFORMED_REQUEST:
711 cp = "The OCSP server found the request to be corrupted or improperly formed";
712 break;
713 case SEC_ERROR_OCSP_SERVER_ERROR:
714 cp = "The OCSP server experienced an internal error";
715 break;
716 case SEC_ERROR_OCSP_TRY_SERVER_LATER:
717 cp = "The OCSP server suggests trying again later";
718 break;
719 case SEC_ERROR_OCSP_REQUEST_NEEDS_SIG:
720 cp = "The OCSP server requires a signature on this request";
721 break;
722 case SEC_ERROR_OCSP_UNAUTHORIZED_REQUEST:
723 cp = "The OCSP server has refused this request as unauthorized";
724 break;
725 case SEC_ERROR_OCSP_UNKNOWN_RESPONSE_STATUS:
726 cp = "The OCSP server returned an unrecognizable status";
727 break;
728 case SEC_ERROR_OCSP_UNKNOWN_CERT:
729 cp = "The OCSP server has no status for the certificate";
730 break;
731 case SEC_ERROR_OCSP_NOT_ENABLED:
732 cp = "You must enable OCSP before performing this operation";
733 break;
734 case SEC_ERROR_OCSP_NO_DEFAULT_RESPONDER:
735 cp = "You must set the OCSP default responder before performing this operation";
736 break;
737 case SEC_ERROR_OCSP_MALFORMED_RESPONSE:
738 cp = "The response from the OCSP server was corrupted or improperly formed";
739 break;
740 case SEC_ERROR_OCSP_UNAUTHORIZED_RESPONSE:
741 cp = "The signer of the OCSP response is not authorized to give status for this certificate";
742 break;
743 case SEC_ERROR_OCSP_FUTURE_RESPONSE:
744 cp = "The OCSP response is not yet valid (contains a date in the future)";
745 break;
746 case SEC_ERROR_OCSP_OLD_RESPONSE:
747 cp = "The OCSP response contains out-of-date information";
748 break;
749 case SEC_ERROR_DIGEST_NOT_FOUND:
750 cp = "The CMS or PKCS #7 Digest was not found in signed message";
751 break;
752 case SEC_ERROR_UNSUPPORTED_MESSAGE_TYPE:
753 cp = "The CMS or PKCS #7 Message type is unsupported";
754 break;
755 case SEC_ERROR_MODULE_STUCK:
756 cp = "PKCS #11 module could not be removed because it is still in use";
757 break;
758 case SEC_ERROR_BAD_TEMPLATE:
759 cp = "Could not decode ASN.1 data. Specified template was invalid";
760 break;
761 case SEC_ERROR_CRL_NOT_FOUND:
762 cp = "No matching CRL was found";
763 break;
764 case SEC_ERROR_REUSED_ISSUER_AND_SERIAL:
765 cp = "You are attempting to import a cert with the same issuer/serial as an existing cert, but that is not the same cert";
766 break;
767 case SEC_ERROR_BUSY:
768 cp = "NSS could not shutdown. Objects are still in use";
769 break;
770 case SEC_ERROR_EXTRA_INPUT:
771 cp = "DER-encoded message contained extra usused data";
772 break;
773 case SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE:
774 cp = "Unsupported elliptic curve";
775 break;
776 case SEC_ERROR_UNSUPPORTED_EC_POINT_FORM:
777 cp = "Unsupported elliptic curve point form";
778 break;
779 case SEC_ERROR_UNRECOGNIZED_OID:
780 cp = "Unrecognized Object IDentifier";
781 break;
782 case SEC_ERROR_OCSP_INVALID_SIGNING_CERT:
783 cp = "Invalid OCSP signing certificate in OCSP response";
784 break;
785 #ifdef notdef
786 case SEC_ERROR_REVOKED_CERTIFICATE_CRL:
787 cp = "Certificate is revoked in issuer's certificate revocation list";
788 break;
789 case SEC_ERROR_REVOKED_CERTIFICATE_OCSP:
790 cp = "Issuer's OCSP responder reports certificate is revoked";
791 break;
792 case SEC_ERROR_CRL_INVALID_VERSION:
793 cp = "Issuer's Certificate Revocation List has an unknown version number";
794 break;
795 case SEC_ERROR_CRL_V1_CRITICAL_EXTENSION:
796 cp = "Issuer's V1 Certificate Revocation List has a critical extension";
797 break;
798 case SEC_ERROR_CRL_UNKNOWN_CRITICAL_EXTENSION:
799 cp = "Issuer's V2 Certificate Revocation List has an unknown critical extension";
800 break;
801 #endif /* notdef */
803 return cp;