gentleknife / rpms / libgcrypt

Forked from rpms/libgcrypt 4 years ago
Clone

Blame SOURCES/libgcrypt-1.8.3-md-fips-enforce.patch

66e42d
diff -up libgcrypt-1.8.3/cipher/md.c.fips-enforce libgcrypt-1.8.3/cipher/md.c
4bbd51
--- libgcrypt-1.8.3/cipher/md.c.fips-enforce	2017-11-23 19:16:58.000000000 +0100
4bbd51
+++ libgcrypt-1.8.3/cipher/md.c	2020-04-17 15:07:31.364945130 +0200
4bbd51
@@ -409,13 +409,10 @@ md_enable (gcry_md_hd_t hd, int algorith
66e42d
     }
66e42d
 
66e42d
 
66e42d
-  if (!err && algorithm == GCRY_MD_MD5 && fips_mode ())
66e42d
+  if (!err && !spec->flags.fips && fips_mode ())
66e42d
     {
4bbd51
-      _gcry_inactivate_fips_mode ("MD5 used");
66e42d
       if (_gcry_enforced_fips_mode () )
66e42d
         {
4bbd51
-          /* We should never get to here because we do not register
4bbd51
-             MD5 in enforced fips mode. But better throw an error.  */
4bbd51
           err = GPG_ERR_DIGEST_ALGO;
4bbd51
         }
4bbd51
     }