OPENSSL_init_crypto load config into initial global default library context
authorIngo Franzki <ifranzki@linux.ibm.com>
Wed, 30 Aug 2023 06:41:43 +0000 (08:41 +0200)
committerTomas Mraz <tomas@openssl.org>
Thu, 31 Aug 2023 15:06:51 +0000 (17:06 +0200)
commitecb6cdf02a302af18fe4bc20097a9ea3177f897c
treed032ae69daae43c1d741513326e8c863c92c344d
parent305dc68add0e6b8e52cb5208d5803ac94f90bfb6
OPENSSL_init_crypto load config into initial global default library context

OPENSSL_init_crypto() with OPENSSL_INIT_LOAD_CONFIG must load the configuration
into the initial global default library context, not the currently set default
library context.

OPENSSL_init_crypto() with OPENSSL_INIT_LOAD_CONFIG may be called within other
OpenSSL API functions, e.g. from within EVP_PKEY_CTX_new_xxx() when initializing
a pkey context, to perform implicit initialization, if it has not been
initialized yet. This implicit initialization may happen at a time when an
application has already create its own library context and made it the default
library context. So loading the config into the current default library context
would load it into the applications library context.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21897)
crypto/conf/conf_sap.c