Add corruptors so KATs can be made to fail.
authorBen Laurie <ben@openssl.org>
Wed, 14 Apr 2004 17:58:54 +0000 (17:58 +0000)
committerBen Laurie <ben@openssl.org>
Wed, 14 Apr 2004 17:58:54 +0000 (17:58 +0000)
13 files changed:
fips/aes/fingerprint.sha1
fips/aes/fips_aes_selftest.c
fips/des/fingerprint.sha1
fips/des/fips_des_selftest.c
fips/dsa/fingerprint.sha1
fips/dsa/fips_dsa_selftest.c
fips/fingerprint.sha1
fips/fips.h
fips/rsa/fingerprint.sha1
fips/rsa/fips_rsa_selftest.c
fips/sha1/fingerprint.sha1
fips/sha1/fips_sha1_selftest.c
fips/sha1/standalone.sha1

index b16b9c5cef70d770bc5dfc541fc4b99e82bcc722..295b552cb128467872715e0e9ee4796719c84698 100644 (file)
@@ -1,3 +1,3 @@
 HMAC-SHA1(fips_aes_core.c)= 979e9a3084dc8e15d9f222bf721e6faccf6bcd18
-HMAC-SHA1(fips_aes_selftest.c)= 0bf32b515e2ee39332aa6563b45d7d44d88f4ed4
+HMAC-SHA1(fips_aes_selftest.c)= 98b01502221e7fe529fd981222f2cbb52eb4cbe0
 HMAC-SHA1(fips_aes_locl.h)= ded58f0cda8cb967dc5f5f3a860601c0b8744623
index d47004c171724a11f014ec6a2dd754cceb1a03f3..0e53d21bd0d17878eac440ef9aae57d170712141 100644 (file)
@@ -70,6 +70,11 @@ static struct
        },
        };
 
+void FIPS_corrupt_aes()
+    {
+    tests[0].key[0]++;
+    }
+
 int FIPS_selftest_aes()
     {
     int n;
index 89968240e07eb0e606394467ecf2550907a18f0c..76caf96fb4fc51751a0ab7a83d4a085f29f1199f 100644 (file)
@@ -1,5 +1,5 @@
 HMAC-SHA1(fips_des_enc.c)= ea89417ba58c148c3d72d29438cd0bedc2315f7f
 HMAC-SHA1(asm/fips-dx86-elf.s)= 2f85e8e86806c92ee4c12cf5354e19eccf6ed47d
-HMAC-SHA1(fips_des_selftest.c)= af1ad8d10a0f0567d48fcffd6f45b7b050f6dcb5
+HMAC-SHA1(fips_des_selftest.c)= 3bc574e51647c5f5ab45d1007b2cf461d67764a9
 HMAC-SHA1(fips_set_key.c)= e55cabd0cbe5cd17710e11270d9594c0d7237064
 HMAC-SHA1(fips_des_locl.h)= 7053848e884df47f06de9f2248380b92e58ef4e5
index f2c9ad5b2432b82f98d8c7354290a7f5d0f78721..3e0778eb5e2f9e4fc4864799077aac131e654088 100644 (file)
@@ -57,7 +57,7 @@
 static struct
     {
     DES_cblock key;
-    DES_cblock plaintext;
+    unsigned char plaintext[8];
     unsigned char ciphertext[8];
     } tests[]=
        {
@@ -120,6 +120,11 @@ static struct
        },
        };
 
+void FIPS_corrupt_des()
+    {
+    tests[0].plaintext[0]++;
+    }
+
 int FIPS_selftest_des()
     {
     int n;
index d760ed4f4ad4df5a736e74f89e7e3f0b711ad463..74ac84ffeb8d7d1cb6fe7a8465b76bdf4bf8825e 100644 (file)
@@ -1,3 +1,3 @@
 HMAC-SHA1(fips_dsa_ossl.c)= 1295b5241620e1d5449aaeeb7084b181fc197003
 HMAC-SHA1(fips_dsa_gen.c)= e347a0c5b19cdcde37c73f6abcdc52c794d5dd4e
-HMAC-SHA1(fips_dsa_selftest.c)= 5a42b699e44b68e765fd6a1e9bcc2b923512a198
+HMAC-SHA1(fips_dsa_selftest.c)= a3de5feb989e7bfb15478318feab1f035e700933
index bca7c37fafc1d90afff9a3562771df2219ed80e4..5f0e6651cb99a0947b269ec5471a4bc865091d29 100644 (file)
@@ -100,6 +100,11 @@ static unsigned char out_g[]={
 
 static const unsigned char str1[]="12345678901234567890";
 
+void FIPS_corrupt_dsa()
+    {
+    ++seed[0];
+    }
+
 int FIPS_selftest_dsa()
     {
     DSA *dsa=NULL;
index 56adb13b2062729f8d3fc153ba14df253afd1c1a..a0e87dfc4c0f0657e397bceefd4ea78e6ca6802c 100644 (file)
@@ -1,4 +1,4 @@
 HMAC-SHA1(fips.c)= 28c5bb3a276b1536327eb61b496b8c02a574c279
 HMAC-SHA1(fips_err_wrapper.c)= d3e2be316062510312269e98f964cb87e7577898
-HMAC-SHA1(fips.h)= 30200a267be0bed23d4a93a9e242e181e0ee2b44
+HMAC-SHA1(fips.h)= aeab7ad3b7a84dc83cf5099cffdec07a3f995dea
 HMAC-SHA1(fips_err.h)= f4203a47100a815c21cf3a97092f91a595938f7c
index 6abf8f5e677d36fd0f33d0e0543cae1c4cbe3a60..5b152e3a37a4ca8138117af17d0ba861cb0ded29 100644 (file)
@@ -60,10 +60,15 @@ struct dsa_st;
 
 int FIPS_mode_set(int onoff,const char *path);
 int FIPS_dsa_check(struct dsa_st *dsa);
+void FIPS_corrupt_sha1(void);
 int FIPS_selftest_sha1(void);
+void FIPS_corrupt_aes(void);
 int FIPS_selftest_aes(void);
+void FIPS_corrupt_des(void);
 int FIPS_selftest_des(void);
+void FIPS_corrupt_rsa(void);
 int FIPS_selftest_rsa(void);
+void FIPS_corrupt_dsa(void);
 int FIPS_selftest_dsa(void);
 
 /* The following lines are auto generated by the script mkerr.pl. Any changes
index 56f73808b6b154c09e9a47eac059bea033350087..e574531dd0dd7045b155cec3b85c3ddc0840b240 100644 (file)
@@ -1,3 +1,3 @@
 HMAC-SHA1(fips_rsa_eay.c)= 3808fed15de958768052db96ff710699ca9afd92
 HMAC-SHA1(fips_rsa_gen.c)= bdc892485913c405f9e0459eb4e9b7e94881a4dc
-HMAC-SHA1(fips_rsa_selftest.c)= b3cd2e2ff2bcf910ec8dfc891168761cb5dca0d6
+HMAC-SHA1(fips_rsa_selftest.c)= af5b9c9a0237b2219f375849a5b2311d786e711b
index b055d6be261d324cbd1fea45a8491d318347c8c1..cf3bf02aabd233a56a9015b47a4e91bfd1f867d4 100644 (file)
@@ -66,9 +66,7 @@
   memcpy(c, ctext_ex, sizeof(ctext_ex) - 1); \
   return (sizeof(ctext_ex) - 1);
 
-static int setrsakey(RSA *key, unsigned char *c)
-    {
-    static unsigned char n[] =
+static unsigned char n[] =
 "\x00\xBB\xF8\x2F\x09\x06\x82\xCE\x9C\x23\x38\xAC\x2B\x9D\xA8\x71"
 "\xF7\x36\x8D\x07\xEE\xD4\x10\x43\xA4\x40\xD6\xB6\xF0\x74\x54\xF5"
 "\x1F\xB8\xDF\xBA\xAF\x03\x5C\x02\xAB\x61\xEA\x48\xCE\xEB\x6F\xCD"
@@ -79,6 +77,9 @@ static int setrsakey(RSA *key, unsigned char *c)
 "\x7F\xE2\x53\x72\x98\xCA\x2A\x8F\x59\x46\xF8\xE5\xFD\x09\x1D\xBD"
 "\xCB";
 
+
+static int setrsakey(RSA *key, unsigned char *c)
+    {
     static unsigned char e[] = "\x11";
 
     static unsigned char d[] =
@@ -138,6 +139,11 @@ static int setrsakey(RSA *key, unsigned char *c)
     SetKey;
     }
 
+void FIPS_corrupt_rsa()
+    {
+    n[0]++;
+    }
+
 int FIPS_selftest_rsa()
     {
     int clen;
index e0ea1f1709a46d00c90971902ac37c5579d0f30a..c7fd5fbe8084e95f4bf6044846a69487b2668b62 100644 (file)
@@ -1,5 +1,5 @@
 HMAC-SHA1(fips_sha1dgst.c)= 10575600a9540eb15188a7d3b0b031e60aedbc18
-HMAC-SHA1(fips_sha1_selftest.c)= 9719f7e68950250ce4b7726be3e560c24cd72a32
+HMAC-SHA1(fips_sha1_selftest.c)= 98910a0c85eff1688bd7adb23e738dc75b39546e
 HMAC-SHA1(asm/sx86-elf.s)= 6286cba0ea3b071e67ab5c1e607d1387de6a871d
 HMAC-SHA1(fips_sha_locl.h)= 199ceca9016ba5514997ce1fcd22be7d4f66e9b5
 HMAC-SHA1(fips_md32_common.h)= 4dd5d27e9bedbbaab6c6c5536b254e040137471e
index 505e6f893de384197ba2bd062cbaba0c455f3b07..248539acb0135798dfed615fce790f31706a63d4 100644 (file)
@@ -71,6 +71,11 @@ static unsigned char ret[][SHA_DIGEST_LENGTH]=
       0x4a,0xa1,0xf9,0x51,0x29,0xe5,0xe5,0x46,0x70,0xf1 },
     };
 
+void FIPS_corrupt_sha1()
+    {
+    ret[0][0]++;
+    }
+
 int FIPS_selftest_sha1()
     {
     int n;
index 9d6e6318744febb6ff298597badcf8c8d6cf9e43..356b4009a58909a3a33bd620c8f11d78e5120963 100644 (file)
@@ -1,5 +1,5 @@
 HMAC-SHA1(fips_sha1dgst.c)= 10575600a9540eb15188a7d3b0b031e60aedbc18
-HMAC-SHA1(fips_sha1_selftest.c)= 9719f7e68950250ce4b7726be3e560c24cd72a32
+HMAC-SHA1(fips_sha1_selftest.c)= 98910a0c85eff1688bd7adb23e738dc75b39546e
 HMAC-SHA1(asm/sx86-elf.s)= 6286cba0ea3b071e67ab5c1e607d1387de6a871d
 HMAC-SHA1(fips_standalone_sha1.c)= c17f83ccfe601558b33b6df27d2d82887b8c9dc2
 HMAC-SHA1(fips_sha_locl.h)= 199ceca9016ba5514997ce1fcd22be7d4f66e9b5