diff options
author | Peiwei Hu <jlu.hpw@foxmail.com> | 2022-05-28 23:46:33 +0800 |
---|---|---|
committer | Todd Short <todd.short@me.com> | 2022-06-02 10:36:56 -0400 |
commit | c2f7614fb7b93fe3792068077ff01384f42f39bc (patch) | |
tree | 2a2a08618c7a1083c49010f6831ef6242f138909 /test/wpackettest.c | |
parent | 163bf682fd93971d07e66e3da339c229b86dc849 (diff) | |
download | openssl-c2f7614fb7b93fe3792068077ff01384f42f39bc.tar.gz |
Fix the checks of RAND_bytes
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/18424)
Diffstat (limited to 'test/wpackettest.c')
-rw-r--r-- | test/wpackettest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/wpackettest.c b/test/wpackettest.c index a90c9a1553..0aea34188b 100644 --- a/test/wpackettest.c +++ b/test/wpackettest.c @@ -410,7 +410,7 @@ static int test_WPACKET_init_der(void) return cleanup(&pkt); /* Generate random packet data for test */ - if (!TEST_true(RAND_bytes(&testdata2[3], sizeof(testdata2) - 3))) + if (!TEST_int_gt(RAND_bytes(&testdata2[3], sizeof(testdata2) - 3), 0)) return 0; /* @@ -581,7 +581,7 @@ static int test_WPACKET_quic_vlint_random(void) PACKET read_pkt = {0}; for (i = 0; i < 10000; ++i) { - if (!TEST_true(RAND_bytes(rand_data, sizeof(rand_data)))) + if (!TEST_int_gt(RAND_bytes(rand_data, sizeof(rand_data)), 0)) return cleanup(&pkt); expected = *(uint64_t*)rand_data; |