mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Initialize the DST subsystem implicitly
Instead of calling dst_lib_init() and dst_lib_destroy() explicitly by all the programs, create a separate memory context for the DST subsystem and use the library constructor and destructor to initialize the DST internals.
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <isc/fips.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/mutex.h>
|
||||
#include <isc/mutexblock.h>
|
||||
@@ -55,33 +54,6 @@
|
||||
goto err; \
|
||||
}
|
||||
|
||||
static void
|
||||
enable_fips_mode(void) {
|
||||
#if defined(ENABLE_FIPS_MODE)
|
||||
if (isc_fips_mode()) {
|
||||
/*
|
||||
* FIPS mode is already enabled.
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
if (isc_fips_set_mode(1) != ISC_R_SUCCESS) {
|
||||
dst__openssl_toresult2("FIPS_mode_set", DST_R_OPENSSLFAILURE);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
dst__openssl_init(void) {
|
||||
enable_fips_mode();
|
||||
}
|
||||
|
||||
void
|
||||
dst__openssl_destroy(void) {
|
||||
/* No-op */
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
toresult(isc_result_t fallback) {
|
||||
isc_result_t result = fallback;
|
||||
|
Reference in New Issue
Block a user