aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2021-04-16 11:13:30 +0100
committerMatt Caswell <matt@openssl.org>2021-04-19 10:52:18 +0100
commit978e323a4dbc9e790c13cc479b68c260677dc4c4 (patch)
treecd6e8ff536212de5b5f83b8ba049a7ff7602cbd4 /doc
parent92b20fb8f742d50ca9eae8c28a855df94b9a3783 (diff)
downloadopenssl-978e323a4dbc9e790c13cc479b68c260677dc4c4.tar.gz
Add the function OSSL_LIB_CTX_get0_global_default()
An API function for obtaining the global default lib ctx. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14890)
Diffstat (limited to 'doc')
-rw-r--r--doc/man3/OSSL_LIB_CTX.pod20
1 files changed, 14 insertions, 6 deletions
diff --git a/doc/man3/OSSL_LIB_CTX.pod b/doc/man3/OSSL_LIB_CTX.pod
index a23a10f5ce..f2bf3d9de6 100644
--- a/doc/man3/OSSL_LIB_CTX.pod
+++ b/doc/man3/OSSL_LIB_CTX.pod
@@ -3,7 +3,7 @@
=head1 NAME
OSSL_LIB_CTX, OSSL_LIB_CTX_new, OSSL_LIB_CTX_free, OSSL_LIB_CTX_load_config,
-OSSL_LIB_CTX_set0_default
+OSSL_LIB_CTX_get0_global_default, OSSL_LIB_CTX_set0_default
- OpenSSL library context
=head1 SYNOPSIS
@@ -15,6 +15,7 @@ OSSL_LIB_CTX_set0_default
OSSL_LIB_CTX *OSSL_LIB_CTX_new(void);
int OSSL_LIB_CTX_load_config(OSSL_LIB_CTX *ctx, const char *config_file);
void OSSL_LIB_CTX_free(OSSL_LIB_CTX *ctx);
+ OSSL_LIB_CTX *OSSL_LIB_CTX_get0_global_default(void);
OSSL_LIB_CTX *OSSL_LIB_CTX_set0_default(OSSL_LIB_CTX *ctx);
=head1 DESCRIPTION
@@ -38,12 +39,17 @@ from a configuration.
OSSL_LIB_CTX_free() frees the given I<ctx>, unless it happens to be the
default OpenSSL library context.
+OSSL_LIB_CTX_get0_global_default() returns a concrete (non NULL) reference to
+the global default library context.
+
OSSL_LIB_CTX_set0_default() sets the default OpenSSL library context to be
I<ctx> in the current thread. The previous default library context is
returned. Care should be taken by the caller to restore the previous
default library context with a subsequent call of this function. If I<ctx> is
NULL then no change is made to the default library context, but a pointer to
-the current library context is still returned.
+the current library context is still returned. On a successful call of this
+function the returned value will always be a concrete (non NULL) library
+context.
Care should be taken when changing the default library context and starting
async jobs (see L<ASYNC_start_job(3)>), as the default library context when
@@ -55,15 +61,17 @@ that job has finished.
=head1 RETURN VALUES
-OSSL_LIB_CTX_new() and OSSL_LIB_CTX_set0_default() return a library context
-pointer on success, or NULL on error.
+OSSL_LIB_CTX_new(), OSSL_LIB_CTX_get0_global_default() and
+OSSL_LIB_CTX_set0_default() return a library context pointer on success, or NULL
+on error.
OSSL_LIB_CTX_free() doesn't return any value.
=head1 HISTORY
-OSSL_LIB_CTX, OSSL_LIB_CTX_new(), OSSL_LIB_CTX_load_config(), OSSL_LIB_CTX_free()
-and OSSL_LIB_CTX_set0_default() were added in OpenSSL 3.0.
+OSSL_LIB_CTX, OSSL_LIB_CTX_new(), OSSL_LIB_CTX_load_config(),
+OSSL_LIB_CTX_free(), OSSL_LIB_CTX_get0_global_default() and
+OSSL_LIB_CTX_set0_default() were added in OpenSSL 3.0.
=head1 COPYRIGHT