From 6b1e5fa4873ff2f7741f996961f26ab9818ee190 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Wed, 25 Mar 2020 12:12:59 +0000 Subject: 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 Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11405) --- crypto/context.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crypto/context.c') 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) -- cgit v1.2.3