*/
#include <stdio.h>
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
#ifndef OPENSSL_NO_RSA
int i, size = 0, ret = 0;
if (type) {
- EVP_CIPHER_CTX_init(ctx);
+ EVP_CIPHER_CTX_reset(ctx);
if (!EVP_DecryptInit_ex(ctx, type, NULL, NULL, NULL))
return 0;
}
if (!priv)
return 1;
- if (priv->type != EVP_PKEY_RSA) {
+ if (EVP_PKEY_id(priv) != EVP_PKEY_RSA) {
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 = OPENSSL_malloc(size + 2);
if (key == NULL) {
/* ERROR */