summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-07-17 11:29:04 +0200
committerRichard Levitte <levitte@openssl.org>2019-07-26 18:14:41 +0200
commit36f5ec55e69716024f70df53074a2871e091a3e1 (patch)
treef8b0a1f6b8a846e6124ac91f50149f2f805395c4 /doc
parent166c0b98fd6e8b1bb341397642527a9396468f6c (diff)
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)
Diffstat (limited to 'doc')
-rw-r--r--doc/internal/man3/ossl_provider_new.pod11
-rw-r--r--doc/man3/OSSL_PROVIDER.pod17
2 files changed, 24 insertions, 4 deletions
diff --git a/doc/internal/man3/ossl_provider_new.pod b/doc/internal/man3/ossl_provider_new.pod
index 426d95393d..255f194e03 100644
--- a/doc/internal/man3/ossl_provider_new.pod
+++ b/doc/internal/man3/ossl_provider_new.pod
@@ -6,7 +6,7 @@ ossl_provider_find, ossl_provider_new, ossl_provider_up_ref,
ossl_provider_free,
ossl_provider_set_fallback, ossl_provider_set_module_path,
ossl_provider_add_parameter,
-ossl_provider_activate,
+ossl_provider_activate, ossl_provider_available,
ossl_provider_ctx,
ossl_provider_forall_loaded,
ossl_provider_name, ossl_provider_dso,
@@ -33,6 +33,8 @@ ossl_provider_get_params, ossl_provider_query_operation
/* Load and initialize the Provider */
int ossl_provider_activate(OSSL_PROVIDER *prov);
+ /* Check if provider is available */
+ int ossl_provider_available(OSSL_PROVIDER *prov);
/* Return pointer to the provider's context */
void *ossl_provider_ctx(const OSSL_PROVIDER *prov);
@@ -148,6 +150,10 @@ be located in that module, and called.
=back
+ossl_provider_available() activates all fallbacks if no provider is
+activated yet, then checks if given provider object I<prov> is
+activated.
+
ossl_provider_ctx() returns a context created by the provider.
Outside of the provider, it's completely opaque, but it needs to be
passed back to some of the provider functions.
@@ -228,6 +234,9 @@ ossl_provider_free() doesn't return any value.
ossl_provider_set_module_path(), ossl_provider_set_fallback() and
ossl_provider_activate() return 1 on success, or 0 on error.
+ossl_provider_available() return 1 if the provider is available,
+otherwise 0.
+
ossl_provider_name(), ossl_provider_dso(),
ossl_provider_module_name(), and ossl_provider_module_path() return a
pointer to their respective data if it's available, otherwise NULL
diff --git a/doc/man3/OSSL_PROVIDER.pod b/doc/man3/OSSL_PROVIDER.pod
index 1453fcc50a..5608bf394c 100644
--- a/doc/man3/OSSL_PROVIDER.pod
+++ b/doc/man3/OSSL_PROVIDER.pod
@@ -3,6 +3,7 @@
=head1 NAME
OSSL_PROVIDER, OSSL_PROVIDER_load, OSSL_PROVIDER_unload,
+OSSL_PROVIDER_available,
OSSL_PROVIDER_get_param_types, OSSL_PROVIDER_get_params,
OSSL_PROVIDER_add_builtin, OSSL_PROVIDER_name - provider routines
@@ -12,13 +13,14 @@ OSSL_PROVIDER_add_builtin, OSSL_PROVIDER_name - provider routines
typedef struct ossl_provider_st OSSL_PROVIDER;
- OSSL_PROVIDER *OSSL_PROVIDER_load(OPENSSL_CTX *, const char *name);
+ OSSL_PROVIDER *OSSL_PROVIDER_load(OPENSSL_CTX *libctx, const char *name);
int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov);
+ int OSSL_PROVIDER_available(OPENSSL_CTX *libctx, const char *name);
const OSSL_PARAM *OSSL_PROVIDER_get_param_types(OSSL_PROVIDER *prov);
int OSSL_PROVIDER_get_params(OSSL_PROVIDER *prov, OSSL_PARAM params[]);
- int OSSL_PROVIDER_add_builtin(OPENSSL_CTX *, const char *name,
+ int OSSL_PROVIDER_add_builtin(OPENSSL_CTX *libctx, const char *name,
ossl_provider_init_fn *init_fn);
const char *OSSL_PROVIDER_name(const OSSL_PROVIDER *prov);
@@ -32,6 +34,9 @@ A provider can be built in to the application or the OpenSSL
libraries, or can be a loadable module.
The functions described here handle both forms.
+Some of these functions operate within a library context, please see
+L<OPENSSL_CTX(3)> for further details.
+
=head2 Functions
OSSL_PROVIDER_add_builtin() is used to add a built in provider to
@@ -49,6 +54,9 @@ OSSL_PROVIDER_unload() unloads the given provider.
For a provider added with OSSL_PROVIDER_add_builtin(), this simply
runs its teardown function.
+OSSL_PROVIDER_available() checks if a named provider is available
+for use.
+
OSSL_PROVIDER_get_param_types() is used to get a provider parameter
descriptor set as a constant B<OSSL_PARAM> array.
See L<OSSL_PARAM(3)> for more information.
@@ -69,6 +77,9 @@ success, or B<NULL> on error.
OSSL_PROVIDER_unload() returns 1 on success, or 0 on error.
+OSSL_PROVIDER_available() returns 1 if the named provider is available,
+otherwise 0.
+
OSSL_PROVIDER_get_param_types() returns a pointer to an array
of constant B<OSSL_PARAM>, or NULL if none is provided.
@@ -95,7 +106,7 @@ its build number.
=head1 SEE ALSO
-L<openssl-core.h(7)>, L<provider(7)>
+L<openssl-core.h(7)>, L<OPENSSL_CTX(3)>, L<provider(7)>
=head1 HISTORY