aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/hazmat/primitives/asymmetric
diff options
context:
space:
mode:
authormtury <maxence.tury@ssi.gouv.fr>2017-07-17 14:23:04 +0200
committerPaul Kehrer <paul.l.kehrer@gmail.com>2017-07-17 14:23:04 +0200
commitcc12beaccae801aa901c1f3dc9c936244633b022 (patch)
tree51f3375ce94357c60e89fa991af6fb1712309781 /src/cryptography/hazmat/primitives/asymmetric
parenta2173583d928cc95977f8dbbb7dd48cc732b24f5 (diff)
downloadcryptography-cc12beaccae801aa901c1f3dc9c936244633b022.tar.gz
cryptography-cc12beaccae801aa901c1f3dc9c936244633b022.tar.bz2
cryptography-cc12beaccae801aa901c1f3dc9c936244633b022.zip
Remove DH generator size constraint (#3364)
* Remove DH generator size constraint * Check that g > 1
Diffstat (limited to 'src/cryptography/hazmat/primitives/asymmetric')
-rw-r--r--src/cryptography/hazmat/primitives/asymmetric/dh.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cryptography/hazmat/primitives/asymmetric/dh.py b/src/cryptography/hazmat/primitives/asymmetric/dh.py
index 92a493a0..4fc99524 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/dh.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/dh.py
@@ -87,8 +87,8 @@ class DHParameterNumbers(object):
if q is not None and not isinstance(q, six.integer_types):
raise TypeError("q must be integer or None")
- if q is None and g not in (2, 5):
- raise ValueError("DH generator must be 2 or 5")
+ if g < 2:
+ raise ValueError("DH generator must be 2 or greater")
self._p = p
self._g = g