ossl_provider_library_context(NULL) returns NULL.
authorPauli <paul.dale@oracle.com>
Thu, 29 Aug 2019 03:02:54 +0000 (13:02 +1000)
committerPauli <paul.dale@oracle.com>
Fri, 6 Sep 2019 09:27:57 +0000 (19:27 +1000)
This will only be required until everything is moved to providers and a NULL
provider pointer won't be possible.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9662)

crypto/provider_core.c

index 541a1e169b1ad546a02a4c52adc71d490b94d148..356327f375cf1aca784c2709a5e4076d6a162e69 100644 (file)
@@ -709,7 +709,8 @@ const char *ossl_provider_module_path(const OSSL_PROVIDER *prov)
 
 OPENSSL_CTX *ossl_provider_library_context(const OSSL_PROVIDER *prov)
 {
-    return prov->libctx;
+    /* TODO(3.0) just: return prov->libctx; */
+    return prov != NULL ? prov->libctx : NULL;
 }
 
 /* Wrappers around calls to the provider */