Add selftest check to SHA1 routine.
authorDr. Stephen Henson <steve@openssl.org>
Sun, 15 Jul 2007 12:06:23 +0000 (12:06 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 15 Jul 2007 12:06:23 +0000 (12:06 +0000)
crypto/sha/sha_locl.h
fips-1.0/sha/fips_standalone_sha1.c

index d65de44af0f431e6cdcd952431200ad8f4e8d30c..3b1cea84e448f27bc7e904b16e9e87d0d18b369e 100644 (file)
@@ -151,6 +151,9 @@ FIPS_NON_FIPS_MD_Init(SHA)
 int HASH_INIT (SHA_CTX *c)
 #endif
        {
+#if defined(SHA_1) && defined(OPENSSL_FIPS)
+       FIPS_selftest_check();
+#endif
        c->h0=INIT_DATA_h0;
        c->h1=INIT_DATA_h1;
        c->h2=INIT_DATA_h2;
index aba7acc610e1c11aa67594a0405585b065d8b79f..f18eaf0c90f87912f7854963d7f2e9fe43724990 100644 (file)
@@ -55,6 +55,7 @@
 #include <openssl/hmac.h>
 
 int FIPS_selftest_failed() { return 0; }
+void FIPS_selftest_check() {}
 void OPENSSL_cleanse(void *p,size_t len) {}
 
 #ifdef OPENSSL_FIPS