diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-10-19 19:11:30 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-10-19 22:32:42 -0700 |
commit | a1a21f46c0ab36fc49b087b2d70751ed23c94724 (patch) | |
tree | 2e76552b6ca2f1be29b8de0c900eb57213037062 /cryptography | |
parent | 962f66effa666c161aa93bb55b0f9c4deff67100 (diff) | |
download | cryptography-a1a21f46c0ab36fc49b087b2d70751ed23c94724.tar.gz cryptography-a1a21f46c0ab36fc49b087b2d70751ed23c94724.tar.bz2 cryptography-a1a21f46c0ab36fc49b087b2d70751ed23c94724.zip |
Fixed an issue in fernet where the wrong exception would occur on an all-nulls input.
Also switched a few tests to not generate a key
Diffstat (limited to 'cryptography')
-rw-r--r-- | cryptography/fernet.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cryptography/fernet.py b/cryptography/fernet.py index cdb9bdca..153f398b 100644 --- a/cryptography/fernet.py +++ b/cryptography/fernet.py @@ -90,7 +90,7 @@ class Fernet(object): except (TypeError, binascii.Error): raise InvalidToken - if six.indexbytes(data, 0) != 0x80: + if not data or six.indexbytes(data, 0) != 0x80: raise InvalidToken try: |