aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-10-20 07:53:00 -0700
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-10-20 07:53:00 -0700
commit75c024618951db12cb759825e21e7b95f41749af (patch)
treed10a77615707d68e75166437a444e46423ab7cdf /cryptography
parent962f66effa666c161aa93bb55b0f9c4deff67100 (diff)
parent461c8d286d3cff4b5f5ed962669defa9710e7605 (diff)
downloadcryptography-75c024618951db12cb759825e21e7b95f41749af.tar.gz
cryptography-75c024618951db12cb759825e21e7b95f41749af.tar.bz2
cryptography-75c024618951db12cb759825e21e7b95f41749af.zip
Merge pull request #1421 from alex/fix-bug
Fixed an issue in fernet where the wrong exception would occur on an all-nulls input.
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/fernet.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cryptography/fernet.py b/cryptography/fernet.py
index cdb9bdca..a8e0330e 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: