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 49ER3(SSL_ERROR_EXPORT_ONLY_SERVER, SSL_ERROR_BASE + 0, 50dgettext(TEXT_DOMAIN, 51"Unable to communicate securely. Peer does not support high-grade encryption.")) 52 53ER3(SSL_ERROR_US_ONLY_SERVER, SSL_ERROR_BASE + 1, 54dgettext(TEXT_DOMAIN, 55"Unable to communicate securely. Peer requires high-grade encryption which is not supported.")) 56 57ER3(SSL_ERROR_NO_CYPHER_OVERLAP, SSL_ERROR_BASE + 2, 58dgettext(TEXT_DOMAIN, 59"Cannot communicate securely with peer: no common encryption algorithm(s).")) 60 61ER3(SSL_ERROR_NO_CERTIFICATE, SSL_ERROR_BASE + 3, 62dgettext(TEXT_DOMAIN, 63"Unable to find the certificate or key necessary for authentication.")) 64 65ER3(SSL_ERROR_BAD_CERTIFICATE, SSL_ERROR_BASE + 4, 66dgettext(TEXT_DOMAIN, 67"Unable to communicate securely with peer: peers's certificate was rejected.")) 68 69/* unused (SSL_ERROR_BASE + 5),*/ 70 71ER3(SSL_ERROR_BAD_CLIENT, SSL_ERROR_BASE + 6, 72dgettext(TEXT_DOMAIN, 73"The server has encountered bad data from the client.")) 74 75ER3(SSL_ERROR_BAD_SERVER, SSL_ERROR_BASE + 7, 76dgettext(TEXT_DOMAIN, 77"The client has encountered bad data from the server.")) 78 79ER3(SSL_ERROR_UNSUPPORTED_CERTIFICATE_TYPE, SSL_ERROR_BASE + 8, 80dgettext(TEXT_DOMAIN, 81"Unsupported certificate type.")) 82 83ER3(SSL_ERROR_UNSUPPORTED_VERSION, SSL_ERROR_BASE + 9, 84dgettext(TEXT_DOMAIN, 85"Peer using unsupported version of security protocol.")) 86 87/* unused (SSL_ERROR_BASE + 10),*/ 88 89ER3(SSL_ERROR_WRONG_CERTIFICATE, SSL_ERROR_BASE + 11, 90dgettext(TEXT_DOMAIN, 91"Client authentication failed: private key in key database does not match public key in certificate database.")) 92 93ER3(SSL_ERROR_BAD_CERT_DOMAIN, SSL_ERROR_BASE + 12, 94dgettext(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 101ER3(SSL_ERROR_SSL2_DISABLED, (SSL_ERROR_BASE + 14), 102dgettext(TEXT_DOMAIN, 103"Peer only supports SSL version 2, which is locally disabled.")) 104 105 106ER3(SSL_ERROR_BAD_MAC_READ, (SSL_ERROR_BASE + 15), 107dgettext(TEXT_DOMAIN, 108"SSL received a record with an incorrect Message Authentication Code.")) 109 110ER3(SSL_ERROR_BAD_MAC_ALERT, (SSL_ERROR_BASE + 16), 111dgettext(TEXT_DOMAIN, 112"SSL peer reports incorrect Message Authentication Code.")) 113 114ER3(SSL_ERROR_BAD_CERT_ALERT, (SSL_ERROR_BASE + 17), 115dgettext(TEXT_DOMAIN, 116"SSL peer cannot verify your certificate.")) 117 118ER3(SSL_ERROR_REVOKED_CERT_ALERT, (SSL_ERROR_BASE + 18), 119dgettext(TEXT_DOMAIN, 120"SSL peer rejected your certificate as revoked.")) 121 122ER3(SSL_ERROR_EXPIRED_CERT_ALERT, (SSL_ERROR_BASE + 19), 123dgettext(TEXT_DOMAIN, 124"SSL peer rejected your certificate as expired.")) 125 126ER3(SSL_ERROR_SSL_DISABLED, (SSL_ERROR_BASE + 20), 127dgettext(TEXT_DOMAIN, 128"Cannot connect: SSL is disabled.")) 129 130ER3(SSL_ERROR_FORTEZZA_PQG, (SSL_ERROR_BASE + 21), 131dgettext(TEXT_DOMAIN, 132"Cannot connect: SSL peer is in another FORTEZZA domain.")) 133 134ER3(SSL_ERROR_UNKNOWN_CIPHER_SUITE , (SSL_ERROR_BASE + 22), 135dgettext(TEXT_DOMAIN, 136"An unknown SSL cipher suite has been requested.")) 137 138ER3(SSL_ERROR_NO_CIPHERS_SUPPORTED , (SSL_ERROR_BASE + 23), 139dgettext(TEXT_DOMAIN, 140"No cipher suites are present and enabled in this program.")) 141 142ER3(SSL_ERROR_BAD_BLOCK_PADDING , (SSL_ERROR_BASE + 24), 143dgettext(TEXT_DOMAIN, 144"SSL received a record with bad block padding.")) 145 146ER3(SSL_ERROR_RX_RECORD_TOO_LONG , (SSL_ERROR_BASE + 25), 147dgettext(TEXT_DOMAIN, 148"SSL received a record that exceeded the maximum permissible length.")) 149 150ER3(SSL_ERROR_TX_RECORD_TOO_LONG , (SSL_ERROR_BASE + 26), 151dgettext(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 */ 157ER3(SSL_ERROR_RX_MALFORMED_HELLO_REQUEST , (SSL_ERROR_BASE + 27), 158dgettext(TEXT_DOMAIN, 159"SSL received a malformed Hello Request handshake message.")) 160 161ER3(SSL_ERROR_RX_MALFORMED_CLIENT_HELLO , (SSL_ERROR_BASE + 28), 162dgettext(TEXT_DOMAIN, 163"SSL received a malformed Client Hello handshake message.")) 164 165ER3(SSL_ERROR_RX_MALFORMED_SERVER_HELLO , (SSL_ERROR_BASE + 29), 166dgettext(TEXT_DOMAIN, 167"SSL received a malformed Server Hello handshake message.")) 168 169ER3(SSL_ERROR_RX_MALFORMED_CERTIFICATE , (SSL_ERROR_BASE + 30), 170dgettext(TEXT_DOMAIN, 171"SSL received a malformed Certificate handshake message.")) 172 173ER3(SSL_ERROR_RX_MALFORMED_SERVER_KEY_EXCH , (SSL_ERROR_BASE + 31), 174dgettext(TEXT_DOMAIN, 175"SSL received a malformed Server Key Exchange handshake message.")) 176 177ER3(SSL_ERROR_RX_MALFORMED_CERT_REQUEST , (SSL_ERROR_BASE + 32), 178dgettext(TEXT_DOMAIN, 179"SSL received a malformed Certificate Request handshake message.")) 180 181ER3(SSL_ERROR_RX_MALFORMED_HELLO_DONE , (SSL_ERROR_BASE + 33), 182dgettext(TEXT_DOMAIN, 183"SSL received a malformed Server Hello Done handshake message.")) 184 185ER3(SSL_ERROR_RX_MALFORMED_CERT_VERIFY , (SSL_ERROR_BASE + 34), 186dgettext(TEXT_DOMAIN, 187"SSL received a malformed Certificate Verify handshake message.")) 188 189ER3(SSL_ERROR_RX_MALFORMED_CLIENT_KEY_EXCH , (SSL_ERROR_BASE + 35), 190dgettext(TEXT_DOMAIN, 191"SSL received a malformed Client Key Exchange handshake message.")) 192 193ER3(SSL_ERROR_RX_MALFORMED_FINISHED , (SSL_ERROR_BASE + 36), 194dgettext(TEXT_DOMAIN, 195"SSL received a malformed Finished handshake message.")) 196 197/* 198 * Received a malformed (too long or short) SSL record. 199 */ 200ER3(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER , (SSL_ERROR_BASE + 37), 201dgettext(TEXT_DOMAIN, 202"SSL received a malformed Change Cipher Spec record.")) 203 204ER3(SSL_ERROR_RX_MALFORMED_ALERT , (SSL_ERROR_BASE + 38), 205dgettext(TEXT_DOMAIN, 206"SSL received a malformed Alert record.")) 207 208ER3(SSL_ERROR_RX_MALFORMED_HANDSHAKE , (SSL_ERROR_BASE + 39), 209dgettext(TEXT_DOMAIN, 210"SSL received a malformed Handshake record.")) 211 212ER3(SSL_ERROR_RX_MALFORMED_APPLICATION_DATA , (SSL_ERROR_BASE + 40), 213dgettext(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 */ 220ER3(SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST , (SSL_ERROR_BASE + 41), 221dgettext(TEXT_DOMAIN, 222"SSL received an unexpected Hello Request handshake message.")) 223 224ER3(SSL_ERROR_RX_UNEXPECTED_CLIENT_HELLO , (SSL_ERROR_BASE + 42), 225dgettext(TEXT_DOMAIN, 226"SSL received an unexpected Client Hello handshake message.")) 227 228ER3(SSL_ERROR_RX_UNEXPECTED_SERVER_HELLO , (SSL_ERROR_BASE + 43), 229dgettext(TEXT_DOMAIN, 230"SSL received an unexpected Server Hello handshake message.")) 231 232ER3(SSL_ERROR_RX_UNEXPECTED_CERTIFICATE , (SSL_ERROR_BASE + 44), 233dgettext(TEXT_DOMAIN, 234"SSL received an unexpected Certificate handshake message.")) 235 236ER3(SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH , (SSL_ERROR_BASE + 45), 237dgettext(TEXT_DOMAIN, 238"SSL received an unexpected Server Key Exchange handshake message.")) 239 240ER3(SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST , (SSL_ERROR_BASE + 46), 241dgettext(TEXT_DOMAIN, 242"SSL received an unexpected Certificate Request handshake message.")) 243 244ER3(SSL_ERROR_RX_UNEXPECTED_HELLO_DONE , (SSL_ERROR_BASE + 47), 245dgettext(TEXT_DOMAIN, 246"SSL received an unexpected Server Hello Done handshake message.")) 247 248ER3(SSL_ERROR_RX_UNEXPECTED_CERT_VERIFY , (SSL_ERROR_BASE + 48), 249dgettext(TEXT_DOMAIN, 250"SSL received an unexpected Certificate Verify handshake message.")) 251 252ER3(SSL_ERROR_RX_UNEXPECTED_CLIENT_KEY_EXCH , (SSL_ERROR_BASE + 49), 253dgettext(TEXT_DOMAIN, 254"SSL received an unexpected Cllient Key Exchange handshake message.")) 255 256ER3(SSL_ERROR_RX_UNEXPECTED_FINISHED , (SSL_ERROR_BASE + 50), 257dgettext(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 */ 263ER3(SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER , (SSL_ERROR_BASE + 51), 264dgettext(TEXT_DOMAIN, 265"SSL received an unexpected Change Cipher Spec record.")) 266 267ER3(SSL_ERROR_RX_UNEXPECTED_ALERT , (SSL_ERROR_BASE + 52), 268dgettext(TEXT_DOMAIN, 269"SSL received an unexpected Alert record.")) 270 271ER3(SSL_ERROR_RX_UNEXPECTED_HANDSHAKE , (SSL_ERROR_BASE + 53), 272dgettext(TEXT_DOMAIN, 273"SSL received an unexpected Handshake record.")) 274 275ER3(SSL_ERROR_RX_UNEXPECTED_APPLICATION_DATA, (SSL_ERROR_BASE + 54), 276dgettext(TEXT_DOMAIN, 277"SSL received an unexpected Application Data record.")) 278 279/* 280 * Received record/message with unknown discriminant. 281 */ 282ER3(SSL_ERROR_RX_UNKNOWN_RECORD_TYPE , (SSL_ERROR_BASE + 55), 283dgettext(TEXT_DOMAIN, 284"SSL received a record with an unknown content type.")) 285 286ER3(SSL_ERROR_RX_UNKNOWN_HANDSHAKE , (SSL_ERROR_BASE + 56), 287dgettext(TEXT_DOMAIN, 288"SSL received a handshake message with an unknown message type.")) 289 290ER3(SSL_ERROR_RX_UNKNOWN_ALERT , (SSL_ERROR_BASE + 57), 291dgettext(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 */ 297ER3(SSL_ERROR_CLOSE_NOTIFY_ALERT , (SSL_ERROR_BASE + 58), 298dgettext(TEXT_DOMAIN, 299"SSL peer has closed this connection.")) 300 301ER3(SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT , (SSL_ERROR_BASE + 59), 302dgettext(TEXT_DOMAIN, 303"SSL peer was not expecting a handshake message it received.")) 304 305ER3(SSL_ERROR_DECOMPRESSION_FAILURE_ALERT , (SSL_ERROR_BASE + 60), 306dgettext(TEXT_DOMAIN, 307"SSL peer was unable to succesfully decompress an SSL record it received.")) 308 309ER3(SSL_ERROR_HANDSHAKE_FAILURE_ALERT , (SSL_ERROR_BASE + 61), 310dgettext(TEXT_DOMAIN, 311"SSL peer was unable to negotiate an acceptable set of security parameters.")) 312 313ER3(SSL_ERROR_ILLEGAL_PARAMETER_ALERT , (SSL_ERROR_BASE + 62), 314dgettext(TEXT_DOMAIN, 315"SSL peer rejected a handshake message for unacceptable content.")) 316 317ER3(SSL_ERROR_UNSUPPORTED_CERT_ALERT , (SSL_ERROR_BASE + 63), 318dgettext(TEXT_DOMAIN, 319"SSL peer does not support certificates of the type it received.")) 320 321ER3(SSL_ERROR_CERTIFICATE_UNKNOWN_ALERT , (SSL_ERROR_BASE + 64), 322dgettext(TEXT_DOMAIN, 323"SSL peer had some unspecified issue with the certificate it received.")) 324 325ER3(SSL_ERROR_GENERATE_RANDOM_FAILURE , (SSL_ERROR_BASE + 65), 326dgettext(TEXT_DOMAIN, 327"SSL experienced a failure of its random number generator.")) 328 329ER3(SSL_ERROR_SIGN_HASHES_FAILURE , (SSL_ERROR_BASE + 66), 330dgettext(TEXT_DOMAIN, 331"Unable to digitally sign data required to verify your certificate.")) 332 333ER3(SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE , (SSL_ERROR_BASE + 67), 334dgettext(TEXT_DOMAIN, 335"SSL was unable to extract the public key from the peer's certificate.")) 336 337ER3(SSL_ERROR_SERVER_KEY_EXCHANGE_FAILURE , (SSL_ERROR_BASE + 68), 338dgettext(TEXT_DOMAIN, 339"Unspecified failure while processing SSL Server Key Exchange handshake.")) 340 341ER3(SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE , (SSL_ERROR_BASE + 69), 342dgettext(TEXT_DOMAIN, 343"Unspecified failure while processing SSL Client Key Exchange handshake.")) 344 345ER3(SSL_ERROR_ENCRYPTION_FAILURE , (SSL_ERROR_BASE + 70), 346dgettext(TEXT_DOMAIN, 347"Bulk data encryption algorithm failed in selected cipher suite.")) 348 349ER3(SSL_ERROR_DECRYPTION_FAILURE , (SSL_ERROR_BASE + 71), 350dgettext(TEXT_DOMAIN, 351"Bulk data decryption algorithm failed in selected cipher suite.")) 352 353ER3(SSL_ERROR_SOCKET_WRITE_FAILURE , (SSL_ERROR_BASE + 72), 354dgettext(TEXT_DOMAIN, 355"Attempt to write encrypted data to underlying socket failed.")) 356 357ER3(SSL_ERROR_MD5_DIGEST_FAILURE , (SSL_ERROR_BASE + 73), 358dgettext(TEXT_DOMAIN, 359"MD5 digest function failed.")) 360 361ER3(SSL_ERROR_SHA_DIGEST_FAILURE , (SSL_ERROR_BASE + 74), 362dgettext(TEXT_DOMAIN, 363"SHA-1 digest function failed.")) 364 365ER3(SSL_ERROR_MAC_COMPUTATION_FAILURE , (SSL_ERROR_BASE + 75), 366dgettext(TEXT_DOMAIN, 367"MAC computation failed.")) 368 369ER3(SSL_ERROR_SYM_KEY_CONTEXT_FAILURE , (SSL_ERROR_BASE + 76), 370dgettext(TEXT_DOMAIN, 371"Failure to create Symmetric Key context.")) 372 373ER3(SSL_ERROR_SYM_KEY_UNWRAP_FAILURE , (SSL_ERROR_BASE + 77), 374dgettext(TEXT_DOMAIN, 375"Failure to unwrap the Symmetric key in Client Key Exchange message.")) 376 377ER3(SSL_ERROR_PUB_KEY_SIZE_LIMIT_EXCEEDED , (SSL_ERROR_BASE + 78), 378dgettext(TEXT_DOMAIN, 379"SSL Server attempted to use domestic-grade public key with export cipher suite.")) 380 381ER3(SSL_ERROR_IV_PARAM_FAILURE , (SSL_ERROR_BASE + 79), 382dgettext(TEXT_DOMAIN, 383"PKCS11 code failed to translate an IV into a param.")) 384 385ER3(SSL_ERROR_INIT_CIPHER_SUITE_FAILURE , (SSL_ERROR_BASE + 80), 386dgettext(TEXT_DOMAIN, 387"Failed to initialize the selected cipher suite.")) 388 389ER3(SSL_ERROR_SESSION_KEY_GEN_FAILURE , (SSL_ERROR_BASE + 81), 390dgettext(TEXT_DOMAIN, 391"Client failed to generate session keys for SSL session.")) 392 393ER3(SSL_ERROR_NO_SERVER_KEY_FOR_ALG , (SSL_ERROR_BASE + 82), 394dgettext(TEXT_DOMAIN, 395"Server has no key for the attempted key exchange algorithm.")) 396 397ER3(SSL_ERROR_TOKEN_INSERTION_REMOVAL , (SSL_ERROR_BASE + 83), 398dgettext(TEXT_DOMAIN, 399"PKCS#11 token was inserted or removed while operation was in progress.")) 400 401ER3(SSL_ERROR_TOKEN_SLOT_NOT_FOUND , (SSL_ERROR_BASE + 84), 402dgettext(TEXT_DOMAIN, 403"No PKCS#11 token could be found to do a required operation.")) 404 405ER3(SSL_ERROR_NO_COMPRESSION_OVERLAP , (SSL_ERROR_BASE + 85), 406dgettext(TEXT_DOMAIN, 407"Cannot communicate securely with peer: no common compression algorithm(s).")) 408 409ER3(SSL_ERROR_HANDSHAKE_NOT_COMPLETED , (SSL_ERROR_BASE + 86), 410dgettext(TEXT_DOMAIN, 411"Cannot initiate another SSL handshake until current handshake is complete.")) 412 413ER3(SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE , (SSL_ERROR_BASE + 87), 414dgettext(TEXT_DOMAIN, 415"Received incorrect handshakes hash values from peer.")) 416 417ER3(SSL_ERROR_CERT_KEA_MISMATCH , (SSL_ERROR_BASE + 88), 418dgettext(TEXT_DOMAIN, 419"The certificate provided cannot be used with the selected key exchange algorithm.")) 420