summaryrefslogtreecommitdiff
path: root/passlib/handlers
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2019-11-09 16:37:06 -0500
committerEli Collins <elic@assurancetechnologies.com>2019-11-09 16:37:06 -0500
commit88781822e23df38cc81eae00cce11e527d7dcc7b (patch)
tree94a27503b3b68bcfb06d1179955120049a5068b4 /passlib/handlers
parentb4ad2ab7794466e80fdd11847e862aa677827b75 (diff)
downloadpasslib-88781822e23df38cc81eae00cce11e527d7dcc7b.tar.gz
Back out changeset 53dc260cead7 -- restores argon2 to 16 byte hash output.
per followup to original issue (https://bitbucket.org/ecollins/passlib/issues/88#comment-35296567) it was pointed out that citation for 32 byte hash output was out of date, and that argon2_cffi is correctly following the more up-to-date argon2 spec. this restores the stable branch to the 1.7.1 policy of following argon2_cffi's defaults.
Diffstat (limited to 'passlib/handlers')
-rw-r--r--passlib/handlers/argon2.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/passlib/handlers/argon2.py b/passlib/handlers/argon2.py
index b665a20..578c2c5 100644
--- a/passlib/handlers/argon2.py
+++ b/passlib/handlers/argon2.py
@@ -63,6 +63,8 @@ else:
time_cost = 2
memory_cost = 512
parallelism = 2
+ salt_len = 16
+ hash_len = 16
_default_version = 0x13
#=============================================================================
@@ -108,8 +110,7 @@ class _Argon2Common(uh.SubclassBackendMixin, uh.ParallelismMixin,
# GenericHandler
#------------------------
ident = u("$argon2i")
- # NOTE: ignoring argon2_cffi's default of 16, to better match libargon2
- checksum_size = 32
+ checksum_size = _default_settings.hash_len
# NOTE: from_string() relies on the ordering of these...
ident_values = (u("$argon2i$"), u("$argon2d$"))
@@ -117,7 +118,7 @@ class _Argon2Common(uh.SubclassBackendMixin, uh.ParallelismMixin,
#------------------------
# HasSalt
#------------------------
- default_salt_size = 16
+ default_salt_size = _default_settings.salt_len
min_salt_size = 8
max_salt_size = MAX_UINT32