195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * All rights reserved.
395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *
495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * This package is an SSL implementation written
595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * by Eric Young (eay@cryptsoft.com).
695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * The implementation was written so as to conform with Netscapes SSL.
795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *
895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * This library is free for commercial and non-commercial use as long as
995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * the following conditions are aheared to.  The following conditions
1095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * apply to all code found in this distribution, be it the RC4, RSA,
1195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
1295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * included with this distribution is covered by the same copyright terms
1395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * except that the holder is Tim Hudson (tjh@cryptsoft.com).
1495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *
1595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * Copyright remains Eric Young's, and as such any Copyright notices in
1695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * the code are not to be removed.
1795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * If this package is used in a product, Eric Young should be given attribution
1895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * as the author of the parts of the library used.
1995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * This can be in the form of a textual message at program startup or
2095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * in documentation (online or textual) provided with the package.
2195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *
2295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * Redistribution and use in source and binary forms, with or without
2395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * modification, are permitted provided that the following conditions
2495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * are met:
2595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * 1. Redistributions of source code must retain the copyright
2695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *    notice, this list of conditions and the following disclaimer.
2795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * 2. Redistributions in binary form must reproduce the above copyright
2895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *    notice, this list of conditions and the following disclaimer in the
2995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *    documentation and/or other materials provided with the distribution.
3095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * 3. All advertising materials mentioning features or use of this software
3195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *    must display the following acknowledgement:
3295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *    "This product includes cryptographic software written by
3395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *     Eric Young (eay@cryptsoft.com)"
3495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *    The word 'cryptographic' can be left out if the rouines from the library
3595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *    being used are not cryptographic related :-).
3695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * 4. If you include any Windows specific code (or a derivative thereof) from
3795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *    the apps directory (application code) you must include an acknowledgement:
3895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
3995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *
4095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
4195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
4395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
4495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
4695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
4895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
4995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
5095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * SUCH DAMAGE.
5195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley *
5295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * The licence and distribution terms for any publically available version or
5395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * derivative of this code cannot be changed.  i.e. this code cannot simply be
5495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * copied and put under another distribution licence
5595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley * [including the GNU Public Licence.] */
5695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley
5795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley#include <openssl/asn1.h>
5895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley#include <openssl/buf.h>
5995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley#include <openssl/cipher.h>
6095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley#include <openssl/evp.h>
6195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley#include <openssl/lhash.h>
6295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley#include <openssl/mem.h>
6395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley#include <openssl/obj.h>
6495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley#include <openssl/x509.h>
6595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley
6695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley
6795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langleyconst char *X509_verify_cert_error_string(long n)
6895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	{
6995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	static char buf[100];
7095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley
7195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	switch ((int)n)
7295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		{
7395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_OK:
7495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("ok");
7595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
7695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("unable to get issuer certificate");
7795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_UNABLE_TO_GET_CRL:
7895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("unable to get certificate CRL");
7995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE:
8095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("unable to decrypt certificate's signature");
8195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE:
8295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("unable to decrypt CRL's signature");
8395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY:
8495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("unable to decode issuer public key");
8595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_CERT_SIGNATURE_FAILURE:
8695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("certificate signature failure");
8795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_CRL_SIGNATURE_FAILURE:
8895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("CRL signature failure");
8995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_CERT_NOT_YET_VALID:
9095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("certificate is not yet valid");
9195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_CRL_NOT_YET_VALID:
9295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("CRL is not yet valid");
9395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_CERT_HAS_EXPIRED:
9495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("certificate has expired");
9595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_CRL_HAS_EXPIRED:
9695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("CRL has expired");
9795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
9895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("format error in certificate's notBefore field");
9995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD:
10095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("format error in certificate's notAfter field");
10195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD:
10295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("format error in CRL's lastUpdate field");
10395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD:
10495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("format error in CRL's nextUpdate field");
10595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_OUT_OF_MEM:
10695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("out of memory");
10795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
10895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("self signed certificate");
10995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN:
11095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("self signed certificate in certificate chain");
11195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
11295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("unable to get local issuer certificate");
11395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE:
11495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("unable to verify the first certificate");
11595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_CERT_CHAIN_TOO_LONG:
11695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("certificate chain too long");
11795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_CERT_REVOKED:
11895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("certificate revoked");
11995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_INVALID_CA:
12095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return ("invalid CA certificate");
12195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_INVALID_NON_CA:
12295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return ("invalid non-CA certificate (has CA markings)");
12395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_PATH_LENGTH_EXCEEDED:
12495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return ("path length constraint exceeded");
12595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED:
12695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("proxy path length constraint exceeded");
12795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED:
12895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("proxy certificates not allowed, please set the appropriate flag");
12995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_INVALID_PURPOSE:
13095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return ("unsupported certificate purpose");
13195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_CERT_UNTRUSTED:
13295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return ("certificate not trusted");
13395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_CERT_REJECTED:
13495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return ("certificate rejected");
13595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_APPLICATION_VERIFICATION:
13695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("application verification failure");
13795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_SUBJECT_ISSUER_MISMATCH:
13895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("subject issuer mismatch");
13995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_AKID_SKID_MISMATCH:
14095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("authority and subject key identifier mismatch");
14195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH:
14295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("authority and issuer serial number mismatch");
14395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_KEYUSAGE_NO_CERTSIGN:
14495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("key usage does not include certificate signing");
14595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER:
14695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("unable to get CRL issuer certificate");
14795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION:
14895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("unhandled critical extension");
14995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_KEYUSAGE_NO_CRL_SIGN:
15095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("key usage does not include CRL signing");
15195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE:
15295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("key usage does not include digital signature");
15395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION:
15495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("unhandled critical CRL extension");
15595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_INVALID_EXTENSION:
15695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("invalid or inconsistent certificate extension");
15795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_INVALID_POLICY_EXTENSION:
15895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("invalid or inconsistent certificate policy extension");
15995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_NO_EXPLICIT_POLICY:
16095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("no explicit policy");
16195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_DIFFERENT_CRL_SCOPE:
16295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	return("Different CRL scope");
16395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE:
16495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	return("Unsupported extension feature");
16595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley 	case X509_V_ERR_UNNESTED_RESOURCE:
16695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley 		return("RFC 3779 resource not subset of parent's resources");
16795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley
16895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_PERMITTED_VIOLATION:
16995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("permitted subtree violation");
17095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_EXCLUDED_VIOLATION:
17195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("excluded subtree violation");
17295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_SUBTREE_MINMAX:
17395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("name constraints minimum and maximum not supported");
17495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE:
17595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("unsupported name constraint type");
17695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX:
17795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("unsupported or invalid name constraint syntax");
17895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_UNSUPPORTED_NAME_SYNTAX:
17995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("unsupported or invalid name syntax");
18095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_CRL_PATH_VALIDATION_ERROR:
18195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("CRL path validation error");
18295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley
18395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_SUITE_B_INVALID_VERSION:
18495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("Suite B: certificate version invalid");
18595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_SUITE_B_INVALID_ALGORITHM:
18695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("Suite B: invalid public key algorithm");
18795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_SUITE_B_INVALID_CURVE:
18895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("Suite B: invalid ECC curve");
18995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM:
19095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("Suite B: invalid signature algorithm");
19195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED:
19295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("Suite B: curve not allowed for this LOS");
19395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256:
19495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("Suite B: cannot sign P-384 with P-256");
19595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley
19695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_HOSTNAME_MISMATCH:
19795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("Hostname mismatch");
19895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_EMAIL_MISMATCH:
19995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("Email address mismatch");
20095c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	case X509_V_ERR_IP_ADDRESS_MISMATCH:
20195c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return("IP address mismatch");
20295c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley
20395c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	default:
20495c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		BIO_snprintf(buf,sizeof buf,"error number %ld",n);
20595c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		return(buf);
20695c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley		}
20795c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley	}
20895c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley
20995c29f3cd1f6c08c6c0927868683392eea727ccAdam Langley
210