#include <library.h>
#include <utils/debug.h>
-#include <collections/array.h>
#include <threading/thread.h>
#include <threading/mutex.h>
#include <threading/thread_value.h>
* public functions
*/
openssl_plugin_t public;
-
-#if OPENSSL_VERSION_NUMBER >= 0x30000000L
- /**
- * Loaded providers
- */
- array_t *providers;
-#endif
};
/**
METHOD(plugin_t, destroy, void,
private_openssl_plugin_t *this)
{
-#if OPENSSL_VERSION_NUMBER >= 0x30000000L
- OSSL_PROVIDER *provider;
- while (array_remove(this->providers, ARRAY_TAIL, &provider))
- {
- OSSL_PROVIDER_unload(provider);
- }
- array_destroy(this->providers);
-#endif /* OPENSSL_VERSION_NUMBER */
-
/* OpenSSL 1.1.0 cleans up itself at exit and while OPENSSL_cleanup() exists we
* can't call it as we couldn't re-initialize the library (as required by the
* unit tests and the Android app) */
DBG1(DBG_LIB, "unable to load OpenSSL FIPS provider");
return NULL;
}
- array_insert_create(&this->providers, ARRAY_TAIL, fips);
/* explicitly load the base provider containing encoding functions */
- array_insert_create(&this->providers, ARRAY_TAIL,
- OSSL_PROVIDER_load(NULL, "base"));
+ OSSL_PROVIDER_load(NULL, "base");
}
else if (lib->settings->get_bool(lib->settings, "%s.plugins.openssl.load_legacy",
TRUE, lib->ns))
{
/* load the legacy provider for algorithms like MD4, DES, BF etc. */
- array_insert_create(&this->providers, ARRAY_TAIL,
- OSSL_PROVIDER_load(NULL, "legacy"));
+ OSSL_PROVIDER_load(NULL, "legacy");
/* explicitly load the default provider, as mentioned by crypto(7) */
- array_insert_create(&this->providers, ARRAY_TAIL,
- OSSL_PROVIDER_load(NULL, "default"));
+ OSSL_PROVIDER_load(NULL, "default");
}
ossl_provider_names_t data = {};
OSSL_PROVIDER_do_all(NULL, concat_ossl_providers, &data);