f4fb84
diff -up openssl-1.0.0/crypto/engine/eng_aesni.c.fips-aesni openssl-1.0.0/crypto/engine/eng_aesni.c
f4fb84
--- openssl-1.0.0/crypto/engine/eng_aesni.c.fips-aesni	2011-05-24 15:20:29.000000000 +0200
f4fb84
+++ openssl-1.0.0/crypto/engine/eng_aesni.c	2011-06-08 14:19:22.000000000 +0200
f4fb84
@@ -323,7 +323,7 @@ static const EVP_CIPHER aesni_##ksize##_
f4fb84
 	EVP_CIPHER_block_size_##umode,			\
f4fb84
 	ksize / 8,					\
f4fb84
 	AES_BLOCK_SIZE,					\
f4fb84
-	0 | EVP_CIPH_##umode##_MODE,			\
f4fb84
+	EVP_CIPH_FLAG_FIPS | EVP_CIPH_##umode##_MODE,			\
f4fb84
 	aesni_init_key,				\
f4fb84
 	aesni_cipher_##lmode,				\
f4fb84
 	NULL,						\
f4fb84
diff -up openssl-1.0.0/crypto/fips/fips.c.fips-aesni openssl-1.0.0/crypto/fips/fips.c
f4fb84
--- openssl-1.0.0/crypto/fips/fips.c.fips-aesni	2011-05-24 15:20:29.000000000 +0200
f4fb84
+++ openssl-1.0.0/crypto/fips/fips.c	2011-06-08 17:31:35.000000000 +0200
f4fb84
@@ -55,6 +55,7 @@
f4fb84
 #include <openssl/bio.h>
f4fb84
 #include <openssl/hmac.h>
f4fb84
 #include <openssl/rsa.h>
f4fb84
+#include <openssl/engine.h>
f4fb84
 #include <string.h>
f4fb84
 #include <limits.h>
f4fb84
 #include <dlfcn.h>
f4fb84
@@ -444,14 +445,17 @@ int FIPS_mode_set(int onoff)
f4fb84
 	    }
f4fb84
 
f4fb84
 	if(FIPS_selftest())
f4fb84
-	    fips_set_mode(1);
f4fb84
-	else
f4fb84
 	    {
f4fb84
-	    fips_selftest_fail = 1;
f4fb84
-	    ret = 0;
f4fb84
-	    goto end;
f4fb84
+	    ENGINE_load_aesni();
f4fb84
+	    if (FIPS_selftest_aes())
f4fb84
+		{
f4fb84
+		fips_set_mode(1);
f4fb84
+		ret = 1;
f4fb84
+		goto end;
f4fb84
+		}
f4fb84
 	    }
f4fb84
-	ret = 1;
f4fb84
+	fips_selftest_fail = 1;
f4fb84
+	ret = 0;
f4fb84
 	goto end;
f4fb84
 	}
f4fb84
     fips_set_mode(0);