diff options
Diffstat (limited to 'crypto/o_init.c')
-rw-r--r-- | crypto/o_init.c | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/crypto/o_init.c b/crypto/o_init.c index d767a90..db4cdc4 100644 --- a/crypto/o_init.c +++ b/crypto/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,23 +50,13 @@ * 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 <e_os.h> #include <openssl/err.h> - -/* Internal only functions: only ever used here */ #ifdef OPENSSL_FIPS -extern void int_ERR_lib_init(void); -# ifndef OPENSSL_NO_ENGINE -extern void int_EVP_MD_init_engine_callbacks(void ); -extern void int_EVP_CIPHER_init_engine_callbacks(void ); -extern void int_RAND_init_engine_callbacks(void ); -# endif +#include <openssl/fips.h> +#include <openssl/rand.h> #endif /* Perform any essential OpenSSL initialization operations. @@ -75,22 +65,18 @@ extern void int_RAND_init_engine_callbacks(void ); 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 -#ifndef OPENSSL_NO_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 } - |