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

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