summaryrefslogtreecommitdiff
path: root/crypto/context.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-03-25 12:12:59 +0000
committerMatt Caswell <matt@openssl.org>2020-03-27 11:12:27 +0000
commit6b1e5fa4873ff2f7741f996961f26ab9818ee190 (patch)
treebdadaacc076978ce4b1bca51100414319ac7e682 /crypto/context.c
parent9727f4e7fd02e55b637058249cd8e1bc80501c7f (diff)
downloadopenssl-new-6b1e5fa4873ff2f7741f996961f26ab9818ee190.tar.gz
Put an error on the stack in the event of a fetch failure
Fetch failures are a common problem and it is useful to have detailed information about what was requested in the event of a failure. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11405)
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 dcf960bfa7..35530174b8 100644
--- a/crypto/context.c
+++ b/crypto/context.c
@@ -172,6 +172,15 @@ OPENSSL_CTX *openssl_ctx_get_concrete(OPENSSL_CTX *ctx)
return ctx;
}
+int openssl_ctx_is_default(OPENSSL_CTX *ctx)
+{
+#ifndef FIPS_MODE
+ if (ctx == NULL || ctx == default_context)
+ 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)