Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <agl@chromium.org>2014-06-20 23:00:00 +0400
committerAdam Langley <agl@chromium.org>2014-06-21 00:17:39 +0400
commite0ddf2706a99598252d65a87ff1f626e096272b0 (patch)
treefd7df4b632a6baf86bd4d3a3913632f932ab9bfc /crypto/x509
parent8f5b6b9b0fb84e05b00b23eee12b610fd2cc2ab9 (diff)
For self signed root only indicate one error.
(Imported from upstream's bdfc0e284c89dd5781259cc19aa264aded538492.)
Diffstat (limited to 'crypto/x509')
-rw-r--r--crypto/x509/x509_vfy.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c
index b8889376..f4fb3d50 100644
--- a/crypto/x509/x509_vfy.c
+++ b/crypto/x509/x509_vfy.c
@@ -363,8 +363,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))
{