Add functions to see if a provider is available for use.

Public function OSSL_PROVIDER_available() takes a library context and
a provider name, and returns 1 if it's available for use, i.e. if it's
possible to fetch implementations from it, otherwise 0.

Internal function ossl_provider_activated() returns 1 if the given
OSSL_PROVIDER is activated, otherwise 0.

To make this possible, the activation of fallbacks got refactored out
to a separate function, which ended up simplifying the code.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9398)
This commit is contained in:
Richard Levitte 2019-07-17 11:29:04 +02:00
parent 166c0b98fd
commit 36f5ec55e6
9 changed files with 101 additions and 45 deletions

View file

@ -9,6 +9,11 @@
Changes between 1.1.1 and 3.0.0 [xx XXX xxxx]
*) Introduced a new function, OSSL_PROVIDER_available(), which can be used
to check if a named provider is loaded and available. When called, it
will also activate all fallback providers if such are still present.
[Richard Levitte]
*) Enforce a minimum DH modulus size of 512 bits.
[Bernd Edlinger]