diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-05-04 11:02:29 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-05-04 11:02:29 -0400 |
commit | 7cec8fb72f7c61f06cd4675af5cb6ae83fbc1e36 (patch) | |
tree | 52c2420c39a710bb429eec8c6d74b15c1550a46d /src | |
parent | d87db1cec44118a8e7fecb59b60f284e35ea6f6c (diff) | |
parent | b6bca759310cf9e4917348386139b5ebab15b863 (diff) | |
download | cryptography-7cec8fb72f7c61f06cd4675af5cb6ae83fbc1e36.tar.gz cryptography-7cec8fb72f7c61f06cd4675af5cb6ae83fbc1e36.tar.bz2 cryptography-7cec8fb72f7c61f06cd4675af5cb6ae83fbc1e36.zip |
Merge pull request #1902 from Ayrx/make-check-clearer
Rewrite check to read clearer.
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/hazmat/primitives/kdf/hkdf.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cryptography/hazmat/primitives/kdf/hkdf.py b/src/cryptography/hazmat/primitives/kdf/hkdf.py index 65b7091a..f738bbdc 100644 --- a/src/cryptography/hazmat/primitives/kdf/hkdf.py +++ b/src/cryptography/hazmat/primitives/kdf/hkdf.py @@ -26,7 +26,7 @@ class HKDF(object): self._algorithm = algorithm - if not isinstance(salt, bytes) and salt is not None: + if not (salt is None or isinstance(salt, bytes)): raise TypeError("salt must be bytes.") if salt is None: @@ -77,7 +77,7 @@ class HKDFExpand(object): self._length = length - if not isinstance(info, bytes) and info is not None: + if not (info is None or isinstance(info, bytes)): raise TypeError("info must be bytes.") if info is None: |