summaryrefslogtreecommitdiff
path: root/lib/Crypto/Util
diff options
context:
space:
mode:
authorDwayne C. Litzenberger <dlitz@dlitz.net>2011-10-10 14:51:07 -0400
committerDwayne C. Litzenberger <dlitz@dlitz.net>2011-10-10 14:51:07 -0400
commitbf38995ffa51e28b8232e9417b450a8edbd23dec (patch)
tree7dfa5ffa862d9b47a97c19a027e6673e1567c4c6 /lib/Crypto/Util
parentb5cd39f31bd34598e4b166db83328d71ca2b7b33 (diff)
parent9cfb332b22e38b9d965bfb691eca67b6b8fa64e3 (diff)
downloadpycrypto-bf38995ffa51e28b8232e9417b450a8edbd23dec.tar.gz
Merge branch 'master' into py3k
Conflicts: setup.py src/_fastmath.c
Diffstat (limited to 'lib/Crypto/Util')
-rw-r--r--lib/Crypto/Util/number.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Crypto/Util/number.py b/lib/Crypto/Util/number.py
index 38cb973..2b5beb6 100644
--- a/lib/Crypto/Util/number.py
+++ b/lib/Crypto/Util/number.py
@@ -26,7 +26,8 @@
__revision__ = "$Id$"
-from Crypto.pct_warnings import GetRandomNumber_DeprecationWarning
+from Crypto.pct_warnings import GetRandomNumber_DeprecationWarning, PowmInsecureWarning
+from warnings import warn as _warn
import math
import sys
from Crypto.Util.py3compat import *
@@ -51,6 +52,10 @@ except ImportError:
# "not being in the path. _fastmath was found at "+_fm_path)
_fastmath = None
+# You need libgmp v5 or later to get mpz_powm_sec. Warn if it's not available.
+if _fastmath is not None and not _fastmath.HAVE_DECL_MPZ_POWM_SEC:
+ _warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
+
# New functions
from _number_new import *