[openssl] master update

tomas at openssl.org tomas at openssl.org
Tue Mar 16 10:37:04 UTC 2021


The branch master has been updated
       via  a23deef2812a1ffa816aacb85f3e9b7ffb504ef5 (commit)
      from  a8275fbc4a252ee3a4d404fa828f04ba267fe085 (commit)


- Log -----------------------------------------------------------------
commit a23deef2812a1ffa816aacb85f3e9b7ffb504ef5
Author: Tomas Mraz <tomas at openssl.org>
Date:   Fri Mar 12 17:29:53 2021 +0100

    provider_core: Remove two TODO 3.0
    
    We need to keep the check for prov == NULL in ossl_provider_libctx
    but it is not needed in core_get_libctx as there it can happen only when
    there is a serious coding error in a third party provider and returning
    NULL as libctx would be seriously wrong as that has a special meaning.
    
    The second TODO is valid but not something that is relevant
    for 3.0. Change it into a normal comment.
    
    Fixes #14377
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/14535)

-----------------------------------------------------------------------

Summary of changes:
 crypto/provider_core.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/crypto/provider_core.c b/crypto/provider_core.c
index f5d54b22ec..64bed25e04 100644
--- a/crypto/provider_core.c
+++ b/crypto/provider_core.c
@@ -911,7 +911,6 @@ void *ossl_provider_prov_ctx(const OSSL_PROVIDER *prov)
 
 OSSL_LIB_CTX *ossl_provider_libctx(const OSSL_PROVIDER *prov)
 {
-    /* TODO(3.0) just: return prov->libctx; */
     return prov != NULL ? prov->libctx : NULL;
 }
 
@@ -1113,7 +1112,14 @@ static OPENSSL_CORE_CTX *core_get_libctx(const OSSL_CORE_HANDLE *handle)
      */
     OSSL_PROVIDER *prov = (OSSL_PROVIDER *)handle;
 
-    return (OPENSSL_CORE_CTX *)ossl_provider_libctx(prov);
+    /*
+     * Using ossl_provider_libctx would be wrong as that returns
+     * NULL for |prov| == NULL and NULL libctx has a special meaning
+     * that does not apply here. Here |prov| == NULL can happen only in
+     * case of a coding error.
+     */
+    (void)ossl_assert(prov != NULL);
+    return (OPENSSL_CORE_CTX *)prov->libctx;
 }
 
 static int core_thread_start(const OSSL_CORE_HANDLE *handle,
@@ -1135,8 +1141,8 @@ static int core_thread_start(const OSSL_CORE_HANDLE *handle,
  */
 #ifndef FIPS_MODULE
 /*
- * TODO(3.0) These error functions should use |handle| to select the proper
- * library context to report in the correct error stack, at least if error
+ * These error functions should use |handle| to select the proper
+ * library context to report in the correct error stack if error
  * stacks become tied to the library context.
  * We cannot currently do that since there's no support for it in the
  * ERR subsystem.


More information about the openssl-commits mailing list