Thanks to github.com/Jkinglyf
This commit is contained in:
Zhi Guan
2016-05-30 12:50:06 +02:00
parent ee4384daeb
commit 2bf25bd29f
55 changed files with 2044 additions and 1672 deletions

View File

@@ -82,12 +82,13 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
if (!priv)
return 1;
if (priv->type != EVP_PKEY_RSA) {
if ((EVP_PKEY_base_id(priv) != EVP_PKEY_RSA) &&
(EVP_PKEY_base_id(priv) != EVP_PKEY_EC)) {
EVPerr(EVP_F_EVP_OPENINIT, EVP_R_PUBLIC_KEY_NOT_RSA);
goto err;
}
size = RSA_size(priv->pkey.rsa);
size = EVP_PKEY_size(priv);
key = (unsigned char *)OPENSSL_malloc(size + 2);
if (key == NULL) {
/* ERROR */