summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2020-10-07 21:20:39 -0400
committerEli Collins <elic@assurancetechnologies.com>2020-10-07 21:20:39 -0400
commit479d593f8b05f31b59b1448509879d6977d5d580 (patch)
tree719bdbad0707214ca9827d6c119e0f9408e37c69
parent32a5183450a8d96f15da79f50cb6b0688f7a8f46 (diff)
downloadpasslib-479d593f8b05f31b59b1448509879d6977d5d580.tar.gz
bugfix: python2.6 compat fixes -- a few "{}" set constructors slipped in.
-rw-r--r--docs/history/1.7.rst5
-rw-r--r--passlib/crypto/digest.py11
-rw-r--r--passlib/handlers/bcrypt.py2
3 files changed, 14 insertions, 4 deletions
diff --git a/docs/history/1.7.rst b/docs/history/1.7.rst
index 42ffeec..95d57f5 100644
--- a/docs/history/1.7.rst
+++ b/docs/history/1.7.rst
@@ -15,6 +15,11 @@ Passlib 1.7
**1.7.4** (NOT YET RELEASED)
============================
+Bugfixes
+--------
+
+* Fixed some Python 2.6 errors from last release (:issue:`128`)
+
Other Changes
-------------
* .. py:currentmodule:: passlib.context
diff --git a/passlib/crypto/digest.py b/passlib/crypto/digest.py
index 8da9b5e..90e0cad 100644
--- a/passlib/crypto/digest.py
+++ b/passlib/crypto/digest.py
@@ -120,8 +120,13 @@ _fallback_info = {
def _gen_fallback_info():
+ """
+ internal helper used to generate ``_fallback_info`` dict.
+ currently only run manually to update the above list;
+ not invoked at runtime.
+ """
out = {}
- for alg in sorted(hashlib.algorithms_available | {"md4"}):
+ for alg in sorted(hashlib.algorithms_available | set(["md4"])):
info = lookup_hash(alg)
out[info.name] = (info.digest_size, info.block_size)
return out
@@ -579,7 +584,7 @@ mock_fips_mode = False
#: algorithms allowed under FIPS mode (subset of hashlib.algorithms_available);
#: per https://csrc.nist.gov/Projects/Hash-Functions FIPS 202 list.
-_fips_algorithms = {
+_fips_algorithms = set([
# FIPS 180-4 and FIPS 202
'sha1',
'sha224',
@@ -596,7 +601,7 @@ _fips_algorithms = {
'sha3_512',
'shake_128',
'shake_256',
-}
+])
def _set_mock_fips_mode(enable=True):
diff --git a/passlib/handlers/bcrypt.py b/passlib/handlers/bcrypt.py
index c203fdd..b83b110 100644
--- a/passlib/handlers/bcrypt.py
+++ b/passlib/handlers/bcrypt.py
@@ -1050,7 +1050,7 @@ class bcrypt_sha256(_wrapped_bcrypt):
# class specific
#--------------------
- _supported_versions = {1, 2}
+ _supported_versions = set([1, 2])
#===================================================================
# instance attrs