summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2016-04-24 15:05:33 -0700
committerJeff Forcier <jeff@bitprophet.org>2016-04-24 15:05:33 -0700
commit10f5ef94cf0f4cfd890574a711886abb86958ca1 (patch)
tree97966258dd1e5e15fb9461f807404992bb03cc00
parent972619dc208768be57b23ece4ac31e642bc72620 (diff)
parent7109ddf9e5feabf04016b00d681def30a4acbca7 (diff)
Merge pull request #649 from damz/pr/moduli
primes: min and max should be inclusive
-rw-r--r--paramiko/primes.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/paramiko/primes.py b/paramiko/primes.py
index 7415c182..d0e17575 100644
--- a/paramiko/primes.py
+++ b/paramiko/primes.py
@@ -113,12 +113,12 @@ class ModulusPack (object):
good = -1
# find nearest bitsize >= preferred
for b in bitsizes:
- if (b >= prefer) and (b < max) and (b < good or good == -1):
+ if (b >= prefer) and (b <= max) and (b < good or good == -1):
good = b
# if that failed, find greatest bitsize >= min
if good == -1:
for b in bitsizes:
- if (b >= min) and (b < max) and (b > good):
+ if (b >= min) and (b <= max) and (b > good):
good = b
if good == -1:
# their entire (min, max) range has no intersection with our range.