diff options
author | Eli Collins <elic@assurancetechnologies.com> | 2019-11-09 16:37:06 -0500 |
---|---|---|
committer | Eli Collins <elic@assurancetechnologies.com> | 2019-11-09 16:37:06 -0500 |
commit | 88781822e23df38cc81eae00cce11e527d7dcc7b (patch) | |
tree | 94a27503b3b68bcfb06d1179955120049a5068b4 | |
parent | b4ad2ab7794466e80fdd11847e862aa677827b75 (diff) | |
download | passlib-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.
-rw-r--r-- | docs/history/1.7.rst | 2 | ||||
-rw-r--r-- | passlib/handlers/argon2.py | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/docs/history/1.7.rst b/docs/history/1.7.rst index 31067cf..f160121 100644 --- a/docs/history/1.7.rst +++ b/docs/history/1.7.rst @@ -7,8 +7,6 @@ Passlib 1.7 **1.7.2** (NOT YET RELEASED) ============================ -* :class:`~passlib.hash.argon` -- default hash size increased to 32 bytes (:issue:`88`). - **1.7.1** (2017-1-30) ===================== 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 |