From: John Baldwin Date: Wed, 5 Aug 2020 23:24:24 +0000 (-0700) Subject: Use global 'libctx' with RAND_bytes_ex to generate sendfile temp data. X-Git-Tag: openssl-3.0.0-alpha7~423 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=72c1e37421ffe9a4db4bba46f3d736dbc227c255;p=thirdparty%2Fopenssl.git Use global 'libctx' with RAND_bytes_ex to generate sendfile temp data. While here, check for failure from RAND_bytes_ex as well. Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/12111) --- diff --git a/test/sslapitest.c b/test/sslapitest.c index cbb488ca261..240cadde90e 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -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;