diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2016-11-05 22:08:21 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-11-06 10:08:21 +0800 |
commit | b924696b2e8731f39696584d12cceeb3aeb2d874 (patch) | |
tree | c5daebaa75b7eee323cd29443f8f44e03adc5522 /tests/hazmat/primitives/test_hkdf.py | |
parent | 21ac453a1afe01e3f47b7daad9af379725392162 (diff) | |
download | cryptography-b924696b2e8731f39696584d12cceeb3aeb2d874.tar.gz cryptography-b924696b2e8731f39696584d12cceeb3aeb2d874.tar.bz2 cryptography-b924696b2e8731f39696584d12cceeb3aeb2d874.zip |
Fixes #3211 -- fixed hkdf's output with short length (#3215)
Diffstat (limited to 'tests/hazmat/primitives/test_hkdf.py')
-rw-r--r-- | tests/hazmat/primitives/test_hkdf.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_hkdf.py b/tests/hazmat/primitives/test_hkdf.py index e33529c9..a05fd752 100644 --- a/tests/hazmat/primitives/test_hkdf.py +++ b/tests/hazmat/primitives/test_hkdf.py @@ -142,6 +142,17 @@ class TestHKDF(object): hkdf.verify(b"foo", u"bar") + def test_derive_short_output(self, backend): + hkdf = HKDF( + hashes.SHA256(), + 4, + salt=None, + info=None, + backend=backend + ) + + assert hkdf.derive(b"\x01" * 16) == b"gJ\xfb{" + @pytest.mark.requires_backend_interface(interface=HMACBackend) class TestHKDFExpand(object): |