aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTerry Chia <terrycwk1994@gmail.com>2015-05-04 22:25:30 +0800
committerTerry Chia <terrycwk1994@gmail.com>2015-05-04 22:25:30 +0800
commitb6bca759310cf9e4917348386139b5ebab15b863 (patch)
tree52c2420c39a710bb429eec8c6d74b15c1550a46d
parentd87db1cec44118a8e7fecb59b60f284e35ea6f6c (diff)
downloadcryptography-b6bca759310cf9e4917348386139b5ebab15b863.tar.gz
cryptography-b6bca759310cf9e4917348386139b5ebab15b863.tar.bz2
cryptography-b6bca759310cf9e4917348386139b5ebab15b863.zip
Rewrite check to read clearer.
-rw-r--r--src/cryptography/hazmat/primitives/kdf/hkdf.py4
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: