test/params_api_test.c: Correct the checks of OSSL_PARAM_set_BN()
authorRichard Levitte <levitte@openssl.org>
Fri, 1 Nov 2019 21:18:38 +0000 (22:18 +0100)
committerPatrick Steuer <patrick.steuer@de.ibm.com>
Sun, 3 Nov 2019 10:19:04 +0000 (11:19 +0100)
Now, the returned size check matches the check made for all other
integer types.

Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com>
(Merged from https://github.com/openssl/openssl/pull/10326)

test/params_api_test.c

index 616035ecc4458b830e3a79fc9da9dd4a6db38bb5..c403f39abdd69f9415807a71ea445e51c2a86fe6 100644 (file)
@@ -548,7 +548,7 @@ static int test_param_construct(void)
     if (!TEST_ptr(cp = OSSL_PARAM_locate(params, "bignum"))
         || !TEST_ptr(bn = BN_lebin2bn(bn_val, (int)sizeof(bn_val), NULL))
         || !TEST_true(OSSL_PARAM_set_BN(cp, bn))
-        || !TEST_size_t_eq(cp->return_size, sizeof(bn_val)))
+        || !TEST_size_t_eq(cp->data_size, cp->return_size))
         goto err;
     /* Match the return size to avoid trailing garbage bytes */
     cp->data_size = cp->return_size;