X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fconf%2Fconf_sap.c;h=ff19167e248fe98d6ab9fa6f59649639e300f24a;hp=9c53bac1a8c12e6b9d45c45e7fcc4df6a458819e;hb=35d8fa563c9abc80c6e8d87396ab48dbd1a4c78d;hpb=d318fb79d291b491b07ee073a0d352f14729786c diff --git a/crypto/conf/conf_sap.c b/crypto/conf/conf_sap.c index 9c53bac1a8..ff19167e24 100644 --- a/crypto/conf/conf_sap.c +++ b/crypto/conf/conf_sap.c @@ -1,6 +1,6 @@ -/* conf_sap.c */ -/* Written by Stephen Henson (shenson@bigfoot.com) for the OpenSSL - * project 2001. +/* + * Written by Stephen Henson (steve@openssl.org) for the OpenSSL project + * 2001. */ /* ==================================================================== * Copyright (c) 2001 The OpenSSL Project. All rights reserved. @@ -10,7 +10,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -58,54 +58,52 @@ #include #include -#include "cryptlib.h" -#include +#include "internal/cryptlib.h" +#include #include #include #include #ifndef OPENSSL_NO_ENGINE -#include +# include #endif -/* This is the automatic configuration loader: it is called automatically by - * OpenSSL when any of a number of standard initialisation functions are called, - * unless this is overridden by calling OPENSSL_no_config() +/* + * This is the automatic configuration loader: it is called automatically by + * OpenSSL when any of a number of standard initialisation functions are + * called, unless this is overridden by calling OPENSSL_no_config() */ static int openssl_configured = 0; void OPENSSL_config(const char *config_name) - { - if (openssl_configured) - return; +{ + const OPENSSL_INIT_SETTINGS settings[2] = { + { OPENSSL_INIT_SET_CONF_FILENAME, .value.type_string = config_name }, + { OPENSSL_INIT_SET_END, .value.type_int = 0 } + }; + OPENSSL_INIT_crypto_library_start(OPENSSL_INIT_LOAD_CONFIG, settings); +} - OPENSSL_load_builtin_modules(); +void openssl_config_internal(const char *config_name) +{ + if (openssl_configured) + return; + + OPENSSL_load_builtin_modules(); #ifndef OPENSSL_NO_ENGINE - /* Need to load ENGINEs */ - ENGINE_load_builtin_engines(); + /* Need to load ENGINEs */ + ENGINE_load_builtin_engines(); #endif - /* Add others here? */ - - - ERR_clear_error(); - if (CONF_modules_load_file(NULL, config_name, - CONF_MFLAGS_DEFAULT_SECTION|CONF_MFLAGS_IGNORE_MISSING_FILE) <= 0) - { - BIO *bio_err; - ERR_load_crypto_strings(); - if ((bio_err=BIO_new_fp(stderr, BIO_NOCLOSE)) != NULL) - { - BIO_printf(bio_err,"Auto configuration failed\n"); - ERR_print_errors(bio_err); - BIO_free(bio_err); - } - exit(1); - } - - return; - } + ERR_clear_error(); +#ifndef OPENSSL_SYS_UEFI + CONF_modules_load_file(NULL, config_name, + CONF_MFLAGS_DEFAULT_SECTION | + CONF_MFLAGS_IGNORE_MISSING_FILE); +#endif + openssl_configured = 1; +} -void OPENSSL_no_config() - { - openssl_configured = 1; - } +void openssl_no_config_internal(void) +{ + openssl_configured = 1; +}