diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-04-03 23:37:32 +0200 |
---|---|---|
committer | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-04-04 20:38:14 +0200 |
commit | c5137473bdc7bcf7c43b4bd5d28827f8ddd70490 (patch) | |
tree | 6a3bf41f6437c0021d89bd7dae4dac152d4174c3 /crypto/x509/x509_r2x.c | |
parent | 97458daade31c32ea8816b7e065e3bda3be588fa (diff) |
Use X509_REQ_get0_pubkey
Reviewed-by: Stephen Henson <steve@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/x509/x509_r2x.c')
-rw-r--r-- | crypto/x509/x509_r2x.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/crypto/x509/x509_r2x.c b/crypto/x509/x509_r2x.c index dc7e41265c..d082636de4 100644 --- a/crypto/x509/x509_r2x.c +++ b/crypto/x509/x509_r2x.c @@ -101,21 +101,14 @@ X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey) NULL) goto err; - pubkey = X509_REQ_get_pubkey(r); - if (pubkey == NULL) + pubkey = X509_REQ_get0_pubkey(r); + if (pubkey == NULL || !X509_set_pubkey(ret, pubkey)) goto err; - if (!X509_set_pubkey(ret, pubkey)) - goto err_pkey; - - EVP_PKEY_free(pubkey); - if (!X509_sign(ret, pkey, EVP_md5())) goto err; return ret; - err_pkey: - EVP_PKEY_free(pubkey); err: X509_free(ret); return NULL; |