aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/x509/x509_vfy.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2000-03-02 00:37:53 +0000
committerDr. Stephen Henson <steve@openssl.org>2000-03-02 00:37:53 +0000
commit582e5929243183b8ba21514b7c198d70359e4734 (patch)
tree741bf9b6399c727449d9c6d9596906b18161214f /crypto/x509/x509_vfy.c
parent8782a426278dbbd3499a38003acc8a8efe6dce3c (diff)
downloadopenssl-582e5929243183b8ba21514b7c198d70359e4734.tar.gz
Fix bug which would free up a public key
twice if the verify callback tried to continue after a signature failure.
Diffstat (limited to 'crypto/x509/x509_vfy.c')
-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 4fdff54124..8563f65695 100644
--- a/crypto/x509/x509_vfy.c
+++ b/crypto/x509/x509_vfy.c
@@ -436,11 +436,14 @@ static int internal_verify(X509_STORE_CTX *ctx)
}
if (X509_verify(xs,pkey) <= 0)
{
- EVP_PKEY_free(pkey);
ctx->error=X509_V_ERR_CERT_SIGNATURE_FAILURE;
ctx->current_cert=xs;
ok=(*cb)(0,ctx);
- if (!ok) goto end;
+ if (!ok)
+ {
+ EVP_PKEY_free(pkey);
+ goto end;
+ }
}
EVP_PKEY_free(pkey);
pkey=NULL;