aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2021-04-15 16:46:35 +0100
committerMatt Caswell <matt@openssl.org>2021-04-19 10:50:29 +0100
commit92b20fb8f742d50ca9eae8c28a855df94b9a3783 (patch)
tree8abd7f8e09d25bb6c51d0efd1febe6a5d581a82f /doc
parent145a4c871d9632a6eb2145f8a2b417bec58e7ee5 (diff)
downloadopenssl-92b20fb8f742d50ca9eae8c28a855df94b9a3783.tar.gz
Change the semantics of OSSL_LIB_CTX_set0_default() NULL handling
Change things so that passing NULL to OSSL_LIB_CTX_set0_default() means keep the current library context unchanged. This has the advantage of simplifying error handling, e.g. you can call OSSL_LIB_CTX_set0_default in an error/finalisation block safe in the knowledge the if the "prevctx" was never set then it will be a no-op (like calling a "free" function with NULL). Fixes #14593 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.pod4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/man3/OSSL_LIB_CTX.pod b/doc/man3/OSSL_LIB_CTX.pod
index 01b6a47b48..a23a10f5ce 100644
--- a/doc/man3/OSSL_LIB_CTX.pod
+++ b/doc/man3/OSSL_LIB_CTX.pod
@@ -41,7 +41,9 @@ default OpenSSL 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.
+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.
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