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/signature.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/signature.c')
-rw-r--r-- | crypto/evp/signature.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/crypto/evp/signature.c b/crypto/evp/signature.c index bb99ff3095..09cf4539d9 100644 --- a/crypto/evp/signature.c +++ b/crypto/evp/signature.c @@ -361,7 +361,8 @@ const OSSL_PARAM *EVP_SIGNATURE_settable_ctx_params(const EVP_SIGNATURE *sig) return sig->settable_ctx_params(NULL, provctx); } -static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, int operation) +static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, int operation, + const OSSL_PARAM params[]) { int ret = 0; void *provkey = NULL; @@ -456,7 +457,7 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, int operation) ret = -2; goto err; } - ret = signature->sign_init(ctx->op.sig.sigprovctx, provkey); + ret = signature->sign_init(ctx->op.sig.sigprovctx, provkey, params); break; case EVP_PKEY_OP_VERIFY: if (signature->verify_init == NULL) { @@ -464,7 +465,7 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, int operation) ret = -2; goto err; } - ret = signature->verify_init(ctx->op.sig.sigprovctx, provkey); + ret = signature->verify_init(ctx->op.sig.sigprovctx, provkey, params); break; case EVP_PKEY_OP_VERIFYRECOVER: if (signature->verify_recover_init == NULL) { @@ -472,7 +473,8 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, int operation) ret = -2; goto err; } - ret = signature->verify_recover_init(ctx->op.sig.sigprovctx, provkey); + ret = signature->verify_recover_init(ctx->op.sig.sigprovctx, provkey, + params); break; default: ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR); @@ -540,7 +542,12 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, int operation) int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx) { - return evp_pkey_signature_init(ctx, EVP_PKEY_OP_SIGN); + return evp_pkey_signature_init(ctx, EVP_PKEY_OP_SIGN, NULL); +} + +int EVP_PKEY_sign_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[]) +{ + return evp_pkey_signature_init(ctx, EVP_PKEY_OP_SIGN, params); } int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, @@ -579,7 +586,12 @@ int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx) { - return evp_pkey_signature_init(ctx, EVP_PKEY_OP_VERIFY); + return evp_pkey_signature_init(ctx, EVP_PKEY_OP_VERIFY, NULL); +} + +int EVP_PKEY_verify_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[]) +{ + return evp_pkey_signature_init(ctx, EVP_PKEY_OP_VERIFY, params); } int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, @@ -616,7 +628,13 @@ int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx) { - return evp_pkey_signature_init(ctx, EVP_PKEY_OP_VERIFYRECOVER); + return evp_pkey_signature_init(ctx, EVP_PKEY_OP_VERIFYRECOVER, NULL); +} + +int EVP_PKEY_verify_recover_init_ex(EVP_PKEY_CTX *ctx, + const OSSL_PARAM params[]) +{ + return evp_pkey_signature_init(ctx, EVP_PKEY_OP_VERIFYRECOVER, params); } int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, |