summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2021-05-28 14:45:43 +1000
committerPauli <pauli@openssl.org>2021-05-29 17:17:12 +1000
commit23e97567be012ff1b5082bf149810c72816c29bd (patch)
treea2b2825814e43a5c6fe641bb4fcea235cbf4a46f
parent508258caa0299481d07d2118da5fe1524de0b6fd (diff)
downloadopenssl-new-23e97567be012ff1b5082bf149810c72816c29bd.tar.gz
test: add zero strenght arguments to BN and RAND RNG calls
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15513)
-rw-r--r--test/cmp_client_test.c2
-rw-r--r--test/cmp_msg_test.c4
-rw-r--r--test/sslapitest.c2
-rw-r--r--test/tls-provider.c4
4 files changed, 6 insertions, 6 deletions
diff --git a/test/cmp_client_test.c b/test/cmp_client_test.c
index 3d9b37b3a2..d181a03d19 100644
--- a/test/cmp_client_test.c
+++ b/test/cmp_client_test.c
@@ -373,7 +373,7 @@ int setup_tests(void)
|| !TEST_ptr(server_cert = load_cert_pem(server_cert_f, libctx))
|| !TEST_ptr(client_key = load_pkey_pem(client_key_f, libctx))
|| !TEST_ptr(client_cert = load_cert_pem(client_cert_f, libctx))
- || !TEST_int_eq(1, RAND_bytes_ex(libctx, ref, sizeof(ref)))) {
+ || !TEST_int_eq(1, RAND_bytes_ex(libctx, ref, sizeof(ref), 0))) {
cleanup_tests();
return 0;
}
diff --git a/test/cmp_msg_test.c b/test/cmp_msg_test.c
index fd5337b208..a9a858c07a 100644
--- a/test/cmp_msg_test.c
+++ b/test/cmp_msg_test.c
@@ -149,7 +149,7 @@ static int test_cmp_create_ir_protection_set(void)
fixture->bodytype = OSSL_CMP_PKIBODY_IR;
fixture->err_code = -1;
fixture->expected = 1;
- if (!TEST_int_eq(1, RAND_bytes_ex(libctx, secret, sizeof(secret)))
+ if (!TEST_int_eq(1, RAND_bytes_ex(libctx, secret, sizeof(secret), 0))
|| !TEST_true(SET_OPT_UNPROTECTED_SEND(ctx, 0))
|| !TEST_true(set1_newPkey(ctx, newkey))
|| !TEST_true(OSSL_CMP_CTX_set1_secretValue(ctx, secret,
@@ -566,7 +566,7 @@ int setup_tests(void)
if (!TEST_ptr(newkey = load_pkey_pem(newkey_f, libctx))
|| !TEST_ptr(cert = load_cert_pem(server_cert_f, libctx))
- || !TEST_int_eq(1, RAND_bytes_ex(libctx, ref, sizeof(ref)))) {
+ || !TEST_int_eq(1, RAND_bytes_ex(libctx, ref, sizeof(ref), 0))) {
cleanup_tests();
return 0;
}
diff --git a/test/sslapitest.c b/test/sslapitest.c
index 28e9852dbb..b687ab9e22 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -1294,7 +1294,7 @@ static int test_ktls_sendfile(int tls_version, const char *cipher)
|| !TEST_true(BIO_get_ktls_send(serverssl->wbio)))
goto end;
- if (!TEST_true(RAND_bytes_ex(libctx, buf, SENDFILE_SZ)))
+ if (!TEST_true(RAND_bytes_ex(libctx, buf, SENDFILE_SZ, 0)))
goto end;
out = BIO_new_file(tmpfilename, "wb");
diff --git a/test/tls-provider.c b/test/tls-provider.c
index 20360d469e..f8eeaeb363 100644
--- a/test/tls-provider.c
+++ b/test/tls-provider.c
@@ -640,7 +640,7 @@ static void *xor_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg)
return NULL;
if ((gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
- if (RAND_bytes_ex(gctx->libctx, key->privkey, XOR_KEY_SIZE) <= 0) {
+ if (RAND_bytes_ex(gctx->libctx, key->privkey, XOR_KEY_SIZE, 0) <= 0) {
OPENSSL_free(key);
return NULL;
}
@@ -813,7 +813,7 @@ unsigned int randomize_tls_group_id(OSSL_LIB_CTX *libctx)
int i;
retry:
- if (!RAND_bytes_ex(libctx, (unsigned char *)&group_id, sizeof(group_id)))
+ if (!RAND_bytes_ex(libctx, (unsigned char *)&group_id, sizeof(group_id), 0))
return 0;
/*
* Ensure group_id is within the IANA Reserved for private use range