diff options
| author | Eli Collins <elic@assurancetechnologies.com> | 2020-10-07 21:20:39 -0400 |
|---|---|---|
| committer | Eli Collins <elic@assurancetechnologies.com> | 2020-10-07 21:20:39 -0400 |
| commit | 479d593f8b05f31b59b1448509879d6977d5d580 (patch) | |
| tree | 719bdbad0707214ca9827d6c119e0f9408e37c69 /passlib/crypto | |
| parent | 32a5183450a8d96f15da79f50cb6b0688f7a8f46 (diff) | |
| download | passlib-479d593f8b05f31b59b1448509879d6977d5d580.tar.gz | |
bugfix: python2.6 compat fixes -- a few "{}" set constructors slipped in.
Diffstat (limited to 'passlib/crypto')
| -rw-r--r-- | passlib/crypto/digest.py | 11 |
1 files changed, 8 insertions, 3 deletions
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): |
