[openssl] openssl-3.0 update
Dr. Paul Dale
pauli at openssl.org
Wed Jan 12 00:00:50 UTC 2022
The branch openssl-3.0 has been updated
via b64b8e39cfb5e89c0af8b9127a414cf529192846 (commit)
from 56de678e426e619f01e70247fa669c45986aa205 (commit)
- Log -----------------------------------------------------------------
commit b64b8e39cfb5e89c0af8b9127a414cf529192846
Author: Matt Caswell <matt at openssl.org>
Date: Mon Jan 10 14:46:46 2022 +0000
Ensure we test fetching encoder/decoder/store loader with a query string
Although we had a test for fetching an encoder/decoder/store loader it
did not use a query string. The issue highlighted by #17456 only occurs
if a query string is used.
Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Richard Levitte <levitte at openssl.org>
Reviewed-by: Paul Dale <pauli at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17459)
-----------------------------------------------------------------------
Summary of changes:
test/provfetchtest.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/test/provfetchtest.c b/test/provfetchtest.c
index 95ae87910e..aae9b40057 100644
--- a/test/provfetchtest.c
+++ b/test/provfetchtest.c
@@ -225,6 +225,7 @@ static int dummy_provider_init(const OSSL_CORE_HANDLE *handle,
* Test 1: Encoder
* Test 2: Store loader
* Test 3: EVP_RAND
+ * Test 4-7: As above, but additionally with a query string
*/
static int fetch_test(int tst)
{
@@ -236,6 +237,7 @@ static int fetch_test(int tst)
OSSL_STORE_LOADER *loader = NULL;
int testresult = 0;
unsigned char buf[32];
+ int query = tst > 3;
if (!TEST_ptr(libctx))
goto err;
@@ -246,24 +248,29 @@ static int fetch_test(int tst)
|| !TEST_ptr(dummyprov = OSSL_PROVIDER_load(libctx, "dummy-prov")))
goto err;
- switch(tst) {
+ switch (tst % 4) {
case 0:
- decoder = OSSL_DECODER_fetch(libctx, "DUMMY", NULL);
+ decoder = OSSL_DECODER_fetch(libctx, "DUMMY",
+ query ? "provider=dummy" : NULL);
if (!TEST_ptr(decoder))
goto err;
break;
case 1:
- encoder = OSSL_ENCODER_fetch(libctx, "DUMMY", NULL);
+ encoder = OSSL_ENCODER_fetch(libctx, "DUMMY",
+ query ? "provider=dummy" : NULL);
if (!TEST_ptr(encoder))
goto err;
break;
case 2:
- loader = OSSL_STORE_LOADER_fetch(libctx, "DUMMY", NULL);
+ loader = OSSL_STORE_LOADER_fetch(libctx, "DUMMY",
+ query ? "provider=dummy" : NULL);
if (!TEST_ptr(loader))
goto err;
break;
case 3:
- if (!TEST_true(RAND_set_DRBG_type(libctx, "DUMMY", NULL, NULL, NULL))
+ if (!TEST_true(RAND_set_DRBG_type(libctx, "DUMMY",
+ query ? "provider=dummy" : NULL,
+ NULL, NULL))
|| !TEST_int_ge(RAND_bytes_ex(libctx, buf, sizeof(buf), 0), 1))
goto err;
break;
@@ -284,7 +291,7 @@ static int fetch_test(int tst)
int setup_tests(void)
{
- ADD_ALL_TESTS(fetch_test, 4);
+ ADD_ALL_TESTS(fetch_test, 8);
return 1;
}
More information about the openssl-commits
mailing list