summaryrefslogtreecommitdiff
path: root/jwt/algorithms.py
diff options
context:
space:
mode:
authorMark Adams <madams@atlassian.com>2015-03-17 15:22:23 -0500
committerMark Adams <madams@atlassian.com>2015-03-17 15:23:10 -0500
commitaa8860111afff817c2e8ca0e78c011e50195388f (patch)
treec122570535d9b88c8c63dd7679b08e13f8850af1 /jwt/algorithms.py
parent3e59fe6c9e88d212180dfec61b36d58858af0367 (diff)
downloadpyjwt-aa8860111afff817c2e8ca0e78c011e50195388f.tar.gz
None algorithm now converts empty string to None prior to validation
Diffstat (limited to 'jwt/algorithms.py')
-rw-r--r--jwt/algorithms.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/jwt/algorithms.py b/jwt/algorithms.py
index 83d7d12..4ed0c21 100644
--- a/jwt/algorithms.py
+++ b/jwt/algorithms.py
@@ -69,10 +69,13 @@ class NoneAlgorithm(Algorithm):
operations are required.
"""
def prepare_key(self, key):
+ if key == '':
+ key = None
+
if key is not None:
raise InvalidKeyError('When alg = "none", key value must be None.')
- return None
+ return key
def sign(self, msg, key):
return b''