diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-04-01 16:23:16 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-04-01 16:23:16 +0000 |
commit | 8cf88778ea1fe21bcbb16be778c79e418a3fbdd0 (patch) | |
tree | c3680b689c3a6541df14716ce268a3ecd8d1be90 /crypto/o_init.c | |
parent | c4acfb1fd049f52fb074b103be01cab5cf5c04f8 (diff) |
Allow FIPS malloc callback setting. Automatically set some callbacks
in OPENSSL_init().
Diffstat (limited to 'crypto/o_init.c')
-rw-r--r-- | crypto/o_init.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/o_init.c b/crypto/o_init.c index 1a042ffc99..1017f3bb4b 100644 --- a/crypto/o_init.c +++ b/crypto/o_init.c @@ -54,6 +54,9 @@ #include <e_os.h> #include <openssl/err.h> +#ifdef OPENSSL_FIPS +#include <openssl/fips.h> +#endif #if defined(__GNUC__) && __GNUC__>=2 void OPENSSL_init(void) __attribute__((constructor)); @@ -116,6 +119,11 @@ void OPENSSL_init(void) 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); +#endif #if 1 fprintf(stderr, "Called OPENSSL_init\n"); #endif |