summaryrefslogtreecommitdiffstats
path: root/crypto/evp/asymcipher.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/evp/asymcipher.c')
-rw-r--r--crypto/evp/asymcipher.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/crypto/evp/asymcipher.c b/crypto/evp/asymcipher.c
index b30b05bfa9..e74aafcb13 100644
--- a/crypto/evp/asymcipher.c
+++ b/crypto/evp/asymcipher.c
@@ -16,7 +16,8 @@
#include "internal/provider.h"
#include "evp_local.h"
-static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation)
+static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation,
+ const OSSL_PARAM params[])
{
int ret = 0;
void *provkey = NULL;
@@ -111,7 +112,7 @@ static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation)
ret = -2;
goto err;
}
- ret = cipher->encrypt_init(ctx->op.ciph.ciphprovctx, provkey);
+ ret = cipher->encrypt_init(ctx->op.ciph.ciphprovctx, provkey, params);
break;
case EVP_PKEY_OP_DECRYPT:
if (cipher->decrypt_init == NULL) {
@@ -119,7 +120,7 @@ static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation)
ret = -2;
goto err;
}
- ret = cipher->decrypt_init(ctx->op.ciph.ciphprovctx, provkey);
+ ret = cipher->decrypt_init(ctx->op.ciph.ciphprovctx, provkey, params);
break;
default:
ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
@@ -168,7 +169,12 @@ static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation)
int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx)
{
- return evp_pkey_asym_cipher_init(ctx, EVP_PKEY_OP_ENCRYPT);
+ return evp_pkey_asym_cipher_init(ctx, EVP_PKEY_OP_ENCRYPT, NULL);
+}
+
+int EVP_PKEY_encrypt_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[])
+{
+ return evp_pkey_asym_cipher_init(ctx, EVP_PKEY_OP_ENCRYPT, params);
}
int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx,
@@ -205,7 +211,12 @@ int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx,
int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx)
{
- return evp_pkey_asym_cipher_init(ctx, EVP_PKEY_OP_DECRYPT);
+ return evp_pkey_asym_cipher_init(ctx, EVP_PKEY_OP_DECRYPT, NULL);
+}
+
+int EVP_PKEY_decrypt_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[])
+{
+ return evp_pkey_asym_cipher_init(ctx, EVP_PKEY_OP_DECRYPT, params);
}
int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx,