summaryrefslogtreecommitdiffstats
path: root/crypto/context.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-06-23 10:09:20 +0200
committerRichard Levitte <levitte@openssl.org>2020-06-28 10:55:52 +0200
commitcfbd76c1a9737617d4cf90d3a1af704241c97d98 (patch)
tree2984d2265afa28514f3f501fedd3bf934b4c77c1 /crypto/context.c
parente31eda006faaadc8bbe0bb809dbbaba0e4323fe6 (diff)
CORE: Add an internal function to distinguish the global default context
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12228)
Diffstat (limited to 'crypto/context.c')
-rw-r--r--crypto/context.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/context.c b/crypto/context.c
index 615c55c8c2..de289fcb68 100644
--- a/crypto/context.c
+++ b/crypto/context.c
@@ -214,6 +214,15 @@ int openssl_ctx_is_default(OPENSSL_CTX *ctx)
return 0;
}
+int openssl_ctx_is_global_default(OPENSSL_CTX *ctx)
+{
+#ifndef FIPS_MODULE
+ if (openssl_ctx_get_concrete(ctx) == &default_context_int)
+ return 1;
+#endif
+ return 0;
+}
+
static void openssl_ctx_generic_new(void *parent_ign, void *ptr_ign,
CRYPTO_EX_DATA *ad, int index,
long argl_ign, void *argp)