diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-05-07 07:31:05 +0200 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-05-07 07:31:05 +0200 |
commit | 5e77b79a8c47f0801f656cfccfcbaaa3ca1035b4 (patch) | |
tree | f93d6603fd386aa19d5536a0a66f5b882aebc7cf /test/dsatest.c | |
parent | Remove cipher table lookup from EVP_CipherInit_ex (diff) | |
download | openssl-5e77b79a8c47f0801f656cfccfcbaaa3ca1035b4.tar.xz openssl-5e77b79a8c47f0801f656cfccfcbaaa3ca1035b4.zip |
Remove gen_get_params & gen_gettable_params from keygen operation
EVP_PKEY_CTX_gettable_params() was missing code for the keygen operation.
After adding it it was noticed that it is probably not required for this type, so instead
the gen_get_params and gen_gettable_params have been remnoved from the provider interface.
gen_get_params was only implemented for ec to get the curve name. This seems redundant
since normally you would set parameters into the keygen_init() and then generate a key.
Normally you would expect to extract data from the key - not the object that we just set up
to do the keygen.
Added a simple settable and gettable test into a test that does keygen.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11683)
Diffstat (limited to '')
-rw-r--r-- | test/dsatest.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/dsatest.c b/test/dsatest.c index eac4a17ed1..c9857d6c67 100644 --- a/test/dsatest.c +++ b/test/dsatest.c @@ -155,6 +155,7 @@ static int dsa_keygen_test(void) unsigned char seed_out[32]; char group_out[32]; size_t len = 0; + const OSSL_PARAM *settables = NULL; static const unsigned char seed_data[] = { 0xa6, 0xf5, 0x28, 0x8c, 0x50, 0x77, 0xa5, 0x68, 0x6d, 0x3a, 0xf5, 0xf1, 0xc6, 0x4c, 0xdc, 0x35, @@ -244,6 +245,10 @@ static int dsa_keygen_test(void) goto end; if (!TEST_ptr(pg_ctx = EVP_PKEY_CTX_new_from_name(NULL, "DSA", NULL)) || !TEST_int_gt(EVP_PKEY_paramgen_init(pg_ctx), 0) + || !TEST_ptr_null(EVP_PKEY_CTX_gettable_params(pg_ctx)) + || !TEST_ptr(settables = EVP_PKEY_CTX_settable_params(pg_ctx)) + || !TEST_ptr(OSSL_PARAM_locate_const(settables, + OSSL_PKEY_PARAM_FFC_PBITS)) || !TEST_true(EVP_PKEY_CTX_set_dsa_paramgen_bits(pg_ctx, 2048)) || !TEST_true(EVP_PKEY_CTX_set_dsa_paramgen_q_bits(pg_ctx, 224)) || !TEST_true(EVP_PKEY_CTX_set_dsa_paramgen_seed(pg_ctx, seed_data, |