summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-12-16 15:15:06 +0100
committerRichard Levitte <levitte@openssl.org>2020-12-17 12:02:08 +0100
commit390f9bad69ce19f601abf131ceabf90aedc0d3d5 (patch)
tree33336c07e8a35b8aa45dc7b6d9df6705d6a94643 /test
parent6963979f5c0f95b2152ef74645faa7344e33284d (diff)
CORE: Separate OSSL_PROVIDER activation from OSSL_PROVIDER reference
This introduces a separate activation counter, and the function ossl_provider_deactivate() for provider deactivation. Something to be noted is that if the reference count goes down to zero, we don't care if the activation count is non-zero (i.e. someone forgot to call ossl_provider_deactivate()). Since there are no more references to the provider, it doesn't matter. The important thing is that deactivation doesn't remove the provider as long as there are references to it, for example because there are live methods associated with that provider, but still makes the provider unavailable to create new methods from. Fixes #13503 Fixes #12157 Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13661)
Diffstat (limited to 'test')
-rw-r--r--test/provider_internal_test.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/provider_internal_test.c b/test/provider_internal_test.c
index 478f28182d..4b2b6d5349 100644
--- a/test/provider_internal_test.c
+++ b/test/provider_internal_test.c
@@ -30,7 +30,8 @@ static int test_provider(OSSL_PROVIDER *prov, const char *expected_greeting)
&& TEST_true(ossl_provider_get_params(prov, greeting_request))
&& TEST_ptr(greeting = greeting_request[0].data)
&& TEST_size_t_gt(greeting_request[0].data_size, 0)
- && TEST_str_eq(greeting, expected_greeting);
+ && TEST_str_eq(greeting, expected_greeting)
+ && TEST_true(ossl_provider_deactivate(prov));
TEST_info("Got this greeting: %s\n", greeting);
ossl_provider_free(prov);