Add a test to check having a provider loaded without a groups still works
authorMatt Caswell <matt@openssl.org>
Fri, 26 Jun 2020 19:49:19 +0000 (20:49 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 8 Jul 2020 07:55:56 +0000 (08:55 +0100)
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 <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12292)

test/sslapitest.c

index 182984ecb17a52bd0b9289c14f77576d5fac1ba8..afc4ea8d40dd909d77df7d5740b927a9d7dd7937 100644 (file)
@@ -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;
 }