|
|
f268f1 |
diff -up libgcrypt-1.5.3/cipher/dsa.c.fips-reqs libgcrypt-1.5.3/cipher/dsa.c
|
|
|
f268f1 |
--- libgcrypt-1.5.3/cipher/dsa.c.fips-reqs 2014-11-12 17:05:01.000000000 +0100
|
|
|
f268f1 |
+++ libgcrypt-1.5.3/cipher/dsa.c 2014-11-14 14:32:23.751354070 +0100
|
|
|
f268f1 |
@@ -55,42 +55,86 @@ typedef struct
|
|
|
f268f1 |
} dsa_domain_t;
|
|
|
f268f1 |
|
|
|
f268f1 |
|
|
|
f268f1 |
-/* A sample 1024 bit DSA key used for the selftests. */
|
|
|
f268f1 |
+/* A sample 2048 bit DSA key used for the selftests. */
|
|
|
f268f1 |
static const char sample_secret_key[] =
|
|
|
f268f1 |
"(private-key"
|
|
|
f268f1 |
" (dsa"
|
|
|
f268f1 |
-" (p #00AD7C0025BA1A15F775F3F2D673718391D00456978D347B33D7B49E7F32EDAB"
|
|
|
f268f1 |
-" 96273899DD8B2BB46CD6ECA263FAF04A28903503D59062A8865D2AE8ADFB5191"
|
|
|
f268f1 |
-" CF36FFB562D0E2F5809801A1F675DAE59698A9E01EFE8D7DCFCA084F4C6F5A44"
|
|
|
f268f1 |
-" 44D499A06FFAEA5E8EF5E01F2FD20A7B7EF3F6968AFBA1FB8D91F1559D52D8777B#)"
|
|
|
f268f1 |
-" (q #00EB7B5751D25EBBB7BD59D920315FD840E19AEBF9#)"
|
|
|
f268f1 |
-" (g #1574363387FDFD1DDF38F4FBE135BB20C7EE4772FB94C337AF86EA8E49666503"
|
|
|
f268f1 |
-" AE04B6BE81A2F8DD095311E0217ACA698A11E6C5D33CCDAE71498ED35D13991E"
|
|
|
f268f1 |
-" B02F09AB40BD8F4C5ED8C75DA779D0AE104BC34C960B002377068AB4B5A1F984"
|
|
|
f268f1 |
-" 3FBA91F537F1B7CAC4D8DD6D89B0D863AF7025D549F9C765D2FC07EE208F8D15#)"
|
|
|
f268f1 |
-" (y #64B11EF8871BE4AB572AA810D5D3CA11A6CDBC637A8014602C72960DB135BF46"
|
|
|
f268f1 |
-" A1816A724C34F87330FC9E187C5D66897A04535CC2AC9164A7150ABFA8179827"
|
|
|
f268f1 |
-" 6E45831AB811EEE848EBB24D9F5F2883B6E5DDC4C659DEF944DCFD80BF4D0A20"
|
|
|
f268f1 |
-" 42CAA7DC289F0C5A9D155F02D3D551DB741A81695B74D4C8F477F9C7838EB0FB#)"
|
|
|
f268f1 |
-" (x #11D54E4ADBD3034160F2CED4B7CD292A4EBF3EC0#)))";
|
|
|
f268f1 |
-/* A sample 1024 bit DSA key used for the selftests (public only). */
|
|
|
f268f1 |
+" (p #a85378d8fd3f8d72ec7418080da21317e43ec4b62ba8c862"
|
|
|
f268f1 |
+" 3b7e4d04441dd1a0658662596493ca8e9e8fbb7e34aaddb6"
|
|
|
f268f1 |
+" 2e5d67b6d09a6e61b769e7c352aa2b10e20ca0636963b552"
|
|
|
f268f1 |
+" 3e86470decbbeda027e797e7b67635d4d49c30700e74af8a"
|
|
|
f268f1 |
+" 0ff156a801af57a26e7078f1d82f74908ecb6d07e70b3503"
|
|
|
f268f1 |
+" eed94fa32cf17a7fc3d6cf40dc7b00830e6a2566dc073e34"
|
|
|
f268f1 |
+" 3312517c6aa5152b4bfecd2e551fee346318a153423c996b"
|
|
|
f268f1 |
+" 0d5dcb9102aedd38798616f1f1e0d6c403525b1f9b3d4dc7"
|
|
|
f268f1 |
+" 66de2dfc4a56d7b8ba5963d60f3e16318870ad436952e557"
|
|
|
f268f1 |
+" 65374eab85e8ec17d6b9a4547b9b5f2752f3105be809b23a"
|
|
|
f268f1 |
+" 2c8d7469db02e24d592394a7dba069e9#)"
|
|
|
f268f1 |
+" (q #d277044e50f5a4e3f510a50a0b84fdffbca047ed27602056"
|
|
|
f268f1 |
+" 7441a0a5#)"
|
|
|
f268f1 |
+" (g #13d754e21fd241655da891c522a65a72a89bdc64ec9b54a8"
|
|
|
f268f1 |
+" 21ed4a898b490e0c4fcb72192a4a20f541f3f2925399f0ba"
|
|
|
f268f1 |
+" ecf929aafbf79dfe4332393b32cd2e2fcf272f32a627434a"
|
|
|
f268f1 |
+" 0df242b75b414df372121e53a553f222f836b000f016485b"
|
|
|
f268f1 |
+" 6bd0898451801dcd8de64cd5365696ffc532d528c506620a"
|
|
|
f268f1 |
+" 942a0305046d8f1876341f1e570bc3974ba6b9a438e97023"
|
|
|
f268f1 |
+" 02a2e6e67bfd06d32bc679962271d7b40cd72f386e64e0d7"
|
|
|
f268f1 |
+" ef86ca8ca5d14228dc2a4f16e3189886b5990674f4200f3a"
|
|
|
f268f1 |
+" 4cf65a3f0ddba1fa672dff2f5e143d10e4e97ae84f6da095"
|
|
|
f268f1 |
+" 35d5b9df259181a79b63b069e949972b02ba36b3586aab7e"
|
|
|
f268f1 |
+" 45f322f82e4e85ca3ab85591b3c2a966#)"
|
|
|
f268f1 |
+" (y #2452f3ccbe9ed5ca7dc74c602b99226e8f2fab38e7d7ddfb"
|
|
|
f268f1 |
+" 75539b17155e9fcfd1aba564eb8535d812c9c2dcf9728444"
|
|
|
f268f1 |
+" 1bc482243624c7f457580c1c38a57c46c457392470edb52c"
|
|
|
f268f1 |
+" b5a6e03fe6287bb6f49a42a2065a054f030839df1fd3149c"
|
|
|
f268f1 |
+" 4ca0531dd8ca8aaa9cc7337193387348336118224545e88c"
|
|
|
f268f1 |
+" 80ffd8765d74360333ccab9972779b6525a65bdd0d10c675"
|
|
|
f268f1 |
+" c109bbd3e5be4d72ef6eba6e438d5226237db888379c5fcc"
|
|
|
f268f1 |
+" 47a3847ff63711baed6d03afe81e694a413b680bd38ab490"
|
|
|
f268f1 |
+" 3f8370a707ef551d4941026d9579d691de8edaa16105eb9d"
|
|
|
f268f1 |
+" ba3c2f4c1bec508275aa0207e251b5eccb286a4b01d449d3"
|
|
|
f268f1 |
+" 0acb673717a0d2fb3b50c893f7dab14f#)"
|
|
|
f268f1 |
+" (x #0c4b3089d1b862cb3c436491f0915470c52796e3acbee800"
|
|
|
f268f1 |
+" ec55f6cc#)))";
|
|
|
f268f1 |
+/* A sample 2048 bit DSA key used for the selftests (public only). */
|
|
|
f268f1 |
static const char sample_public_key[] =
|
|
|
f268f1 |
"(public-key"
|
|
|
f268f1 |
" (dsa"
|
|
|
f268f1 |
-" (p #00AD7C0025BA1A15F775F3F2D673718391D00456978D347B33D7B49E7F32EDAB"
|
|
|
f268f1 |
-" 96273899DD8B2BB46CD6ECA263FAF04A28903503D59062A8865D2AE8ADFB5191"
|
|
|
f268f1 |
-" CF36FFB562D0E2F5809801A1F675DAE59698A9E01EFE8D7DCFCA084F4C6F5A44"
|
|
|
f268f1 |
-" 44D499A06FFAEA5E8EF5E01F2FD20A7B7EF3F6968AFBA1FB8D91F1559D52D8777B#)"
|
|
|
f268f1 |
-" (q #00EB7B5751D25EBBB7BD59D920315FD840E19AEBF9#)"
|
|
|
f268f1 |
-" (g #1574363387FDFD1DDF38F4FBE135BB20C7EE4772FB94C337AF86EA8E49666503"
|
|
|
f268f1 |
-" AE04B6BE81A2F8DD095311E0217ACA698A11E6C5D33CCDAE71498ED35D13991E"
|
|
|
f268f1 |
-" B02F09AB40BD8F4C5ED8C75DA779D0AE104BC34C960B002377068AB4B5A1F984"
|
|
|
f268f1 |
-" 3FBA91F537F1B7CAC4D8DD6D89B0D863AF7025D549F9C765D2FC07EE208F8D15#)"
|
|
|
f268f1 |
-" (y #64B11EF8871BE4AB572AA810D5D3CA11A6CDBC637A8014602C72960DB135BF46"
|
|
|
f268f1 |
-" A1816A724C34F87330FC9E187C5D66897A04535CC2AC9164A7150ABFA8179827"
|
|
|
f268f1 |
-" 6E45831AB811EEE848EBB24D9F5F2883B6E5DDC4C659DEF944DCFD80BF4D0A20"
|
|
|
f268f1 |
-" 42CAA7DC289F0C5A9D155F02D3D551DB741A81695B74D4C8F477F9C7838EB0FB#)))";
|
|
|
f268f1 |
-
|
|
|
f268f1 |
+" (p #a85378d8fd3f8d72ec7418080da21317e43ec4b62ba8c862"
|
|
|
f268f1 |
+" 3b7e4d04441dd1a0658662596493ca8e9e8fbb7e34aaddb6"
|
|
|
f268f1 |
+" 2e5d67b6d09a6e61b769e7c352aa2b10e20ca0636963b552"
|
|
|
f268f1 |
+" 3e86470decbbeda027e797e7b67635d4d49c30700e74af8a"
|
|
|
f268f1 |
+" 0ff156a801af57a26e7078f1d82f74908ecb6d07e70b3503"
|
|
|
f268f1 |
+" eed94fa32cf17a7fc3d6cf40dc7b00830e6a2566dc073e34"
|
|
|
f268f1 |
+" 3312517c6aa5152b4bfecd2e551fee346318a153423c996b"
|
|
|
f268f1 |
+" 0d5dcb9102aedd38798616f1f1e0d6c403525b1f9b3d4dc7"
|
|
|
f268f1 |
+" 66de2dfc4a56d7b8ba5963d60f3e16318870ad436952e557"
|
|
|
f268f1 |
+" 65374eab85e8ec17d6b9a4547b9b5f2752f3105be809b23a"
|
|
|
f268f1 |
+" 2c8d7469db02e24d592394a7dba069e9#)"
|
|
|
f268f1 |
+" (q #d277044e50f5a4e3f510a50a0b84fdffbca047ed27602056"
|
|
|
f268f1 |
+" 7441a0a5#)"
|
|
|
f268f1 |
+" (g #13d754e21fd241655da891c522a65a72a89bdc64ec9b54a8"
|
|
|
f268f1 |
+" 21ed4a898b490e0c4fcb72192a4a20f541f3f2925399f0ba"
|
|
|
f268f1 |
+" ecf929aafbf79dfe4332393b32cd2e2fcf272f32a627434a"
|
|
|
f268f1 |
+" 0df242b75b414df372121e53a553f222f836b000f016485b"
|
|
|
f268f1 |
+" 6bd0898451801dcd8de64cd5365696ffc532d528c506620a"
|
|
|
f268f1 |
+" 942a0305046d8f1876341f1e570bc3974ba6b9a438e97023"
|
|
|
f268f1 |
+" 02a2e6e67bfd06d32bc679962271d7b40cd72f386e64e0d7"
|
|
|
f268f1 |
+" ef86ca8ca5d14228dc2a4f16e3189886b5990674f4200f3a"
|
|
|
f268f1 |
+" 4cf65a3f0ddba1fa672dff2f5e143d10e4e97ae84f6da095"
|
|
|
f268f1 |
+" 35d5b9df259181a79b63b069e949972b02ba36b3586aab7e"
|
|
|
f268f1 |
+" 45f322f82e4e85ca3ab85591b3c2a966#)"
|
|
|
f268f1 |
+" (y #2452f3ccbe9ed5ca7dc74c602b99226e8f2fab38e7d7ddfb"
|
|
|
f268f1 |
+" 75539b17155e9fcfd1aba564eb8535d812c9c2dcf9728444"
|
|
|
f268f1 |
+" 1bc482243624c7f457580c1c38a57c46c457392470edb52c"
|
|
|
f268f1 |
+" b5a6e03fe6287bb6f49a42a2065a054f030839df1fd3149c"
|
|
|
f268f1 |
+" 4ca0531dd8ca8aaa9cc7337193387348336118224545e88c"
|
|
|
f268f1 |
+" 80ffd8765d74360333ccab9972779b6525a65bdd0d10c675"
|
|
|
f268f1 |
+" c109bbd3e5be4d72ef6eba6e438d5226237db888379c5fcc"
|
|
|
f268f1 |
+" 47a3847ff63711baed6d03afe81e694a413b680bd38ab490"
|
|
|
f268f1 |
+" 3f8370a707ef551d4941026d9579d691de8edaa16105eb9d"
|
|
|
f268f1 |
+" ba3c2f4c1bec508275aa0207e251b5eccb286a4b01d449d3"
|
|
|
f268f1 |
+" 0acb673717a0d2fb3b50c893f7dab14f#)))";
|
|
|
f268f1 |
|
|
|
f268f1 |
|
|
|
f268f1 |
|
|
|
f268f1 |
@@ -1046,14 +1090,14 @@ dsa_get_nbits (int algo, gcry_mpi_t *pke
|
|
|
f268f1 |
*/
|
|
|
f268f1 |
|
|
|
f268f1 |
static const char *
|
|
|
f268f1 |
-selftest_sign_1024 (gcry_sexp_t pkey, gcry_sexp_t skey)
|
|
|
f268f1 |
+selftest_sign (gcry_sexp_t pkey, gcry_sexp_t skey)
|
|
|
f268f1 |
{
|
|
|
f268f1 |
static const char sample_data[] =
|
|
|
f268f1 |
"(data (flags raw)"
|
|
|
f268f1 |
- " (value #a0b1c2d3e4f500102030405060708090a1b2c3d4#))";
|
|
|
f268f1 |
+ " (value #a0b1c2d3e4f500102030405060708090a1b2c3d4f1e2d3c4b5a6978879605142#))";
|
|
|
f268f1 |
static const char sample_data_bad[] =
|
|
|
f268f1 |
"(data (flags raw)"
|
|
|
f268f1 |
- " (value #a0b1c2d3e4f510102030405060708090a1b2c3d4#))";
|
|
|
f268f1 |
+ " (value #a0b1c2d3e4f500102030405060708090a1b2c3d401e2d3c4b5a6978879605142#))";
|
|
|
f268f1 |
|
|
|
f268f1 |
const char *errtxt = NULL;
|
|
|
f268f1 |
gcry_error_t err;
|
|
|
f268f1 |
@@ -1131,7 +1175,7 @@ selftests_dsa (selftest_report_func_t re
|
|
|
f268f1 |
}
|
|
|
f268f1 |
|
|
|
f268f1 |
what = "sign";
|
|
|
f268f1 |
- errtxt = selftest_sign_1024 (pkey, skey);
|
|
|
f268f1 |
+ errtxt = selftest_sign (pkey, skey);
|
|
|
f268f1 |
if (errtxt)
|
|
|
f268f1 |
goto failed;
|
|
|
f268f1 |
|
|
|
f268f1 |
diff -up libgcrypt-1.5.3/cipher/rsa.c.fips-reqs libgcrypt-1.5.3/cipher/rsa.c
|
|
|
f268f1 |
--- libgcrypt-1.5.3/cipher/rsa.c.fips-reqs 2014-11-12 17:05:01.299387339 +0100
|
|
|
f268f1 |
+++ libgcrypt-1.5.3/cipher/rsa.c 2014-11-14 14:06:00.099602441 +0100
|
|
|
f268f1 |
@@ -52,33 +52,57 @@ typedef struct
|
|
|
f268f1 |
} RSA_secret_key;
|
|
|
f268f1 |
|
|
|
f268f1 |
|
|
|
f268f1 |
-/* A sample 1024 bit RSA key used for the selftests. */
|
|
|
f268f1 |
+/* A sample 2048 bit RSA key used for the selftests. */
|
|
|
f268f1 |
static const char sample_secret_key[] =
|
|
|
f268f1 |
"(private-key"
|
|
|
f268f1 |
" (rsa"
|
|
|
f268f1 |
-" (n #00e0ce96f90b6c9e02f3922beada93fe50a875eac6bcc18bb9a9cf2e84965caa"
|
|
|
f268f1 |
-" 2d1ff95a7f542465c6c0c19d276e4526ce048868a7a914fd343cc3a87dd74291"
|
|
|
f268f1 |
-" ffc565506d5bbb25cbac6a0e2dd1f8bcaab0d4a29c2f37c950f363484bf269f7"
|
|
|
f268f1 |
-" 891440464baf79827e03a36e70b814938eebdc63e964247be75dc58b014b7ea251#)"
|
|
|
f268f1 |
+" (n #00c9d56d9d90db43d602ed9688138ab2bf6ea10610b27837a714a8ffdd00"
|
|
|
f268f1 |
+" ddb493a045cc9690edada9ddc4d6ca0cf0ed4f725e21499a1812158f905a"
|
|
|
f268f1 |
+" dbb63399a3e6b4f0c4972126bbe3baf2ffa072da89638e8b3e089d922abe"
|
|
|
f268f1 |
+" 16e14315fc57c71f0911671ca996d18b3e8093c159d06d39f2ac95cc1075"
|
|
|
f268f1 |
+" e93124d143af68524be716d749656f26c086adc0070ac1e12f8785863bdc"
|
|
|
f268f1 |
+" 5a99bee9f9b9e98227510415ab060e765a288d92bdc5b57ba8df4e47a2c1"
|
|
|
f268f1 |
+" e752bf47f762e03a6f4d6a4d4ed4b95969fab214c1eee62f95cd9472aee4"
|
|
|
f268f1 |
+" db189ac4cd70bdee3116b74965ac40190eb56d83f136bb082f2e4e9262a4"
|
|
|
f268f1 |
+" ff50db2045a2eb167af2d528c1fd4e0371#)"
|
|
|
f268f1 |
" (e #010001#)"
|
|
|
f268f1 |
-" (d #046129f2489d71579be0a75fe029bd6cdb574ebf57ea8a5b0fda942cab943b11"
|
|
|
f268f1 |
-" 7d7bb95e5d28875e0f9fc5fcc06a72f6d502464dabded78ef6b716177b83d5bd"
|
|
|
f268f1 |
-" c543dc5d3fed932e59f5897e92e6f58a0f33424106a3b6fa2cbf877510e4ac21"
|
|
|
f268f1 |
-" c3ee47851e97d12996222ac3566d4ccb0b83d164074abf7de655fc2446da1781#)"
|
|
|
f268f1 |
-" (p #00e861b700e17e8afe6837e7512e35b6ca11d0ae47d8b85161c67baf64377213"
|
|
|
f268f1 |
-" fe52d772f2035b3ca830af41d8a4120e1c1c70d12cc22f00d28d31dd48a8d424f1#)"
|
|
|
f268f1 |
-" (q #00f7a7ca5367c661f8e62df34f0d05c10c88e5492348dd7bddc942c9a8f369f9"
|
|
|
f268f1 |
-" 35a07785d2db805215ed786e4285df1658eed3ce84f469b81b50d358407b4ad361#)"
|
|
|
f268f1 |
-" (u #304559a9ead56d2309d203811a641bb1a09626bc8eb36fffa23c968ec5bd891e"
|
|
|
f268f1 |
-" ebbafc73ae666e01ba7c8990bae06cc2bbe10b75e69fcacb353a6473079d8e9b#)))";
|
|
|
f268f1 |
-/* A sample 1024 bit RSA key used for the selftests (public only). */
|
|
|
f268f1 |
+" (d #36273db1f91bdba7a0417f1223ac232999d53a7b606741076353b4d2e758"
|
|
|
f268f1 |
+" 950ac705f34eb2b412d470dc4f8506d3ddd863273e673121243904bc06a4"
|
|
|
f268f1 |
+" ccce2b7afe7badde116ea3a5e604530ea34e2db48f31bfca7525520285de"
|
|
|
f268f1 |
+" 3db27243b2898a9a3441263f9a67bea4967b0e75baa693d5b8d8b857f24b"
|
|
|
f268f1 |
+" 0f1481d1574ef6454ca63bd070cad39d55de2205e78e284dee11cfb66776"
|
|
|
f268f1 |
+" 09d3e33c13f99934107bec8138f0b6349c9b506f0b91814d8994047bf03c"
|
|
|
f268f1 |
+" f4b1b200488d5a8f889ec5ab3a9e443f54e7d96e47aaa1bd404631f9f034"
|
|
|
f268f1 |
+" b604e12b5b7386dd3a921b71c73f32e5c3c2aba17ebfa452a0b06890d120"
|
|
|
f268f1 |
+" 1279e9d7c940baf219c7a50092860d01#)"
|
|
|
f268f1 |
+" (p #00fc5c6e16ce1f037bcdf7b372b28f1672b856aef7cd67d84e7d07afd543"
|
|
|
f268f1 |
+" 26c335be438f4e2f1c434e6bd2b2ec526d97522bcc5c3a6bf414c674da66"
|
|
|
f268f1 |
+" 381c7a3f842fe3f95ab865694606a33779b2a15b58ed5ea75f8c6566bbd1"
|
|
|
f268f1 |
+" 2436e637a73d49778a8c34d86929f34d5822b05124b640a886590ab7ba5c"
|
|
|
f268f1 |
+" 97da57e836da7a9cad#)"
|
|
|
f268f1 |
+" (q #00ccbe7b096906ee45bf884738a8f817e5b6ba6755e3e8058bb8e253d68e"
|
|
|
f268f1 |
+" ef2ce74f4af74e268d850b3fecc31cd4ebec6ac8722a257dfda67796f01e"
|
|
|
f268f1 |
+" cd2857f83730756bbdd47b0c87c56c8740a5bb272c78c9745a545b0b306f"
|
|
|
f268f1 |
+" 444afa71e4216166f9ee65de7c04d7fda9155b7fe27aba698672a6068d9b"
|
|
|
f268f1 |
+" 9055609e4c5da9b655#)"
|
|
|
f268f1 |
+" (u #00afdecbdc5268ea7b1bff7284db7f6757dae3165fd80691ed2bbe8e54a1"
|
|
|
f268f1 |
+" 6f7ff950aad059e9695903d93e59ff206ee1470bd2b099ca4e83426a7684"
|
|
|
f268f1 |
+" 75a1ecafd3092fec0f008d78fe773174ec6fbff85384f3a91c2e4b1f59f1"
|
|
|
f268f1 |
+" 1f2000fee86569f6cab5de338087bc615b90570de4aeb1a9125abbe3834d"
|
|
|
f268f1 |
+" 5a69716c0a5fa20603#)))";
|
|
|
f268f1 |
+/* A sample 2048 bit RSA key used for the selftests (public only). */
|
|
|
f268f1 |
static const char sample_public_key[] =
|
|
|
f268f1 |
"(public-key"
|
|
|
f268f1 |
" (rsa"
|
|
|
f268f1 |
-" (n #00e0ce96f90b6c9e02f3922beada93fe50a875eac6bcc18bb9a9cf2e84965caa"
|
|
|
f268f1 |
-" 2d1ff95a7f542465c6c0c19d276e4526ce048868a7a914fd343cc3a87dd74291"
|
|
|
f268f1 |
-" ffc565506d5bbb25cbac6a0e2dd1f8bcaab0d4a29c2f37c950f363484bf269f7"
|
|
|
f268f1 |
-" 891440464baf79827e03a36e70b814938eebdc63e964247be75dc58b014b7ea251#)"
|
|
|
f268f1 |
+" (n #00c9d56d9d90db43d602ed9688138ab2bf6ea10610b27837a714a8ffdd00"
|
|
|
f268f1 |
+" ddb493a045cc9690edada9ddc4d6ca0cf0ed4f725e21499a1812158f905a"
|
|
|
f268f1 |
+" dbb63399a3e6b4f0c4972126bbe3baf2ffa072da89638e8b3e089d922abe"
|
|
|
f268f1 |
+" 16e14315fc57c71f0911671ca996d18b3e8093c159d06d39f2ac95cc1075"
|
|
|
f268f1 |
+" e93124d143af68524be716d749656f26c086adc0070ac1e12f8785863bdc"
|
|
|
f268f1 |
+" 5a99bee9f9b9e98227510415ab060e765a288d92bdc5b57ba8df4e47a2c1"
|
|
|
f268f1 |
+" e752bf47f762e03a6f4d6a4d4ed4b95969fab214c1eee62f95cd9472aee4"
|
|
|
f268f1 |
+" db189ac4cd70bdee3116b74965ac40190eb56d83f136bb082f2e4e9262a4"
|
|
|
f268f1 |
+" ff50db2045a2eb167af2d528c1fd4e0371#)"
|
|
|
f268f1 |
" (e #010001#)))";
|
|
|
f268f1 |
|
|
|
f268f1 |
|
|
|
f268f1 |
@@ -1379,20 +1403,35 @@ compute_keygrip (gcry_md_hd_t md, gcry_s
|
|
|
f268f1 |
*/
|
|
|
f268f1 |
|
|
|
f268f1 |
static const char *
|
|
|
f268f1 |
-selftest_sign_1024 (gcry_sexp_t pkey, gcry_sexp_t skey)
|
|
|
f268f1 |
+selftest_sign (gcry_sexp_t pkey, gcry_sexp_t skey)
|
|
|
f268f1 |
{
|
|
|
f268f1 |
static const char sample_data[] =
|
|
|
f268f1 |
"(data (flags pkcs1)"
|
|
|
f268f1 |
- " (hash sha1 #11223344556677889900aabbccddeeff10203040#))";
|
|
|
f268f1 |
+ " (hash sha256 #11223344556677889900aabbccddeeffa0b0c0d0102030405060708090a1b1c1#))";
|
|
|
f268f1 |
static const char sample_data_bad[] =
|
|
|
f268f1 |
"(data (flags pkcs1)"
|
|
|
f268f1 |
- " (hash sha1 #11223344556677889900aabbccddeeff80203040#))";
|
|
|
f268f1 |
+ " (hash sha256 #11223344556677889900aabbccddeeffa0b0c0d0102030405060708091a1b1c1#))";
|
|
|
f268f1 |
+ static const char signature_ka[] =
|
|
|
f268f1 |
+ "(sig-val \n"
|
|
|
f268f1 |
+ " (rsa \n"
|
|
|
f268f1 |
+ " (s #0B12D55738B099D401C81BEEDA54E045B4B7D9CDA5A8769E9C484F696A58912A"
|
|
|
f268f1 |
+ "1E5DE7E5A2D181DA15A5C254D802AB75F1056E27406850AC7BE310BC32D2CED8"
|
|
|
f268f1 |
+ "6697FE84508F7EFFF4D147C52E955A0873EF2F52ED71F2FC9C3C12D4045CB643"
|
|
|
f268f1 |
+ "70158378E1494D8FBAD2248B9B64233D2CC2C1932B0531E539DEB07434B76D3B"
|
|
|
f268f1 |
+ "6959E8A37E33B234C0C8C2C8FB1D00939239C9C491B2EBEED77BF952B597E11B"
|
|
|
f268f1 |
+ "D4ED0C103D2B88BC78B4E505CF9D8D08B585CE3688D4FBE83ED58D1E1341AC4D"
|
|
|
f268f1 |
+ "7C5EFF3CBC565CC7AE61C2F568426763A5239D31C1FFFD366984901679A343C4"
|
|
|
f268f1 |
+ "01BB778BBA5E533B7875BA658A19AA9E56170F4A28E4322BF1621175FB06463E#)\n"
|
|
|
f268f1 |
+ " )\n"
|
|
|
f268f1 |
+ " )\n";
|
|
|
f268f1 |
|
|
|
f268f1 |
const char *errtxt = NULL;
|
|
|
f268f1 |
gcry_error_t err;
|
|
|
f268f1 |
gcry_sexp_t data = NULL;
|
|
|
f268f1 |
gcry_sexp_t data_bad = NULL;
|
|
|
f268f1 |
gcry_sexp_t sig = NULL;
|
|
|
f268f1 |
+ char buf[1024];
|
|
|
f268f1 |
+ size_t len;
|
|
|
f268f1 |
|
|
|
f268f1 |
err = gcry_sexp_sscan (&data, NULL,
|
|
|
f268f1 |
sample_data, strlen (sample_data));
|
|
|
f268f1 |
@@ -1411,6 +1450,12 @@ selftest_sign_1024 (gcry_sexp_t pkey, gc
|
|
|
f268f1 |
errtxt = "signing failed";
|
|
|
f268f1 |
goto leave;
|
|
|
f268f1 |
}
|
|
|
f268f1 |
+ len = gcry_sexp_sprint (sig, GCRYSEXP_FMT_ADVANCED, buf, sizeof(buf));
|
|
|
f268f1 |
+ if (len != sizeof (signature_ka) - 1 || memcmp (buf, signature_ka, len) != 0)
|
|
|
f268f1 |
+ {
|
|
|
f268f1 |
+ errtxt = "signature KAT failed";
|
|
|
f268f1 |
+ goto leave;
|
|
|
f268f1 |
+ }
|
|
|
f268f1 |
err = gcry_pk_verify (sig, data, pkey);
|
|
|
f268f1 |
if (err)
|
|
|
f268f1 |
{
|
|
|
f268f1 |
@@ -1467,11 +1512,11 @@ extract_a_from_sexp (gcry_sexp_t encr_da
|
|
|
f268f1 |
|
|
|
f268f1 |
|
|
|
f268f1 |
static const char *
|
|
|
f268f1 |
-selftest_encr_1024 (gcry_sexp_t pkey, gcry_sexp_t skey)
|
|
|
f268f1 |
+selftest_encr (gcry_sexp_t pkey, gcry_sexp_t skey)
|
|
|
f268f1 |
{
|
|
|
f268f1 |
const char *errtxt = NULL;
|
|
|
f268f1 |
gcry_error_t err;
|
|
|
f268f1 |
- const unsigned int nbits = 1000; /* Encrypt 1000 random bits. */
|
|
|
f268f1 |
+ const unsigned int nbits = 2000; /* Encrypt 2000 random bits. */
|
|
|
f268f1 |
gcry_mpi_t plaintext = NULL;
|
|
|
f268f1 |
gcry_sexp_t plain = NULL;
|
|
|
f268f1 |
gcry_sexp_t encr = NULL;
|
|
|
f268f1 |
@@ -1594,12 +1639,12 @@ selftests_rsa (selftest_report_func_t re
|
|
|
f268f1 |
}
|
|
|
f268f1 |
|
|
|
f268f1 |
what = "sign";
|
|
|
f268f1 |
- errtxt = selftest_sign_1024 (pkey, skey);
|
|
|
f268f1 |
+ errtxt = selftest_sign (pkey, skey);
|
|
|
f268f1 |
if (errtxt)
|
|
|
f268f1 |
goto failed;
|
|
|
f268f1 |
|
|
|
f268f1 |
what = "encrypt";
|
|
|
f268f1 |
- errtxt = selftest_encr_1024 (pkey, skey);
|
|
|
f268f1 |
+ errtxt = selftest_encr (pkey, skey);
|
|
|
f268f1 |
if (errtxt)
|
|
|
f268f1 |
goto failed;
|
|
|
f268f1 |
|
|
|
f268f1 |
diff -up libgcrypt-1.5.3/random/drbg.c.fips-reqs libgcrypt-1.5.3/random/drbg.c
|
|
|
f268f1 |
--- libgcrypt-1.5.3/random/drbg.c.fips-reqs 2014-11-12 17:05:01.000000000 +0100
|
|
|
f268f1 |
+++ libgcrypt-1.5.3/random/drbg.c 2014-11-14 14:45:33.820190218 +0100
|
|
|
f268f1 |
@@ -390,6 +390,9 @@ gcry_drbg_fips_continuous_test (struct g
|
|
|
f268f1 |
ret = memcmp (drbg->prev, buf, gcry_drbg_blocklen (drbg));
|
|
|
f268f1 |
memcpy (drbg->prev, buf, gcry_drbg_blocklen (drbg));
|
|
|
f268f1 |
/* the test shall pass when the two compared values are not equal */
|
|
|
f268f1 |
+ if (ret == 0)
|
|
|
f268f1 |
+ fips_signal_error ("duplicate block returned by DRBG");
|
|
|
f268f1 |
+
|
|
|
f268f1 |
return ret != 0;
|
|
|
f268f1 |
}
|
|
|
f268f1 |
|
|
|
f268f1 |
diff -up libgcrypt-1.5.3/src/visibility.c.fips-reqs libgcrypt-1.5.3/src/visibility.c
|
|
|
f268f1 |
--- libgcrypt-1.5.3/src/visibility.c.fips-reqs 2013-07-25 11:10:04.000000000 +0200
|
|
|
f268f1 |
+++ libgcrypt-1.5.3/src/visibility.c 2014-11-12 17:05:27.251973230 +0100
|
|
|
f268f1 |
@@ -1217,6 +1217,9 @@ gcry_kdf_derive (const void *passphrase,
|
|
|
f268f1 |
unsigned long iterations,
|
|
|
f268f1 |
size_t keysize, void *keybuffer)
|
|
|
f268f1 |
{
|
|
|
f268f1 |
+ if (!fips_is_operational ())
|
|
|
f268f1 |
+ return gpg_error (fips_not_operational ());
|
|
|
f268f1 |
+
|
|
|
f268f1 |
return _gcry_kdf_derive (passphrase, passphraselen, algo, hashalgo,
|
|
|
f268f1 |
salt, saltlen, iterations, keysize, keybuffer);
|
|
|
f268f1 |
}
|
|
|
f268f1 |
@@ -1271,6 +1274,13 @@ void
|
|
|
f268f1 |
gcry_mpi_randomize (gcry_mpi_t w,
|
|
|
f268f1 |
unsigned int nbits, enum gcry_random_level level)
|
|
|
f268f1 |
{
|
|
|
f268f1 |
+ if (!fips_is_operational ())
|
|
|
f268f1 |
+ {
|
|
|
f268f1 |
+ (void)fips_not_operational ();
|
|
|
f268f1 |
+ fips_signal_fatal_error ("called in non-operational state");
|
|
|
f268f1 |
+ fips_noreturn ();
|
|
|
f268f1 |
+ }
|
|
|
f268f1 |
+
|
|
|
f268f1 |
_gcry_mpi_randomize (w, nbits, level);
|
|
|
f268f1 |
}
|
|
|
f268f1 |
|
|
|
f268f1 |
@@ -1296,6 +1306,9 @@ gcry_prime_generate (gcry_mpi_t *prime,
|
|
|
f268f1 |
gcry_random_level_t random_level,
|
|
|
f268f1 |
unsigned int flags)
|
|
|
f268f1 |
{
|
|
|
f268f1 |
+ if (!fips_is_operational ())
|
|
|
f268f1 |
+ return gpg_error (fips_not_operational ());
|
|
|
f268f1 |
+
|
|
|
f268f1 |
return _gcry_prime_generate (prime, prime_bits, factor_bits, factors,
|
|
|
f268f1 |
cb_func, cb_arg, random_level, flags);
|
|
|
f268f1 |
}
|