diff options
author | Richard Levitte <levitte@openssl.org> | 2020-01-08 03:50:33 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-01-17 09:04:04 +0100 |
commit | 81a624f2c215eb9def0917184b026b2e2db2dd54 (patch) | |
tree | 86fa131c7a2bf9007e96fe61a96db97cf29c5048 /test/evp_pkey_provided_test.c | |
parent | 9e5aaf78868ca2f4d65d3bb1f9246659a6522241 (diff) |
TEST: Adapt test/evp_pkey_provided_test.c to check the key size
This is for the case where we build keys from user data
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/10778)
Diffstat (limited to 'test/evp_pkey_provided_test.c')
-rw-r--r-- | test/evp_pkey_provided_test.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/evp_pkey_provided_test.c b/test/evp_pkey_provided_test.c index 029a8e425a..8101585d95 100644 --- a/test/evp_pkey_provided_test.c +++ b/test/evp_pkey_provided_test.c @@ -126,7 +126,10 @@ static int test_fromdata_rsa(void) goto err; if (!TEST_true(EVP_PKEY_key_fromdata_init(ctx)) - || !TEST_true(EVP_PKEY_fromdata(ctx, &pk, fromdata_params))) + || !TEST_true(EVP_PKEY_fromdata(ctx, &pk, fromdata_params)) + || !TEST_int_eq(EVP_PKEY_bits(pk), 32) + || !TEST_int_eq(EVP_PKEY_security_bits(pk), 8) + || !TEST_int_eq(EVP_PKEY_size(pk), 4)) goto err; ret = test_print_key_using_pem(pk) @@ -176,7 +179,10 @@ static int test_fromdata_dh(void) goto err; if (!TEST_true(EVP_PKEY_key_fromdata_init(ctx)) - || !TEST_true(EVP_PKEY_fromdata(ctx, &pk, fromdata_params))) + || !TEST_true(EVP_PKEY_fromdata(ctx, &pk, fromdata_params)) + || !TEST_int_eq(EVP_PKEY_bits(pk), 32) + || !TEST_int_eq(EVP_PKEY_security_bits(pk), 0) /* Missing Q */ + || !TEST_int_eq(EVP_PKEY_size(pk), 4)) goto err; ret = test_print_key_using_pem(pk) |