aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/hazmat/primitives/kdf
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2018-01-06 17:55:27 -0600
committerAlex Gaynor <alex.gaynor@gmail.com>2018-01-06 18:55:27 -0500
commit858a429d88c7e35ecd224a98bfda2c3dd428ae1f (patch)
treea0770fc5150d2b9918a5b99b94c146051dc9ab1e /src/cryptography/hazmat/primitives/kdf
parent323f2ad66befb13ec3b31b5ab99c9448b9a6b067 (diff)
downloadcryptography-858a429d88c7e35ecd224a98bfda2c3dd428ae1f.tar.gz
cryptography-858a429d88c7e35ecd224a98bfda2c3dd428ae1f.tar.bz2
cryptography-858a429d88c7e35ecd224a98bfda2c3dd428ae1f.zip
The HKDF limit is actually 255 * digest_length_in_bytes (#4037)
* The HKDF limit is actually 255 * digest_length_in_bytes Previously we had a bug where we divided digest_size by 8...but HashAlgorithm.digest_size is already in bytes. * test longer output * changelog
Diffstat (limited to 'src/cryptography/hazmat/primitives/kdf')
-rw-r--r--src/cryptography/hazmat/primitives/kdf/hkdf.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptography/hazmat/primitives/kdf/hkdf.py b/src/cryptography/hazmat/primitives/kdf/hkdf.py
index 964ac2cc..917b4e9c 100644
--- a/src/cryptography/hazmat/primitives/kdf/hkdf.py
+++ b/src/cryptography/hazmat/primitives/kdf/hkdf.py
@@ -67,7 +67,7 @@ class HKDFExpand(object):
self._backend = backend
- max_length = 255 * (algorithm.digest_size // 8)
+ max_length = 255 * algorithm.digest_size
if length > max_length:
raise ValueError(