diff options
author | Pauli <ppzgs1@gmail.com> | 2021-03-02 20:20:25 +1000 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-03-12 08:27:11 +1000 |
commit | 4b58d9b41b7e43b2f6f4171df9e84bf6a0866b99 (patch) | |
tree | 642bfd940bca4bd97a7b2f6032965382b3be2020 /crypto/evp/asymcipher.c | |
parent | 480c8ef8b5804b15ef97320290bc326adfaa0f84 (diff) |
evp: add params arguments to init functions
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14383)
Diffstat (limited to 'crypto/evp/asymcipher.c')
-rw-r--r-- | crypto/evp/asymcipher.c | 21 |
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, |