]> granicus.if.org Git - openssl/commitdiff
Move SHA1 selftest input vectors to writable segment.
authorAndy Polyakov <appro@openssl.org>
Sat, 7 May 2005 22:33:29 +0000 (22:33 +0000)
committerAndy Polyakov <appro@openssl.org>
Sat, 7 May 2005 22:33:29 +0000 (22:33 +0000)
fips/fipshashes.c
fips/sha1/fips_sha1_selftest.c

index 6090e9efa3e52a008559740545015bb84ca95a3c..2eb568b31b825047a7d3904ed4634563efc521a3 100644 (file)
@@ -26,7 +26,7 @@ const char * const FIPS_source_hashes[] = {
 "HMAC-SHA1(rsa/fips_rsa_selftest.c)= dcd0970a4de2d7f0d2333d6a3efb1ae350209b57",
 "HMAC-SHA1(sha1/fips_sha1dgst.c)= 26e529d630b5e754b4a29bd1bb697e991e7fdc04",
 "HMAC-SHA1(sha1/fips_standalone_sha1.c)= faae95bc36cc80f5be6a0cde02ebab0f63d4fd97",
-"HMAC-SHA1(sha1/fips_sha1_selftest.c)= e4a50c88af171121f5f84476f33efb7d12c2e917",
+"HMAC-SHA1(sha1/fips_sha1_selftest.c)= c8cb6e96a4b8c56f75f1b657ebf77a90545b774d",
 "HMAC-SHA1(sha1/asm/fips-sx86-elf.s)= ae66fb23ab8e1a2287e87a0a2dd30a4b9039fe63",
 "HMAC-SHA1(sha1/fips_sha_locl.h)= 30b6d6bdbdc9db0d66dc89010c1f4fe1c7b60574",
 "HMAC-SHA1(sha1/fips_md32_common.h)= c34d8b7785d3194ff968cf6d3efdd2bfcaec1fad",
index 6c89c9ec462e3f0bb8c49bf2cb7292c5e0fd2805..a52530c34f03c589ff55f2079759987b5b9048ad 100644 (file)
 #include <openssl/fips_sha.h>
 
 #ifdef OPENSSL_FIPS
-static char *test[]=
+static char test[][60]=
     {
     "",
     "abc",
-    "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
-    NULL,
+    "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
     };
 
 static const unsigned char ret[][SHA_DIGEST_LENGTH]=
@@ -80,7 +79,7 @@ int FIPS_selftest_sha1()
     {
     int n;
 
-    for(n=0 ; test[n] ; ++n)
+    for(n=0 ; n<sizeof(test)/sizeof(test[0]) ; ++n)
        {
        unsigned char md[SHA_DIGEST_LENGTH];