Skip to content

Commit

Permalink
Merge 94a0452 into 777b4e2
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Jun 25, 2018
2 parents 777b4e2 + 94a0452 commit 4438eca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tlslite/utils/aesgcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# look-up table.

from __future__ import division
from .constanttime import ct_compare_digest
from .cryptomath import bytesToNumber, numberToByteArray

class AESGCM(object):
Expand Down Expand Up @@ -152,7 +153,7 @@ def open(self, nonce, ciphertext, data):
counter[-1] = 1
tagMask = self._rawAesEncrypt(counter)

if tag != self._auth(ciphertext, data, tagMask):
if not ct_compare_digest(tag, self._auth(ciphertext, data, tagMask)):
return None

# The counter starts at 2 for the actual decryption.
Expand Down

0 comments on commit 4438eca

Please sign in to comment.