]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Mon May 14 04:23:52 BST 2012 david-sarah@jacaranda.org
authorDaira Hopwood <daira@jacaranda.org>
Thu, 5 Sep 2013 16:45:44 +0000 (17:45 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Thu, 5 Sep 2013 16:45:44 +0000 (17:45 +0100)
  * Suppress the PowmInsecureWarning from PyCrypto. refs #1586

src/allmydata/__init__.py
src/allmydata/_auto_deps.py

index 37264d05dc51e106ee044feca9aae22a5d387bf9..4ddea757fa449783fbbe22c1e26459f1e38623f7 100644 (file)
@@ -145,7 +145,7 @@ def normalized_version(verstr, what=None):
 def get_package_versions_and_locations():
     import warnings
     from _auto_deps import package_imports, deprecation_messages, \
-        user_warning_messages, warning_imports
+        user_warning_messages, runtime_warning_messages, warning_imports
 
     def package_dir(srcfile):
         return os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile))))
@@ -168,6 +168,8 @@ def get_package_versions_and_locations():
         warnings.filterwarnings("ignore", category=DeprecationWarning, message=msg, append=True)
     for msg in user_warning_messages:
         warnings.filterwarnings("ignore", category=UserWarning, message=msg, append=True)
+    for msg in runtime_warning_messages:
+        warnings.filterwarnings("ignore", category=RuntimeWarning, message=msg, append=True)
     try:
         for modulename in warning_imports:
             try:
@@ -175,9 +177,7 @@ def get_package_versions_and_locations():
             except ImportError:
                 pass
     finally:
-        for ign in user_warning_messages:
-            warnings.filters.pop()
-        for ign in deprecation_messages:
+        for ign in runtime_warning_messages + user_warning_messages + deprecation_messages:
             warnings.filters.pop()
 
     packages = []
index aa649ce5cd026e230cf4979cdfe85191d1d95f38..37acb4b2485043e8ad1236bc0533f0354fe5a7f5 100644 (file)
@@ -121,6 +121,10 @@ user_warning_messages = [
     "Hashing uninitialized InterfaceClass instance",
 ]
 
+runtime_warning_messages = [
+    "Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.",
+]
+
 warning_imports = [
     'nevow',
     'twisted.persisted.sob',