From d5e0a461cf16a22d11cb66c27d4272ac34bc4154 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 25 Nov 2022 00:42:22 +0100 Subject: [PATCH] Fixed invalid check for None --- RNS/Cryptography/HKDF.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RNS/Cryptography/HKDF.py b/RNS/Cryptography/HKDF.py index 111123a..0491dda 100644 --- a/RNS/Cryptography/HKDF.py +++ b/RNS/Cryptography/HKDF.py @@ -33,7 +33,7 @@ def hkdf(length=None, derive_from=None, salt=None, context=None): if length == None or length < 1: raise ValueError("Invalid output key length") - if derive_from == "None" or derive_from == "": + if derive_from == None or derive_from == "": raise ValueError("Cannot derive key from empty input material") if salt == None or len(salt) == 0: @@ -54,4 +54,4 @@ def hkdf(length=None, derive_from=None, salt=None, context=None): block = hmac_sha256(pseudorandom_key, block + context + bytes([i + 1])) derived += block - return derived[:length] \ No newline at end of file + return derived[:length]