mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-13 11:56:28 +08:00
Bug fix
Thanks to github.com/Jkinglyf
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user