Blame SOURCES/0001-Make-pdf-generation-work-in-FIPS-mode.patch

c67e63
From 42fc41280f42674cefba1b272e2714210ad56478 Mon Sep 17 00:00:00 2001
c67e63
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
c67e63
Date: Mon, 29 Jul 2013 15:22:37 +0200
c67e63
Subject: [PATCH] Make pdf generation work in FIPS mode
c67e63
c67e63
---
c67e63
 lib/dbtexmf/dblatex/grubber/index.py | 4 ++--
c67e63
 lib/dbtexmf/dblatex/grubber/util.py  | 8 ++++----
c67e63
 2 files changed, 6 insertions(+), 6 deletions(-)
c67e63
c67e63
diff --git a/lib/dbtexmf/dblatex/grubber/index.py b/lib/dbtexmf/dblatex/grubber/index.py
c67e63
index 6ee7c68..36becd5 100644
c67e63
--- a/lib/dbtexmf/dblatex/grubber/index.py
c67e63
+++ b/lib/dbtexmf/dblatex/grubber/index.py
c67e63
@@ -70,7 +70,7 @@ class Index(TexModule):
c67e63
             self.transcript = os.path.basename(self.transcript)
c67e63
 
c67e63
         if os.path.exists(self.source):
c67e63
-            self.md5 = md5_file(self.source)
c67e63
+            self.md5 = md5_file(self.source, False)
c67e63
         else:
c67e63
             self.md5 = None
c67e63
 
c67e63
@@ -193,7 +193,7 @@ class Index(TexModule):
c67e63
         if os.path.getsize(self.source) == 0:
c67e63
             msg.log(_("the index file %s is empty") % self.source, pkg="index")
c67e63
             return 0
c67e63
-        new = md5_file(self.source)
c67e63
+        new = md5_file(self.source, False)
c67e63
         if not os.path.exists(self.target):
c67e63
             self.md5 = new
c67e63
             return 1
c67e63
diff --git a/lib/dbtexmf/dblatex/grubber/util.py b/lib/dbtexmf/dblatex/grubber/util.py
c67e63
index fa3bda6..d664caa 100644
c67e63
--- a/lib/dbtexmf/dblatex/grubber/util.py
c67e63
+++ b/lib/dbtexmf/dblatex/grubber/util.py
c67e63
@@ -14,11 +14,11 @@ import os
c67e63
 from msg import _, msg
c67e63
 
c67e63
 
c67e63
-def md5_file(fname):
c67e63
+def md5_file(fname, usedforsecurity=True):
c67e63
     """
c67e63
     Compute the MD5 sum of a given file.
c67e63
     """
c67e63
-    m = hashlib.md5()
c67e63
+    m = hashlib.md5(usedforsecurity=usedforsecurity)
c67e63
     file = open(fname)
c67e63
     for line in file.readlines():
c67e63
         m.update(line)
c67e63
@@ -35,7 +35,7 @@ class Watcher:
c67e63
 
c67e63
     def watch(self, file):
c67e63
         if os.path.exists(file):
c67e63
-            self.files[file] = md5_file(file)
c67e63
+            self.files[file] = md5_file(file, False)
c67e63
         else:
c67e63
             self.files[file] = None
c67e63
 
c67e63
@@ -47,7 +47,7 @@ class Watcher:
c67e63
         changed = []
c67e63
         for file in self.files.keys():
c67e63
             if os.path.exists(file):
c67e63
-                new = md5_file(file)
c67e63
+                new = md5_file(file, False)
c67e63
                 if self.files[file] != new:
c67e63
                     msg.debug(_("%s MD5 checksum changed") % \
c67e63
                               os.path.basename(file))
c67e63
-- 
c67e63
1.8.1.4
c67e63