From 228cae30b117c2493f69ad3c195341cd6ec8d430 Mon Sep 17 00:00:00 2001 From: djm <> Date: Sat, 13 Oct 2012 21:23:50 +0000 Subject: import OpenSSL-1.0.1c --- src/lib/libcrypto/o_init.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'src/lib/libcrypto/o_init.c') diff --git a/src/lib/libcrypto/o_init.c b/src/lib/libcrypto/o_init.c index 00ed65a6cf..db4cdc443b 100644 --- a/src/lib/libcrypto/o_init.c +++ b/src/lib/libcrypto/o_init.c @@ -3,7 +3,7 @@ * project. */ /* ==================================================================== - * Copyright (c) 2007 The OpenSSL Project. All rights reserved. + * Copyright (c) 2011 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -50,14 +50,14 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. * ==================================================================== * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * */ #include #include +#ifdef OPENSSL_FIPS +#include +#include +#endif /* Perform any essential OpenSSL initialization operations. * Currently only sets FIPS callbacks @@ -65,22 +65,18 @@ void OPENSSL_init(void) { -#ifdef OPENSSL_FIPS static int done = 0; - if (!done) - { - int_ERR_lib_init(); -#ifdef CRYPTO_MDEBUG - CRYPTO_malloc_debug_init(); -#endif -#ifdef OPENSSL_ENGINE - int_EVP_MD_init_engine_callbacks(); - int_EVP_CIPHER_init_engine_callbacks(); - int_RAND_init_engine_callbacks(); + if (done) + return; + done = 1; +#ifdef OPENSSL_FIPS + FIPS_set_locking_callbacks(CRYPTO_lock, CRYPTO_add_lock); + FIPS_set_error_callbacks(ERR_put_error, ERR_add_error_vdata); + FIPS_set_malloc_callbacks(CRYPTO_malloc, CRYPTO_free); + RAND_init_fips(); #endif - done = 1; - } +#if 0 + fprintf(stderr, "Called OPENSSL_init\n"); #endif } - -- cgit v1.2.3-55-g6feb