From: Matt Caswell Date: Fri, 26 Jun 2020 19:49:19 +0000 (+0100) Subject: Add a test to check having a provider loaded without a groups still works X-Git-Tag: openssl-3.0.0-alpha5~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=146aebc6a082ac4343b79dcf18ef86e853b85d85;p=thirdparty%2Fopenssl.git Add a test to check having a provider loaded without a groups still works As long as we have at least one provider loaded which offers some groups, it doesn't matter if we have others loaded that don't. Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/12292) --- diff --git a/test/sslapitest.c b/test/sslapitest.c index 182984ecb17..afc4ea8d40d 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -8235,8 +8235,10 @@ static int test_pluggable_group(void) SSL *clientssl = NULL, *serverssl = NULL; int testresult = 0; OSSL_PROVIDER *tlsprov = OSSL_PROVIDER_load(libctx, "tls-provider"); + /* Check that we are not impacted by a provider without any groups */ + OSSL_PROVIDER *legacyprov = OSSL_PROVIDER_load(libctx, "legacy"); - if (!TEST_ptr(tlsprov)) + if (!TEST_ptr(tlsprov) || !TEST_ptr(legacyprov)) goto end; if (!TEST_true(create_ssl_ctx_pair(libctx, TLS_server_method(), @@ -8263,6 +8265,7 @@ static int test_pluggable_group(void) SSL_CTX_free(sctx); SSL_CTX_free(cctx); OSSL_PROVIDER_unload(tlsprov); + OSSL_PROVIDER_unload(legacyprov); return testresult; }