aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/hazmat/primitives/kdf
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2016-11-05 22:08:21 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2016-11-06 10:08:21 +0800
commitb924696b2e8731f39696584d12cceeb3aeb2d874 (patch)
treec5daebaa75b7eee323cd29443f8f44e03adc5522 /src/cryptography/hazmat/primitives/kdf
parent21ac453a1afe01e3f47b7daad9af379725392162 (diff)
downloadcryptography-b924696b2e8731f39696584d12cceeb3aeb2d874.tar.gz
cryptography-b924696b2e8731f39696584d12cceeb3aeb2d874.tar.bz2
cryptography-b924696b2e8731f39696584d12cceeb3aeb2d874.zip
Fixes #3211 -- fixed hkdf's output with short length (#3215)
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 f738bbdc..82ed9b1c 100644
--- a/src/cryptography/hazmat/primitives/kdf/hkdf.py
+++ b/src/cryptography/hazmat/primitives/kdf/hkdf.py
@@ -91,7 +91,7 @@ class HKDFExpand(object):
output = [b""]
counter = 1
- while (self._algorithm.digest_size // 8) * len(output) < self._length:
+ while self._algorithm.digest_size * (len(output) - 1) < self._length:
h = hmac.HMAC(key_material, self._algorithm, backend=self._backend)
h.update(output[-1])
h.update(self._info)