Add bit-sliced AES x86_64 assembler, see http://homes.esat.kuleuven.be/~ekasper/...
[openssl.git] / crypto / o_init.c
index 1a042ffc99103ef38f3f3a5104ea75acae55b6e5..b7f8d10fa0cbfce61a804380ce69c357e2e0f833 100644 (file)
 
 #include <e_os.h>
 #include <openssl/err.h>
+#ifdef OPENSSL_FIPS
+#include <openssl/fips.h>
+#include <openssl/rand.h>
+#endif
 
 #if defined(__GNUC__) && __GNUC__>=2
   void OPENSSL_init(void) __attribute__((constructor));
@@ -116,7 +120,13 @@ void OPENSSL_init(void)
        if (done)
                return;
        done = 1;
-#if 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
+#if 0
        fprintf(stderr, "Called OPENSSL_init\n");
 #endif
        }