diff options
author | Dr. Stephen Henson <steve@openssl.org> | 1999-01-03 01:08:33 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 1999-01-03 01:08:33 +0000 |
commit | cfcf645356b0957e9ec7190e3afb3e4d6c406d5b (patch) | |
tree | cc2924b1fd4399c24493f588d78ac0e582fb550d /crypto | |
parent | cdbb8c2f26574349b721b651f40f120864848059 (diff) |
Make sure applications free up pkey structures and add netscape extension
handling to x509.c
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/asn1/t_req.c | 2 | ||||
-rw-r--r-- | crypto/asn1/t_x509.c | 2 | ||||
-rw-r--r-- | crypto/x509/x509_vfy.c | 9 | ||||
-rw-r--r-- | crypto/x509/x509type.c | 3 |
4 files changed, 13 insertions, 3 deletions
diff --git a/crypto/asn1/t_req.c b/crypto/asn1/t_req.c index 7df749a48f..5caee74c5e 100644 --- a/crypto/asn1/t_req.c +++ b/crypto/asn1/t_req.c @@ -138,6 +138,8 @@ X509_REQ *x; #endif BIO_printf(bp,"%12sUnknown Public Key:\n",""); + EVP_PKEY_free(pkey); + /* may not be */ sprintf(str,"%8sAttributes:\n",""); if (BIO_puts(bp,str) <= 0) goto err; diff --git a/crypto/asn1/t_x509.c b/crypto/asn1/t_x509.c index 9a8c8bf0ca..4bf1bd4536 100644 --- a/crypto/asn1/t_x509.c +++ b/crypto/asn1/t_x509.c @@ -182,6 +182,8 @@ X509 *x; #endif BIO_printf(bp,"%12sUnknown Public Key:\n",""); + EVP_PKEY_free(pkey); + n=X509_get_ext_count(x); if (n > 0) { diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index f8c0865743..f5face18df 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -345,11 +345,13 @@ 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; } + EVP_PKEY_free(pkey); pkey=NULL; i=X509_cmp_current_time(X509_get_notBefore(xs)); @@ -403,6 +405,7 @@ X509_STORE_CTX *ctx; } ok=1; end: + EVP_PKEY_free(pkey); return(ok); } @@ -492,6 +495,7 @@ STACK *chain; break; else { + EVP_PKEY_free(ktmp); ktmp=NULL; } } @@ -506,10 +510,11 @@ STACK *chain; { ktmp2=X509_get_pubkey((X509 *)sk_value(chain,j)); EVP_PKEY_copy_parameters(ktmp2,ktmp); + EVP_PKEY_free(ktmp2); } - if (pkey != NULL) - EVP_PKEY_copy_parameters(pkey,ktmp); + if (pkey != NULL) EVP_PKEY_copy_parameters(pkey,ktmp); + EVP_PKEY_free(ktmp); return(1); } diff --git a/crypto/x509/x509type.c b/crypto/x509/x509type.c index 42c23bcfca..5274ded737 100644 --- a/crypto/x509/x509type.c +++ b/crypto/x509/x509type.c @@ -108,8 +108,9 @@ EVP_PKEY *pkey; break; } - if (EVP_PKEY_size(pkey) <= 512) + if (EVP_PKEY_size(pk) <= 512) ret|=EVP_PKT_EXP; + if(pkey==NULL) EVP_PKEY_free(pk); return(ret); } |