LCOV - app.info - security/manager/ssl/src/nsNSSErrors.cpp

LCOV - code coverage report
| Current view: | directory - security/manager/ssl/src - nsNSSErrors.cpp (source / functions) |  | Found | Hit | Coverage |
| Test: | app.info | Lines: | 326 | 0 | 0.0 %
| Date: | 2012-04-21 | Functions: | 3 | 0 | 0.0 %

           1                 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
           2                 :  *
           3                 :  * ***** BEGIN LICENSE BLOCK *****
           4                 :  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
           5                 :  *
           6                 :  * The contents of this file are subject to the Mozilla Public License Version
           7                 :  * 1.1 (the "License"); you may not use this file except in compliance with
           8                 :  * the License. You may obtain a copy of the License at
           9                 :  * http://www.mozilla.org/MPL/
          10                 :  *
          11                 :  * Software distributed under the License is distributed on an "AS IS" basis,
          12                 :  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
          13                 :  * for the specific language governing rights and limitations under the
          14                 :  * License.
          15                 :  *
          16                 :  * The Original Code is mozilla.org code.
          17                 :  *
          18                 :  * The Initial Developer of the Original Code is
          19                 :  * Red Hat, Inc.
          20                 :  * Portions created by the Initial Developer are Copyright (C) 2007
          21                 :  * the Initial Developer. All Rights Reserved.
          22                 :  *
          23                 :  * Contributor(s):
          24                 :  *   Kai Engert <kengert@redhat.com>
          25                 :  *
          26                 :  * Alternatively, the contents of this file may be used under the terms of
          27                 :  * either the GNU General Public License Version 2 or later (the "GPL"), or
          28                 :  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
          29                 :  * in which case the provisions of the GPL or the LGPL are applicable instead
          30                 :  * of those above. If you wish to allow use of your version of this file only
          31                 :  * under the terms of either the GPL or the LGPL, and not to allow others to
          32                 :  * use your version of this file under the terms of the MPL, indicate your
          33                 :  * decision by deleting the provisions above and replace them with the notice
          34                 :  * and other provisions required by the GPL or the LGPL. If you do not delete
          35                 :  * the provisions above, a recipient may use your version of this file under
          36                 :  * the terms of any one of the MPL, the GPL or the LGPL.
          37                 :  *
          38                 :  * ***** END LICENSE BLOCK ***** */
          39                 :
          40                 : #include "nsNSSComponent.h"
          41                 : #include "secerr.h"
          42                 : #include "sslerr.h"
          43                 :
          44                 : const char *
          45               0 : nsNSSErrors::getDefaultErrorStringName(PRInt32 err)
          46                 : {
          47               0 :   const char *id_str = nsnull;
          48                 :
          49               0 :   switch (err)
          50                 :   {
          51               0 :     case SSL_ERROR_EXPORT_ONLY_SERVER: id_str = "SSL_ERROR_EXPORT_ONLY_SERVER"; break;
          52               0 :     case SSL_ERROR_US_ONLY_SERVER: id_str = "SSL_ERROR_US_ONLY_SERVER"; break;
          53               0 :     case SSL_ERROR_NO_CYPHER_OVERLAP: id_str = "SSL_ERROR_NO_CYPHER_OVERLAP"; break;
          54               0 :     case SSL_ERROR_NO_CERTIFICATE: id_str = "SSL_ERROR_NO_CERTIFICATE"; break;
          55               0 :     case SSL_ERROR_BAD_CERTIFICATE: id_str = "SSL_ERROR_BAD_CERTIFICATE"; break;
          56               0 :     case SSL_ERROR_BAD_CLIENT: id_str = "SSL_ERROR_BAD_CLIENT"; break;
          57               0 :     case SSL_ERROR_BAD_SERVER: id_str = "SSL_ERROR_BAD_SERVER"; break;
          58               0 :     case SSL_ERROR_UNSUPPORTED_CERTIFICATE_TYPE: id_str = "SSL_ERROR_UNSUPPORTED_CERTIFICATE_TYPE"; break;
          59               0 :     case SSL_ERROR_UNSUPPORTED_VERSION: id_str = "SSL_ERROR_UNSUPPORTED_VERSION"; break;
          60               0 :     case SSL_ERROR_WRONG_CERTIFICATE: id_str = "SSL_ERROR_WRONG_CERTIFICATE"; break;
          61               0 :     case SSL_ERROR_BAD_CERT_DOMAIN: id_str = "SSL_ERROR_BAD_CERT_DOMAIN"; break;
          62               0 :     case SSL_ERROR_SSL2_DISABLED: id_str = "SSL_ERROR_SSL2_DISABLED"; break;
          63               0 :     case SSL_ERROR_BAD_MAC_READ: id_str = "SSL_ERROR_BAD_MAC_READ"; break;
          64               0 :     case SSL_ERROR_BAD_MAC_ALERT: id_str = "SSL_ERROR_BAD_MAC_ALERT"; break;
          65               0 :     case SSL_ERROR_BAD_CERT_ALERT: id_str = "SSL_ERROR_BAD_CERT_ALERT"; break;
          66               0 :     case SSL_ERROR_REVOKED_CERT_ALERT: id_str = "SSL_ERROR_REVOKED_CERT_ALERT"; break;
          67               0 :     case SSL_ERROR_EXPIRED_CERT_ALERT: id_str = "SSL_ERROR_EXPIRED_CERT_ALERT"; break;
          68               0 :     case SSL_ERROR_SSL_DISABLED: id_str = "SSL_ERROR_SSL_DISABLED"; break;
          69               0 :     case SSL_ERROR_FORTEZZA_PQG: id_str = "SSL_ERROR_FORTEZZA_PQG"; break;
          70               0 :     case SSL_ERROR_UNKNOWN_CIPHER_SUITE: id_str = "SSL_ERROR_UNKNOWN_CIPHER_SUITE"; break;
          71               0 :     case SSL_ERROR_NO_CIPHERS_SUPPORTED: id_str = "SSL_ERROR_NO_CIPHERS_SUPPORTED"; break;
          72               0 :     case SSL_ERROR_BAD_BLOCK_PADDING: id_str = "SSL_ERROR_BAD_BLOCK_PADDING"; break;
          73               0 :     case SSL_ERROR_RX_RECORD_TOO_LONG: id_str = "SSL_ERROR_RX_RECORD_TOO_LONG"; break;
          74               0 :     case SSL_ERROR_TX_RECORD_TOO_LONG: id_str = "SSL_ERROR_TX_RECORD_TOO_LONG"; break;
          75               0 :     case SSL_ERROR_RX_MALFORMED_HELLO_REQUEST: id_str = "SSL_ERROR_RX_MALFORMED_HELLO_REQUEST"; break;
          76               0 :     case SSL_ERROR_RX_MALFORMED_CLIENT_HELLO: id_str = "SSL_ERROR_RX_MALFORMED_CLIENT_HELLO"; break;
          77               0 :     case SSL_ERROR_RX_MALFORMED_SERVER_HELLO: id_str = "SSL_ERROR_RX_MALFORMED_SERVER_HELLO"; break;
          78               0 :     case SSL_ERROR_RX_MALFORMED_CERTIFICATE: id_str = "SSL_ERROR_RX_MALFORMED_CERTIFICATE"; break;
          79               0 :     case SSL_ERROR_RX_MALFORMED_SERVER_KEY_EXCH: id_str = "SSL_ERROR_RX_MALFORMED_SERVER_KEY_EXCH"; break;
          80               0 :     case SSL_ERROR_RX_MALFORMED_CERT_REQUEST: id_str = "SSL_ERROR_RX_MALFORMED_CERT_REQUEST"; break;
          81               0 :     case SSL_ERROR_RX_MALFORMED_HELLO_DONE: id_str = "SSL_ERROR_RX_MALFORMED_HELLO_DONE"; break;
          82               0 :     case SSL_ERROR_RX_MALFORMED_CERT_VERIFY: id_str = "SSL_ERROR_RX_MALFORMED_CERT_VERIFY"; break;
          83               0 :     case SSL_ERROR_RX_MALFORMED_CLIENT_KEY_EXCH: id_str = "SSL_ERROR_RX_MALFORMED_CLIENT_KEY_EXCH"; break;
          84               0 :     case SSL_ERROR_RX_MALFORMED_FINISHED: id_str = "SSL_ERROR_RX_MALFORMED_FINISHED"; break;
          85               0 :     case SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER: id_str = "SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER"; break;
          86               0 :     case SSL_ERROR_RX_MALFORMED_ALERT: id_str = "SSL_ERROR_RX_MALFORMED_ALERT"; break;
          87               0 :     case SSL_ERROR_RX_MALFORMED_HANDSHAKE: id_str = "SSL_ERROR_RX_MALFORMED_HANDSHAKE"; break;
          88               0 :     case SSL_ERROR_RX_MALFORMED_APPLICATION_DATA: id_str = "SSL_ERROR_RX_MALFORMED_APPLICATION_DATA"; break;
          89               0 :     case SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST: id_str = "SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST"; break;
          90               0 :     case SSL_ERROR_RX_UNEXPECTED_CLIENT_HELLO: id_str = "SSL_ERROR_RX_UNEXPECTED_CLIENT_HELLO"; break;
          91               0 :     case SSL_ERROR_RX_UNEXPECTED_SERVER_HELLO: id_str = "SSL_ERROR_RX_UNEXPECTED_SERVER_HELLO"; break;
          92               0 :     case SSL_ERROR_RX_UNEXPECTED_CERTIFICATE: id_str = "SSL_ERROR_RX_UNEXPECTED_CERTIFICATE"; break;
          93               0 :     case SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH: id_str = "SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH"; break;
          94               0 :     case SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST: id_str = "SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST"; break;
          95               0 :     case SSL_ERROR_RX_UNEXPECTED_HELLO_DONE: id_str = "SSL_ERROR_RX_UNEXPECTED_HELLO_DONE"; break;
          96               0 :     case SSL_ERROR_RX_UNEXPECTED_CERT_VERIFY: id_str = "SSL_ERROR_RX_UNEXPECTED_CERT_VERIFY"; break;
          97               0 :     case SSL_ERROR_RX_UNEXPECTED_CLIENT_KEY_EXCH: id_str = "SSL_ERROR_RX_UNEXPECTED_CLIENT_KEY_EXCH"; break;
          98               0 :     case SSL_ERROR_RX_UNEXPECTED_FINISHED: id_str = "SSL_ERROR_RX_UNEXPECTED_FINISHED"; break;
          99               0 :     case SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER: id_str = "SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER"; break;
         100               0 :     case SSL_ERROR_RX_UNEXPECTED_ALERT: id_str = "SSL_ERROR_RX_UNEXPECTED_ALERT"; break;
         101               0 :     case SSL_ERROR_RX_UNEXPECTED_HANDSHAKE: id_str = "SSL_ERROR_RX_UNEXPECTED_HANDSHAKE"; break;
         102               0 :     case SSL_ERROR_RX_UNEXPECTED_APPLICATION_DATA: id_str = "SSL_ERROR_RX_UNEXPECTED_APPLICATION_DATA"; break;
         103               0 :     case SSL_ERROR_RX_UNKNOWN_RECORD_TYPE: id_str = "SSL_ERROR_RX_UNKNOWN_RECORD_TYPE"; break;
         104               0 :     case SSL_ERROR_RX_UNKNOWN_HANDSHAKE: id_str = "SSL_ERROR_RX_UNKNOWN_HANDSHAKE"; break;
         105               0 :     case SSL_ERROR_RX_UNKNOWN_ALERT: id_str = "SSL_ERROR_RX_UNKNOWN_ALERT"; break;
         106               0 :     case SSL_ERROR_CLOSE_NOTIFY_ALERT: id_str = "SSL_ERROR_CLOSE_NOTIFY_ALERT"; break;
         107               0 :     case SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT: id_str = "SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT"; break;
         108               0 :     case SSL_ERROR_DECOMPRESSION_FAILURE_ALERT: id_str = "SSL_ERROR_DECOMPRESSION_FAILURE_ALERT"; break;
         109               0 :     case SSL_ERROR_HANDSHAKE_FAILURE_ALERT: id_str = "SSL_ERROR_HANDSHAKE_FAILURE_ALERT"; break;
         110               0 :     case SSL_ERROR_ILLEGAL_PARAMETER_ALERT: id_str = "SSL_ERROR_ILLEGAL_PARAMETER_ALERT"; break;
         111               0 :     case SSL_ERROR_UNSUPPORTED_CERT_ALERT: id_str = "SSL_ERROR_UNSUPPORTED_CERT_ALERT"; break;
         112               0 :     case SSL_ERROR_CERTIFICATE_UNKNOWN_ALERT: id_str = "SSL_ERROR_CERTIFICATE_UNKNOWN_ALERT"; break;
         113               0 :     case SSL_ERROR_GENERATE_RANDOM_FAILURE: id_str = "SSL_ERROR_GENERATE_RANDOM_FAILURE"; break;
         114               0 :     case SSL_ERROR_SIGN_HASHES_FAILURE: id_str = "SSL_ERROR_SIGN_HASHES_FAILURE"; break;
         115               0 :     case SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE: id_str = "SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE"; break;
         116               0 :     case SSL_ERROR_SERVER_KEY_EXCHANGE_FAILURE: id_str = "SSL_ERROR_SERVER_KEY_EXCHANGE_FAILURE"; break;
         117               0 :     case SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE: id_str = "SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE"; break;
         118               0 :     case SSL_ERROR_ENCRYPTION_FAILURE: id_str = "SSL_ERROR_ENCRYPTION_FAILURE"; break;
         119               0 :     case SSL_ERROR_DECRYPTION_FAILURE: id_str = "SSL_ERROR_DECRYPTION_FAILURE"; break;
         120               0 :     case SSL_ERROR_SOCKET_WRITE_FAILURE: id_str = "SSL_ERROR_SOCKET_WRITE_FAILURE"; break;
         121               0 :     case SSL_ERROR_MD5_DIGEST_FAILURE: id_str = "SSL_ERROR_MD5_DIGEST_FAILURE"; break;
         122               0 :     case SSL_ERROR_SHA_DIGEST_FAILURE: id_str = "SSL_ERROR_SHA_DIGEST_FAILURE"; break;
         123               0 :     case SSL_ERROR_MAC_COMPUTATION_FAILURE: id_str = "SSL_ERROR_MAC_COMPUTATION_FAILURE"; break;
         124               0 :     case SSL_ERROR_SYM_KEY_CONTEXT_FAILURE: id_str = "SSL_ERROR_SYM_KEY_CONTEXT_FAILURE"; break;
         125               0 :     case SSL_ERROR_SYM_KEY_UNWRAP_FAILURE: id_str = "SSL_ERROR_SYM_KEY_UNWRAP_FAILURE"; break;
         126               0 :     case SSL_ERROR_PUB_KEY_SIZE_LIMIT_EXCEEDED: id_str = "SSL_ERROR_PUB_KEY_SIZE_LIMIT_EXCEEDED"; break;
         127               0 :     case SSL_ERROR_IV_PARAM_FAILURE: id_str = "SSL_ERROR_IV_PARAM_FAILURE"; break;
         128               0 :     case SSL_ERROR_INIT_CIPHER_SUITE_FAILURE: id_str = "SSL_ERROR_INIT_CIPHER_SUITE_FAILURE"; break;
         129               0 :     case SSL_ERROR_SESSION_KEY_GEN_FAILURE: id_str = "SSL_ERROR_SESSION_KEY_GEN_FAILURE"; break;
         130               0 :     case SSL_ERROR_NO_SERVER_KEY_FOR_ALG: id_str = "SSL_ERROR_NO_SERVER_KEY_FOR_ALG"; break;
         131               0 :     case SSL_ERROR_TOKEN_INSERTION_REMOVAL: id_str = "SSL_ERROR_TOKEN_INSERTION_REMOVAL"; break;
         132               0 :     case SSL_ERROR_TOKEN_SLOT_NOT_FOUND: id_str = "SSL_ERROR_TOKEN_SLOT_NOT_FOUND"; break;
         133               0 :     case SSL_ERROR_NO_COMPRESSION_OVERLAP: id_str = "SSL_ERROR_NO_COMPRESSION_OVERLAP"; break;
         134               0 :     case SSL_ERROR_HANDSHAKE_NOT_COMPLETED: id_str = "SSL_ERROR_HANDSHAKE_NOT_COMPLETED"; break;
         135               0 :     case SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE: id_str = "SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE"; break;
         136               0 :     case SSL_ERROR_CERT_KEA_MISMATCH: id_str = "SSL_ERROR_CERT_KEA_MISMATCH"; break;
         137               0 :     case SSL_ERROR_NO_TRUSTED_SSL_CLIENT_CA: id_str = "SSL_ERROR_NO_TRUSTED_SSL_CLIENT_CA"; break;
         138               0 :     case SSL_ERROR_SESSION_NOT_FOUND: id_str = "SSL_ERROR_SESSION_NOT_FOUND"; break;
         139               0 :     case SSL_ERROR_DECRYPTION_FAILED_ALERT: id_str = "SSL_ERROR_DECRYPTION_FAILED_ALERT"; break;
         140               0 :     case SSL_ERROR_RECORD_OVERFLOW_ALERT: id_str = "SSL_ERROR_RECORD_OVERFLOW_ALERT"; break;
         141               0 :     case SSL_ERROR_UNKNOWN_CA_ALERT: id_str = "SSL_ERROR_UNKNOWN_CA_ALERT"; break;
         142               0 :     case SSL_ERROR_ACCESS_DENIED_ALERT: id_str = "SSL_ERROR_ACCESS_DENIED_ALERT"; break;
         143               0 :     case SSL_ERROR_DECODE_ERROR_ALERT: id_str = "SSL_ERROR_DECODE_ERROR_ALERT"; break;
         144               0 :     case SSL_ERROR_DECRYPT_ERROR_ALERT: id_str = "SSL_ERROR_DECRYPT_ERROR_ALERT"; break;
         145               0 :     case SSL_ERROR_EXPORT_RESTRICTION_ALERT: id_str = "SSL_ERROR_EXPORT_RESTRICTION_ALERT"; break;
         146               0 :     case SSL_ERROR_PROTOCOL_VERSION_ALERT: id_str = "SSL_ERROR_PROTOCOL_VERSION_ALERT"; break;
         147               0 :     case SSL_ERROR_INSUFFICIENT_SECURITY_ALERT: id_str = "SSL_ERROR_INSUFFICIENT_SECURITY_ALERT"; break;
         148               0 :     case SSL_ERROR_INTERNAL_ERROR_ALERT: id_str = "SSL_ERROR_INTERNAL_ERROR_ALERT"; break;
         149               0 :     case SSL_ERROR_USER_CANCELED_ALERT: id_str = "SSL_ERROR_USER_CANCELED_ALERT"; break;
         150               0 :     case SSL_ERROR_NO_RENEGOTIATION_ALERT: id_str = "SSL_ERROR_NO_RENEGOTIATION_ALERT"; break;
         151               0 :     case SSL_ERROR_SERVER_CACHE_NOT_CONFIGURED: id_str = "SSL_ERROR_SERVER_CACHE_NOT_CONFIGURED"; break;
         152               0 :     case SSL_ERROR_UNSUPPORTED_EXTENSION_ALERT: id_str = "SSL_ERROR_UNSUPPORTED_EXTENSION_ALERT"; break;
         153               0 :     case SSL_ERROR_CERTIFICATE_UNOBTAINABLE_ALERT: id_str = "SSL_ERROR_CERTIFICATE_UNOBTAINABLE_ALERT"; break;
         154               0 :     case SSL_ERROR_UNRECOGNIZED_NAME_ALERT: id_str = "SSL_ERROR_UNRECOGNIZED_NAME_ALERT"; break;
         155               0 :     case SSL_ERROR_BAD_CERT_STATUS_RESPONSE_ALERT: id_str = "SSL_ERROR_BAD_CERT_STATUS_RESPONSE_ALERT"; break;
         156               0 :     case SSL_ERROR_BAD_CERT_HASH_VALUE_ALERT: id_str = "SSL_ERROR_BAD_CERT_HASH_VALUE_ALERT"; break;
         157               0 :     case SSL_ERROR_RX_UNEXPECTED_NEW_SESSION_TICKET: id_str = "SSL_ERROR_RX_UNEXPECTED_NEW_SESSION_TICKET"; break;
         158               0 :     case SSL_ERROR_RX_MALFORMED_NEW_SESSION_TICKET: id_str = "SSL_ERROR_RX_MALFORMED_NEW_SESSION_TICKET"; break;
         159               0 :     case SSL_ERROR_DECOMPRESSION_FAILURE: id_str = "SSL_ERROR_DECOMPRESSION_FAILURE"; break;
         160               0 :     case SSL_ERROR_RENEGOTIATION_NOT_ALLOWED: id_str = "SSL_ERROR_RENEGOTIATION_NOT_ALLOWED"; break;
         161               0 :     case SSL_ERROR_UNSAFE_NEGOTIATION: id_str = "SSL_ERROR_UNSAFE_NEGOTIATION"; break;
         162               0 :     case SSL_ERROR_RX_UNEXPECTED_UNCOMPRESSED_RECORD: id_str = "SSL_ERROR_RX_UNEXPECTED_UNCOMPRESSED_RECORD"; break;
         163               0 :     case SSL_ERROR_WEAK_SERVER_EPHEMERAL_DH_KEY: id_str = "SSL_ERROR_WEAK_SERVER_EPHEMERAL_DH_KEY"; break;
         164               0 :     case SEC_ERROR_IO: id_str = "SEC_ERROR_IO"; break;
         165               0 :     case SEC_ERROR_LIBRARY_FAILURE: id_str = "SEC_ERROR_LIBRARY_FAILURE"; break;
         166               0 :     case SEC_ERROR_BAD_DATA: id_str = "SEC_ERROR_BAD_DATA"; break;
         167               0 :     case SEC_ERROR_OUTPUT_LEN: id_str = "SEC_ERROR_OUTPUT_LEN"; break;
         168               0 :     case SEC_ERROR_INPUT_LEN: id_str = "SEC_ERROR_INPUT_LEN"; break;
         169               0 :     case SEC_ERROR_INVALID_ARGS: id_str = "SEC_ERROR_INVALID_ARGS"; break;
         170               0 :     case SEC_ERROR_INVALID_ALGORITHM: id_str = "SEC_ERROR_INVALID_ALGORITHM"; break;
         171               0 :     case SEC_ERROR_INVALID_AVA: id_str = "SEC_ERROR_INVALID_AVA"; break;
         172               0 :     case SEC_ERROR_INVALID_TIME: id_str = "SEC_ERROR_INVALID_TIME"; break;
         173               0 :     case SEC_ERROR_BAD_DER: id_str = "SEC_ERROR_BAD_DER"; break;
         174               0 :     case SEC_ERROR_BAD_SIGNATURE: id_str = "SEC_ERROR_BAD_SIGNATURE"; break;
         175               0 :     case SEC_ERROR_EXPIRED_CERTIFICATE: id_str = "SEC_ERROR_EXPIRED_CERTIFICATE"; break;
         176               0 :     case SEC_ERROR_REVOKED_CERTIFICATE: id_str = "SEC_ERROR_REVOKED_CERTIFICATE"; break;
         177               0 :     case SEC_ERROR_UNKNOWN_ISSUER: id_str = "SEC_ERROR_UNKNOWN_ISSUER"; break;
         178               0 :     case SEC_ERROR_BAD_KEY: id_str = "SEC_ERROR_BAD_KEY"; break;
         179               0 :     case SEC_ERROR_BAD_PASSWORD: id_str = "SEC_ERROR_BAD_PASSWORD"; break;
         180               0 :     case SEC_ERROR_RETRY_PASSWORD: id_str = "SEC_ERROR_RETRY_PASSWORD"; break;
         181               0 :     case SEC_ERROR_NO_NODELOCK: id_str = "SEC_ERROR_NO_NODELOCK"; break;
         182               0 :     case SEC_ERROR_BAD_DATABASE: id_str = "SEC_ERROR_BAD_DATABASE"; break;
         183               0 :     case SEC_ERROR_NO_MEMORY: id_str = "SEC_ERROR_NO_MEMORY"; break;
         184               0 :     case SEC_ERROR_UNTRUSTED_ISSUER: id_str = "SEC_ERROR_UNTRUSTED_ISSUER"; break;
         185               0 :     case SEC_ERROR_UNTRUSTED_CERT: id_str = "SEC_ERROR_UNTRUSTED_CERT"; break;
         186               0 :     case SEC_ERROR_DUPLICATE_CERT: id_str = "SEC_ERROR_DUPLICATE_CERT"; break;
         187               0 :     case SEC_ERROR_DUPLICATE_CERT_NAME: id_str = "SEC_ERROR_DUPLICATE_CERT_NAME"; break;
         188               0 :     case SEC_ERROR_ADDING_CERT: id_str = "SEC_ERROR_ADDING_CERT"; break;
         189               0 :     case SEC_ERROR_FILING_KEY: id_str = "SEC_ERROR_FILING_KEY"; break;
         190               0 :     case SEC_ERROR_NO_KEY: id_str = "SEC_ERROR_NO_KEY"; break;
         191               0 :     case SEC_ERROR_CERT_VALID: id_str = "SEC_ERROR_CERT_VALID"; break;
         192               0 :     case SEC_ERROR_CERT_NOT_VALID: id_str = "SEC_ERROR_CERT_NOT_VALID"; break;
         193               0 :     case SEC_ERROR_CERT_NO_RESPONSE: id_str = "SEC_ERROR_CERT_NO_RESPONSE"; break;
         194               0 :     case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE: id_str = "SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE"; break;
         195               0 :     case SEC_ERROR_CRL_EXPIRED: id_str = "SEC_ERROR_CRL_EXPIRED"; break;
         196               0 :     case SEC_ERROR_CRL_BAD_SIGNATURE: id_str = "SEC_ERROR_CRL_BAD_SIGNATURE"; break;
         197               0 :     case SEC_ERROR_CRL_INVALID: id_str = "SEC_ERROR_CRL_INVALID"; break;
         198               0 :     case SEC_ERROR_EXTENSION_VALUE_INVALID: id_str = "SEC_ERROR_EXTENSION_VALUE_INVALID"; break;
         199               0 :     case SEC_ERROR_EXTENSION_NOT_FOUND: id_str = "SEC_ERROR_EXTENSION_NOT_FOUND"; break;
         200               0 :     case SEC_ERROR_CA_CERT_INVALID: id_str = "SEC_ERROR_CA_CERT_INVALID"; break;
         201               0 :     case SEC_ERROR_PATH_LEN_CONSTRAINT_INVALID: id_str = "SEC_ERROR_PATH_LEN_CONSTRAINT_INVALID"; break;
         202               0 :     case SEC_ERROR_CERT_USAGES_INVALID: id_str = "SEC_ERROR_CERT_USAGES_INVALID"; break;
         203               0 :     case SEC_INTERNAL_ONLY: id_str = "SEC_INTERNAL_ONLY"; break;
         204               0 :     case SEC_ERROR_INVALID_KEY: id_str = "SEC_ERROR_INVALID_KEY"; break;
         205               0 :     case SEC_ERROR_UNKNOWN_CRITICAL_EXTENSION: id_str = "SEC_ERROR_UNKNOWN_CRITICAL_EXTENSION"; break;
         206               0 :     case SEC_ERROR_OLD_CRL: id_str = "SEC_ERROR_OLD_CRL"; break;
         207               0 :     case SEC_ERROR_NO_EMAIL_CERT: id_str = "SEC_ERROR_NO_EMAIL_CERT"; break;
         208               0 :     case SEC_ERROR_NO_RECIPIENT_CERTS_QUERY: id_str = "SEC_ERROR_NO_RECIPIENT_CERTS_QUERY"; break;
         209               0 :     case SEC_ERROR_NOT_A_RECIPIENT: id_str = "SEC_ERROR_NOT_A_RECIPIENT"; break;
         210               0 :     case SEC_ERROR_PKCS7_KEYALG_MISMATCH: id_str = "SEC_ERROR_PKCS7_KEYALG_MISMATCH"; break;
         211               0 :     case SEC_ERROR_PKCS7_BAD_SIGNATURE: id_str = "SEC_ERROR_PKCS7_BAD_SIGNATURE"; break;
         212               0 :     case SEC_ERROR_UNSUPPORTED_KEYALG: id_str = "SEC_ERROR_UNSUPPORTED_KEYALG"; break;
         213               0 :     case SEC_ERROR_DECRYPTION_DISALLOWED: id_str = "SEC_ERROR_DECRYPTION_DISALLOWED"; break;
         214               0 :     case XP_SEC_FORTEZZA_BAD_CARD: id_str = "XP_SEC_FORTEZZA_BAD_CARD"; break;
         215               0 :     case XP_SEC_FORTEZZA_NO_CARD: id_str = "XP_SEC_FORTEZZA_NO_CARD"; break;
         216               0 :     case XP_SEC_FORTEZZA_NONE_SELECTED: id_str = "XP_SEC_FORTEZZA_NONE_SELECTED"; break;
         217               0 :     case XP_SEC_FORTEZZA_MORE_INFO: id_str = "XP_SEC_FORTEZZA_MORE_INFO"; break;
         218               0 :     case XP_SEC_FORTEZZA_PERSON_NOT_FOUND: id_str = "XP_SEC_FORTEZZA_PERSON_NOT_FOUND"; break;
         219               0 :     case XP_SEC_FORTEZZA_NO_MORE_INFO: id_str = "XP_SEC_FORTEZZA_NO_MORE_INFO"; break;
         220               0 :     case XP_SEC_FORTEZZA_BAD_PIN: id_str = "XP_SEC_FORTEZZA_BAD_PIN"; break;
         221               0 :     case XP_SEC_FORTEZZA_PERSON_ERROR: id_str = "XP_SEC_FORTEZZA_PERSON_ERROR"; break;
         222               0 :     case SEC_ERROR_NO_KRL: id_str = "SEC_ERROR_NO_KRL"; break;
         223               0 :     case SEC_ERROR_KRL_EXPIRED: id_str = "SEC_ERROR_KRL_EXPIRED"; break;
         224               0 :     case SEC_ERROR_KRL_BAD_SIGNATURE: id_str = "SEC_ERROR_KRL_BAD_SIGNATURE"; break;
         225               0 :     case SEC_ERROR_REVOKED_KEY: id_str = "SEC_ERROR_REVOKED_KEY"; break;
         226               0 :     case SEC_ERROR_KRL_INVALID: id_str = "SEC_ERROR_KRL_INVALID"; break;
         227               0 :     case SEC_ERROR_NEED_RANDOM: id_str = "SEC_ERROR_NEED_RANDOM"; break;
         228               0 :     case SEC_ERROR_NO_MODULE: id_str = "SEC_ERROR_NO_MODULE"; break;
         229               0 :     case SEC_ERROR_NO_TOKEN: id_str = "SEC_ERROR_NO_TOKEN"; break;
         230               0 :     case SEC_ERROR_READ_ONLY: id_str = "SEC_ERROR_READ_ONLY"; break;
         231               0 :     case SEC_ERROR_NO_SLOT_SELECTED: id_str = "SEC_ERROR_NO_SLOT_SELECTED"; break;
         232               0 :     case SEC_ERROR_CERT_NICKNAME_COLLISION: id_str = "SEC_ERROR_CERT_NICKNAME_COLLISION"; break;
         233               0 :     case SEC_ERROR_KEY_NICKNAME_COLLISION: id_str = "SEC_ERROR_KEY_NICKNAME_COLLISION"; break;
         234               0 :     case SEC_ERROR_SAFE_NOT_CREATED: id_str = "SEC_ERROR_SAFE_NOT_CREATED"; break;
         235               0 :     case SEC_ERROR_BAGGAGE_NOT_CREATED: id_str = "SEC_ERROR_BAGGAGE_NOT_CREATED"; break;
         236               0 :     case XP_JAVA_REMOVE_PRINCIPAL_ERROR: id_str = "XP_JAVA_REMOVE_PRINCIPAL_ERROR"; break;
         237               0 :     case XP_JAVA_DELETE_PRIVILEGE_ERROR: id_str = "XP_JAVA_DELETE_PRIVILEGE_ERROR"; break;
         238               0 :     case XP_JAVA_CERT_NOT_EXISTS_ERROR: id_str = "XP_JAVA_CERT_NOT_EXISTS_ERROR"; break;
         239               0 :     case SEC_ERROR_BAD_EXPORT_ALGORITHM: id_str = "SEC_ERROR_BAD_EXPORT_ALGORITHM"; break;
         240               0 :     case SEC_ERROR_EXPORTING_CERTIFICATES: id_str = "SEC_ERROR_EXPORTING_CERTIFICATES"; break;
         241               0 :     case SEC_ERROR_IMPORTING_CERTIFICATES: id_str = "SEC_ERROR_IMPORTING_CERTIFICATES"; break;
         242               0 :     case SEC_ERROR_PKCS12_DECODING_PFX: id_str = "SEC_ERROR_PKCS12_DECODING_PFX"; break;
         243               0 :     case SEC_ERROR_PKCS12_INVALID_MAC: id_str = "SEC_ERROR_PKCS12_INVALID_MAC"; break;
         244               0 :     case SEC_ERROR_PKCS12_UNSUPPORTED_MAC_ALGORITHM: id_str = "SEC_ERROR_PKCS12_UNSUPPORTED_MAC_ALGORITHM"; break;
         245               0 :     case SEC_ERROR_PKCS12_UNSUPPORTED_TRANSPORT_MODE: id_str = "SEC_ERROR_PKCS12_UNSUPPORTED_TRANSPORT_MODE"; break;
         246               0 :     case SEC_ERROR_PKCS12_CORRUPT_PFX_STRUCTURE: id_str = "SEC_ERROR_PKCS12_CORRUPT_PFX_STRUCTURE"; break;
         247               0 :     case SEC_ERROR_PKCS12_UNSUPPORTED_PBE_ALGORITHM: id_str = "SEC_ERROR_PKCS12_UNSUPPORTED_PBE_ALGORITHM"; break;
         248               0 :     case SEC_ERROR_PKCS12_UNSUPPORTED_VERSION: id_str = "SEC_ERROR_PKCS12_UNSUPPORTED_VERSION"; break;
         249               0 :     case SEC_ERROR_PKCS12_PRIVACY_PASSWORD_INCORRECT: id_str = "SEC_ERROR_PKCS12_PRIVACY_PASSWORD_INCORRECT"; break;
         250               0 :     case SEC_ERROR_PKCS12_CERT_COLLISION: id_str = "SEC_ERROR_PKCS12_CERT_COLLISION"; break;
         251               0 :     case SEC_ERROR_USER_CANCELLED: id_str = "SEC_ERROR_USER_CANCELLED"; break;
         252               0 :     case SEC_ERROR_PKCS12_DUPLICATE_DATA: id_str = "SEC_ERROR_PKCS12_DUPLICATE_DATA"; break;
         253               0 :     case SEC_ERROR_MESSAGE_SEND_ABORTED: id_str = "SEC_ERROR_MESSAGE_SEND_ABORTED"; break;
         254               0 :     case SEC_ERROR_INADEQUATE_KEY_USAGE: id_str = "SEC_ERROR_INADEQUATE_KEY_USAGE"; break;
         255               0 :     case SEC_ERROR_INADEQUATE_CERT_TYPE: id_str = "SEC_ERROR_INADEQUATE_CERT_TYPE"; break;
         256               0 :     case SEC_ERROR_CERT_ADDR_MISMATCH: id_str = "SEC_ERROR_CERT_ADDR_MISMATCH"; break;
         257               0 :     case SEC_ERROR_PKCS12_UNABLE_TO_IMPORT_KEY: id_str = "SEC_ERROR_PKCS12_UNABLE_TO_IMPORT_KEY"; break;
         258               0 :     case SEC_ERROR_PKCS12_IMPORTING_CERT_CHAIN: id_str = "SEC_ERROR_PKCS12_IMPORTING_CERT_CHAIN"; break;
         259               0 :     case SEC_ERROR_PKCS12_UNABLE_TO_LOCATE_OBJECT_BY_NAME: id_str = "SEC_ERROR_PKCS12_UNABLE_TO_LOCATE_OBJECT_BY_NAME"; break;
         260               0 :     case SEC_ERROR_PKCS12_UNABLE_TO_EXPORT_KEY: id_str = "SEC_ERROR_PKCS12_UNABLE_TO_EXPORT_KEY"; break;
         261               0 :     case SEC_ERROR_PKCS12_UNABLE_TO_WRITE: id_str = "SEC_ERROR_PKCS12_UNABLE_TO_WRITE"; break;
         262               0 :     case SEC_ERROR_PKCS12_UNABLE_TO_READ: id_str = "SEC_ERROR_PKCS12_UNABLE_TO_READ"; break;
         263               0 :     case SEC_ERROR_PKCS12_KEY_DATABASE_NOT_INITIALIZED: id_str = "SEC_ERROR_PKCS12_KEY_DATABASE_NOT_INITIALIZED"; break;
         264               0 :     case SEC_ERROR_KEYGEN_FAIL: id_str = "SEC_ERROR_KEYGEN_FAIL"; break;
         265               0 :     case SEC_ERROR_INVALID_PASSWORD: id_str = "SEC_ERROR_INVALID_PASSWORD"; break;
         266               0 :     case SEC_ERROR_RETRY_OLD_PASSWORD: id_str = "SEC_ERROR_RETRY_OLD_PASSWORD"; break;
         267               0 :     case SEC_ERROR_BAD_NICKNAME: id_str = "SEC_ERROR_BAD_NICKNAME"; break;
         268               0 :     case SEC_ERROR_NOT_FORTEZZA_ISSUER: id_str = "SEC_ERROR_NOT_FORTEZZA_ISSUER"; break;
         269               0 :     case SEC_ERROR_CANNOT_MOVE_SENSITIVE_KEY: id_str = "SEC_ERROR_CANNOT_MOVE_SENSITIVE_KEY"; break;
         270               0 :     case SEC_ERROR_JS_INVALID_MODULE_NAME: id_str = "SEC_ERROR_JS_INVALID_MODULE_NAME"; break;
         271               0 :     case SEC_ERROR_JS_INVALID_DLL: id_str = "SEC_ERROR_JS_INVALID_DLL"; break;
         272               0 :     case SEC_ERROR_JS_ADD_MOD_FAILURE: id_str = "SEC_ERROR_JS_ADD_MOD_FAILURE"; break;
         273               0 :     case SEC_ERROR_JS_DEL_MOD_FAILURE: id_str = "SEC_ERROR_JS_DEL_MOD_FAILURE"; break;
         274               0 :     case SEC_ERROR_OLD_KRL: id_str = "SEC_ERROR_OLD_KRL"; break;
         275               0 :     case SEC_ERROR_CKL_CONFLICT: id_str = "SEC_ERROR_CKL_CONFLICT"; break;
         276               0 :     case SEC_ERROR_CERT_NOT_IN_NAME_SPACE: id_str = "SEC_ERROR_CERT_NOT_IN_NAME_SPACE"; break;
         277               0 :     case SEC_ERROR_KRL_NOT_YET_VALID: id_str = "SEC_ERROR_KRL_NOT_YET_VALID"; break;
         278               0 :     case SEC_ERROR_CRL_NOT_YET_VALID: id_str = "SEC_ERROR_CRL_NOT_YET_VALID"; break;
         279               0 :     case SEC_ERROR_UNKNOWN_CERT: id_str = "SEC_ERROR_UNKNOWN_CERT"; break;
         280               0 :     case SEC_ERROR_UNKNOWN_SIGNER: id_str = "SEC_ERROR_UNKNOWN_SIGNER"; break;
         281               0 :     case SEC_ERROR_CERT_BAD_ACCESS_LOCATION: id_str = "SEC_ERROR_CERT_BAD_ACCESS_LOCATION"; break;
         282               0 :     case SEC_ERROR_OCSP_UNKNOWN_RESPONSE_TYPE: id_str = "SEC_ERROR_OCSP_UNKNOWN_RESPONSE_TYPE"; break;
         283               0 :     case SEC_ERROR_OCSP_BAD_HTTP_RESPONSE: id_str = "SEC_ERROR_OCSP_BAD_HTTP_RESPONSE"; break;
         284               0 :     case SEC_ERROR_OCSP_MALFORMED_REQUEST: id_str = "SEC_ERROR_OCSP_MALFORMED_REQUEST"; break;
         285               0 :     case SEC_ERROR_OCSP_SERVER_ERROR: id_str = "SEC_ERROR_OCSP_SERVER_ERROR"; break;
         286               0 :     case SEC_ERROR_OCSP_TRY_SERVER_LATER: id_str = "SEC_ERROR_OCSP_TRY_SERVER_LATER"; break;
         287               0 :     case SEC_ERROR_OCSP_REQUEST_NEEDS_SIG: id_str = "SEC_ERROR_OCSP_REQUEST_NEEDS_SIG"; break;
         288               0 :     case SEC_ERROR_OCSP_UNAUTHORIZED_REQUEST: id_str = "SEC_ERROR_OCSP_UNAUTHORIZED_REQUEST"; break;
         289               0 :     case SEC_ERROR_OCSP_UNKNOWN_RESPONSE_STATUS: id_str = "SEC_ERROR_OCSP_UNKNOWN_RESPONSE_STATUS"; break;
         290               0 :     case SEC_ERROR_OCSP_UNKNOWN_CERT: id_str = "SEC_ERROR_OCSP_UNKNOWN_CERT"; break;
         291               0 :     case SEC_ERROR_OCSP_NOT_ENABLED: id_str = "SEC_ERROR_OCSP_NOT_ENABLED"; break;
         292               0 :     case SEC_ERROR_OCSP_NO_DEFAULT_RESPONDER: id_str = "SEC_ERROR_OCSP_NO_DEFAULT_RESPONDER"; break;
         293               0 :     case SEC_ERROR_OCSP_MALFORMED_RESPONSE: id_str = "SEC_ERROR_OCSP_MALFORMED_RESPONSE"; break;
         294               0 :     case SEC_ERROR_OCSP_UNAUTHORIZED_RESPONSE: id_str = "SEC_ERROR_OCSP_UNAUTHORIZED_RESPONSE"; break;
         295               0 :     case SEC_ERROR_OCSP_FUTURE_RESPONSE: id_str = "SEC_ERROR_OCSP_FUTURE_RESPONSE"; break;
         296               0 :     case SEC_ERROR_OCSP_OLD_RESPONSE: id_str = "SEC_ERROR_OCSP_OLD_RESPONSE"; break;
         297               0 :     case SEC_ERROR_DIGEST_NOT_FOUND: id_str = "SEC_ERROR_DIGEST_NOT_FOUND"; break;
         298               0 :     case SEC_ERROR_UNSUPPORTED_MESSAGE_TYPE: id_str = "SEC_ERROR_UNSUPPORTED_MESSAGE_TYPE"; break;
         299               0 :     case SEC_ERROR_MODULE_STUCK: id_str = "SEC_ERROR_MODULE_STUCK"; break;
         300               0 :     case SEC_ERROR_BAD_TEMPLATE: id_str = "SEC_ERROR_BAD_TEMPLATE"; break;
         301               0 :     case SEC_ERROR_CRL_NOT_FOUND: id_str = "SEC_ERROR_CRL_NOT_FOUND"; break;
         302               0 :     case SEC_ERROR_REUSED_ISSUER_AND_SERIAL: id_str = "SEC_ERROR_REUSED_ISSUER_AND_SERIAL"; break;
         303               0 :     case SEC_ERROR_BUSY: id_str = "SEC_ERROR_BUSY"; break;
         304               0 :     case SEC_ERROR_EXTRA_INPUT: id_str = "SEC_ERROR_EXTRA_INPUT"; break;
         305               0 :     case SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE: id_str = "SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE"; break;
         306               0 :     case SEC_ERROR_UNSUPPORTED_EC_POINT_FORM: id_str = "SEC_ERROR_UNSUPPORTED_EC_POINT_FORM"; break;
         307               0 :     case SEC_ERROR_UNRECOGNIZED_OID: id_str = "SEC_ERROR_UNRECOGNIZED_OID"; break;
         308               0 :     case SEC_ERROR_OCSP_INVALID_SIGNING_CERT: id_str = "SEC_ERROR_OCSP_INVALID_SIGNING_CERT"; break;
         309               0 :     case SEC_ERROR_REVOKED_CERTIFICATE_CRL: id_str = "SEC_ERROR_REVOKED_CERTIFICATE_CRL"; break;
         310               0 :     case SEC_ERROR_REVOKED_CERTIFICATE_OCSP: id_str = "SEC_ERROR_REVOKED_CERTIFICATE_OCSP"; break;
         311               0 :     case SEC_ERROR_CRL_INVALID_VERSION: id_str = "SEC_ERROR_CRL_INVALID_VERSION"; break;
         312               0 :     case SEC_ERROR_CRL_V1_CRITICAL_EXTENSION: id_str = "SEC_ERROR_CRL_V1_CRITICAL_EXTENSION"; break;
         313               0 :     case SEC_ERROR_CRL_UNKNOWN_CRITICAL_EXTENSION: id_str = "SEC_ERROR_CRL_UNKNOWN_CRITICAL_EXTENSION"; break;
         314               0 :     case SEC_ERROR_UNKNOWN_OBJECT_TYPE: id_str = "SEC_ERROR_UNKNOWN_OBJECT_TYPE"; break;
         315               0 :     case SEC_ERROR_INCOMPATIBLE_PKCS11: id_str = "SEC_ERROR_INCOMPATIBLE_PKCS11"; break;
         316               0 :     case SEC_ERROR_NO_EVENT: id_str = "SEC_ERROR_NO_EVENT"; break;
         317               0 :     case SEC_ERROR_CRL_ALREADY_EXISTS: id_str = "SEC_ERROR_CRL_ALREADY_EXISTS"; break;
         318               0 :     case SEC_ERROR_NOT_INITIALIZED: id_str = "SEC_ERROR_NOT_INITIALIZED"; break;
         319               0 :     case SEC_ERROR_TOKEN_NOT_LOGGED_IN: id_str = "SEC_ERROR_TOKEN_NOT_LOGGED_IN"; break;
         320               0 :     case SEC_ERROR_OCSP_RESPONDER_CERT_INVALID: id_str = "SEC_ERROR_OCSP_RESPONDER_CERT_INVALID"; break;
         321               0 :     case SEC_ERROR_OCSP_BAD_SIGNATURE: id_str = "SEC_ERROR_OCSP_BAD_SIGNATURE"; break;
         322               0 :     case SEC_ERROR_OUT_OF_SEARCH_LIMITS: id_str = "SEC_ERROR_OUT_OF_SEARCH_LIMITS"; break;
         323               0 :     case SEC_ERROR_INVALID_POLICY_MAPPING: id_str = "SEC_ERROR_INVALID_POLICY_MAPPING"; break;
         324               0 :     case SEC_ERROR_POLICY_VALIDATION_FAILED: id_str = "SEC_ERROR_POLICY_VALIDATION_FAILED"; break;
         325               0 :     case SEC_ERROR_UNKNOWN_AIA_LOCATION_TYPE: id_str = "SEC_ERROR_UNKNOWN_AIA_LOCATION_TYPE"; break;
         326               0 :     case SEC_ERROR_BAD_HTTP_RESPONSE: id_str = "SEC_ERROR_BAD_HTTP_RESPONSE"; break;
         327               0 :     case SEC_ERROR_BAD_LDAP_RESPONSE: id_str = "SEC_ERROR_BAD_LDAP_RESPONSE"; break;
         328               0 :     case SEC_ERROR_FAILED_TO_ENCODE_DATA: id_str = "SEC_ERROR_FAILED_TO_ENCODE_DATA"; break;
         329               0 :     case SEC_ERROR_BAD_INFO_ACCESS_LOCATION: id_str = "SEC_ERROR_BAD_INFO_ACCESS_LOCATION"; break;
         330               0 :     case SEC_ERROR_LIBPKIX_INTERNAL: id_str = "SEC_ERROR_LIBPKIX_INTERNAL"; break;
         331               0 :     case SEC_ERROR_PKCS11_GENERAL_ERROR: id_str = "SEC_ERROR_PKCS11_GENERAL_ERROR"; break;
         332               0 :     case SEC_ERROR_PKCS11_FUNCTION_FAILED: id_str = "SEC_ERROR_PKCS11_FUNCTION_FAILED"; break;
         333               0 :     case SEC_ERROR_PKCS11_DEVICE_ERROR: id_str = "SEC_ERROR_PKCS11_DEVICE_ERROR"; break;
         334               0 :     case SEC_ERROR_BAD_INFO_ACCESS_METHOD: id_str = "SEC_ERROR_BAD_INFO_ACCESS_METHOD"; break;
         335               0 :     case SEC_ERROR_CRL_IMPORT_FAILED: id_str = "SEC_ERROR_CRL_IMPORT_FAILED"; break;
         336                 :   }
         337                 :
         338               0 :   return id_str;
         339                 : }
         340                 :
         341                 : const char *
         342               0 : nsNSSErrors::getOverrideErrorStringName(PRInt32 aErrorCode)
         343                 : {
         344               0 :   const char *id_str = nsnull;
         345                 :
         346               0 :   switch (aErrorCode) {
         347                 :     case SSL_ERROR_SSL_DISABLED:
         348               0 :       id_str = "PSMERR_SSL_Disabled";
         349               0 :       break;
         350                 :
         351                 :     case SSL_ERROR_SSL2_DISABLED:
         352               0 :       id_str = "PSMERR_SSL2_Disabled";
         353               0 :       break;
         354                 :
         355                 :     case SEC_ERROR_REUSED_ISSUER_AND_SERIAL:
         356               0 :       id_str = "PSMERR_HostReusedIssuerSerial";
         357               0 :       break;
         358                 :   }
         359                 :
         360               0 :   return id_str;
         361                 : }
         362                 :
         363                 : nsresult
         364               0 : nsNSSErrors::getErrorMessageFromCode(PRInt32 err,
         365                 :                                      nsINSSComponent *component,
         366                 :                                      nsString &returnedMessage)
         367                 : {
         368               0 :   NS_ENSURE_ARG_POINTER(component);
         369               0 :   returnedMessage.Truncate();
         370                 :
         371               0 :   const char *nss_error_id_str = getDefaultErrorStringName(err);
         372               0 :   const char *id_str = getOverrideErrorStringName(err);
         373                 :
         374               0 :   if (id_str || nss_error_id_str)
         375                 :   {
         376               0 :     nsString defMsg;
         377                 :     nsresult rv;
         378               0 :     if (id_str)
         379                 :     {
         380               0 :       rv = component->GetPIPNSSBundleString(id_str, defMsg);
         381                 :     }
         382                 :     else
         383                 :     {
         384               0 :       rv = component->GetNSSBundleString(nss_error_id_str, defMsg);
         385                 :     }
         386                 :
         387               0 :     if (NS_SUCCEEDED(rv))
         388                 :     {
         389               0 :       returnedMessage.Append(defMsg);
         390               0 :       returnedMessage.Append(NS_LITERAL_STRING("\n"));
         391                 :     }
         392                 :
         393               0 :     nsCString error_id(nss_error_id_str);
         394               0 :     ToLowerCase(error_id);
         395               0 :     NS_ConvertASCIItoUTF16 idU(error_id);
         396                 :
         397                 :     const PRUnichar *params[1];
         398               0 :     params[0] = idU.get();
         399                 :
         400               0 :     nsString formattedString;
         401                 :     rv = component->PIPBundleFormatStringFromName("certErrorCodePrefix",
         402                 :                                                   params, 1,
         403               0 :                                                   formattedString);
         404               0 :     if (NS_SUCCEEDED(rv)) {
         405               0 :       returnedMessage.Append(NS_LITERAL_STRING("\n"));
         406               0 :       returnedMessage.Append(formattedString);
         407               0 :       returnedMessage.Append(NS_LITERAL_STRING("\n"));
         408                 :     }
         409                 :     else {
         410               0 :       returnedMessage.Append(NS_LITERAL_STRING("("));
         411               0 :       returnedMessage.Append(idU);
         412               0 :       returnedMessage.Append(NS_LITERAL_STRING(")"));
         413                 :     }
         414                 :   }
         415                 :
         416               0 :   return NS_OK;
         417                 : }

Generated by: LCOV version 1.7