diff options
author | Ingo Franzki <ifranzki@linux.ibm.com> | 2023-01-18 11:24:16 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-01-23 10:34:36 +0100 |
commit | 1d857945324810f43a302c9d062c617207093387 (patch) | |
tree | cfa30299808b11e3ae6f268fdd201a32f94bcaa6 /providers/implementations | |
parent | c3bd630df0c3630c66155fb8c4baf54810d24695 (diff) |
Allow OSSL_SIGNATURE_PARAM_NONCE_TYPE to be retrieved
Context parameter OSSL_SIGNATURE_PARAM_NONCE_TYPE can now also be
retrieved for ECDSA and DSA.
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20070)
Diffstat (limited to 'providers/implementations')
-rw-r--r-- | providers/implementations/signature/dsa_sig.c | 5 | ||||
-rw-r--r-- | providers/implementations/signature/ecdsa_sig.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/providers/implementations/signature/dsa_sig.c b/providers/implementations/signature/dsa_sig.c index 6393dd4dec..211faa8da9 100644 --- a/providers/implementations/signature/dsa_sig.c +++ b/providers/implementations/signature/dsa_sig.c @@ -461,12 +461,17 @@ static int dsa_get_ctx_params(void *vpdsactx, OSSL_PARAM *params) if (p != NULL && !OSSL_PARAM_set_utf8_string(p, pdsactx->mdname)) return 0; + p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_NONCE_TYPE); + if (p != NULL && !OSSL_PARAM_set_uint(p, pdsactx->nonce_type)) + return 0; + return 1; } static const OSSL_PARAM known_gettable_ctx_params[] = { OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0), OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0), + OSSL_PARAM_uint(OSSL_SIGNATURE_PARAM_NONCE_TYPE, NULL), OSSL_PARAM_END }; diff --git a/providers/implementations/signature/ecdsa_sig.c b/providers/implementations/signature/ecdsa_sig.c index 9c4b6d3638..e13be6fdd3 100644 --- a/providers/implementations/signature/ecdsa_sig.c +++ b/providers/implementations/signature/ecdsa_sig.c @@ -467,6 +467,10 @@ static int ecdsa_get_ctx_params(void *vctx, OSSL_PARAM *params) : EVP_MD_get0_name(ctx->md))) return 0; + p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_NONCE_TYPE); + if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->nonce_type)) + return 0; + return 1; } @@ -474,6 +478,7 @@ static const OSSL_PARAM known_gettable_ctx_params[] = { OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0), OSSL_PARAM_size_t(OSSL_SIGNATURE_PARAM_DIGEST_SIZE, NULL), OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0), + OSSL_PARAM_uint(OSSL_SIGNATURE_PARAM_NONCE_TYPE, NULL), OSSL_PARAM_END }; |