summaryrefslogtreecommitdiff
path: root/crypto/evp/p_dec.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/evp/p_dec.c')
-rw-r--r--crypto/evp/p_dec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/evp/p_dec.c b/crypto/evp/p_dec.c
index f232934b93..218c674bc3 100644
--- a/crypto/evp/p_dec.c
+++ b/crypto/evp/p_dec.c
@@ -72,7 +72,7 @@ int EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl,
int ret = -1;
#ifndef OPENSSL_NO_RSA
- if (priv->type != EVP_PKEY_RSA) {
+ if (EVP_PKEY_id(priv) != EVP_PKEY_RSA) {
#endif
EVPerr(EVP_F_EVP_PKEY_DECRYPT_OLD, EVP_R_PUBLIC_KEY_NOT_RSA);
#ifndef OPENSSL_NO_RSA
@@ -80,7 +80,8 @@ int EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl,
}
ret =
- RSA_private_decrypt(ekl, ek, key, priv->pkey.rsa, RSA_PKCS1_PADDING);
+ RSA_private_decrypt(ekl, ek, key, EVP_PKEY_get0_RSA(priv),
+ RSA_PKCS1_PADDING);
err:
#endif
return (ret);