Use global 'libctx' with RAND_bytes_ex to generate sendfile temp data.
authorJohn Baldwin <jhb@FreeBSD.org>
Wed, 5 Aug 2020 23:24:24 +0000 (16:24 -0700)
committerMatt Caswell <matt@openssl.org>
Mon, 31 Aug 2020 08:34:19 +0000 (09:34 +0100)
While here, check for failure from RAND_bytes_ex as well.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12111)

test/sslapitest.c

index cbb488ca261c6527d784bc4f631e6a13bf1d935e..240cadde90e24f626092241a6ef09afb652e93e1 100644 (file)
@@ -1118,7 +1118,9 @@ static int test_ktls_sendfile(int tls_version, const char *cipher)
         || !TEST_true(BIO_get_ktls_send(serverssl->wbio)))
         goto end;
 
-    RAND_bytes(buf, SENDFILE_SZ);
+    if (!TEST_true(RAND_bytes_ex(libctx, buf, SENDFILE_SZ)))
+        goto end;
+
     out = BIO_new_file(tmpfilename, "wb");
     if (!TEST_ptr(out))
         goto end;