aboutsummaryrefslogtreecommitdiffstats
path: root/apps/x509.c
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-04-03 23:37:32 +0200
committerFdaSilvaYY <fdasilvayy@gmail.com>2016-04-04 20:38:14 +0200
commitc5137473bdc7bcf7c43b4bd5d28827f8ddd70490 (patch)
tree6a3bf41f6437c0021d89bd7dae4dac152d4174c3 /apps/x509.c
parent97458daade31c32ea8816b7e065e3bda3be588fa (diff)
downloadopenssl-c5137473bdc7bcf7c43b4bd5d28827f8ddd70490.tar.gz
Use X509_REQ_get0_pubkey
Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'apps/x509.c')
-rw-r--r--apps/x509.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/apps/x509.c b/apps/x509.c
index 00c0d97aa2..bc5623365a 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -562,12 +562,11 @@ int x509_main(int argc, char **argv)
goto end;
}
- if ((pkey = X509_REQ_get_pubkey(req)) == NULL) {
+ if ((pkey = X509_REQ_get0_pubkey(req)) == NULL) {
BIO_printf(bio_err, "error unpacking public key\n");
goto end;
}
i = X509_REQ_verify(req, pkey);
- EVP_PKEY_free(pkey);
if (i < 0) {
BIO_printf(bio_err, "Signature verification error\n");
ERR_print_errors(bio_err);
@@ -607,9 +606,8 @@ int x509_main(int argc, char **argv)
if (fkey)
X509_set_pubkey(x, fkey);
else {
- pkey = X509_REQ_get_pubkey(req);
+ pkey = X509_REQ_get0_pubkey(req);
X509_set_pubkey(x, pkey);
- EVP_PKEY_free(pkey);
}
} else
x = load_cert(infile, informat, "Certificate");