Browse Source

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)
master
Pauli 7 months ago
parent
commit
23e97567be
4 changed files with 6 additions and 6 deletions
  1. +1
    -1
      test/cmp_client_test.c
  2. +2
    -2
      test/cmp_msg_test.c
  3. +1
    -1
      test/sslapitest.c
  4. +2
    -2
      test/tls-provider.c

+ 1
- 1
test/cmp_client_test.c View File

@ -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;
}


+ 2
- 2
test/cmp_msg_test.c View File

@ -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;
}


+ 1
- 1
test/sslapitest.c View File

@ -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");


+ 2
- 2
test/tls-provider.c View File

@ -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


Loading…
Cancel
Save