-
-
Save indutny/554cb6637dadda84460a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/deps/openssl/openssl/crypto/x509/x509_vfy.c b/deps/openssl/openssl/crypto/x509/x509_vfy.c | |
index 920066a..c313024 100644 | |
--- a/deps/openssl/openssl/crypto/x509/x509_vfy.c | |
+++ b/deps/openssl/openssl/crypto/x509/x509_vfy.c | |
@@ -238,6 +238,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) | |
* is self signed. | |
*/ | |
+retry: | |
i=sk_X509_num(ctx->chain); | |
x=sk_X509_value(ctx->chain,i-1); | |
if (ctx->check_issued(ctx, x, x)) | |
@@ -312,6 +313,11 @@ int X509_verify_cert(X509_STORE_CTX *ctx) | |
{ | |
if ((chain_ss == NULL) || !ctx->check_issued(ctx, x, chain_ss)) | |
{ | |
+ if (sk_X509_num(ctx->chain) > 1) | |
+ { | |
+ X509_free(sk_X509_pop(ctx->chain)); | |
+ goto retry; | |
+ } | |
if (ctx->last_untrusted >= num) | |
ctx->error=X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY; | |
else |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment