From: Dr. Stephen Henson Date: Mon, 3 Mar 2014 23:33:51 +0000 (+0000) Subject: For self signed root only indicate one error. X-Git-Tag: OpenSSL_1_0_2-beta2~288 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bdfc0e284c89dd5781259cc19aa264aded538492;p=oweals%2Fopenssl.git For self signed root only indicate one error. --- diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index 5f91b01666..0693c609ce 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -366,8 +366,11 @@ int X509_verify_cert(X509_STORE_CTX *ctx) /* If explicitly rejected error */ if (i == X509_TRUST_REJECTED) goto end; - /* If not explicitly trusted then indicate error */ - if (i != X509_TRUST_TRUSTED) + /* If not explicitly trusted then indicate error unless it's + * a single self signed certificate in which case we've indicated + * an error already and set bad_chain == 1 + */ + if (i != X509_TRUST_TRUSTED && !bad_chain) { if ((chain_ss == NULL) || !ctx->check_issued(ctx, x, chain_ss)) {