X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fx509%2Fx509_req.c;h=c67f609f07ecabbfb41dd076d5a6ce3cfd94a601;hb=99119000add47e4d1d9241f4e76f57d98439a766;hp=8cc35b3365e7a1a6edbc30bc89ac72eb76578dd0;hpb=1f143e08a5cde8e3fa6b5b80988bd6be7673428a;p=oweals%2Fopenssl.git diff --git a/crypto/x509/x509_req.c b/crypto/x509/x509_req.c index 8cc35b3365..c67f609f07 100644 --- a/crypto/x509/x509_req.c +++ b/crypto/x509/x509_req.c @@ -1,4 +1,3 @@ -/* crypto/x509/x509_req.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -92,11 +91,10 @@ X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) if (!X509_REQ_set_subject_name(ret, X509_get_subject_name(x))) goto err; - pktmp = X509_get_pubkey(x); + pktmp = X509_get0_pubkey(x); if (pktmp == NULL) goto err; i = X509_REQ_set_pubkey(ret, pktmp); - EVP_PKEY_free(pktmp); if (!i) goto err; @@ -141,13 +139,13 @@ int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k) break; case -2: #ifndef OPENSSL_NO_EC - if (k->type == EVP_PKEY_EC) { + if (EVP_PKEY_id(k) == EVP_PKEY_EC) { X509err(X509_F_X509_REQ_CHECK_PRIVATE_KEY, ERR_R_EC_LIB); break; } #endif #ifndef OPENSSL_NO_DH - if (k->type == EVP_PKEY_DH) { + if (EVP_PKEY_id(k) == EVP_PKEY_DH) { /* No idea */ X509err(X509_F_X509_REQ_CHECK_PRIVATE_KEY, X509_R_CANT_CHECK_DH_KEY);