Skip to content

Commit

Permalink
Merge pull request #336 from simo5/fixtls13tlsfuzzer
Browse files Browse the repository at this point in the history
Fix bug when returning errors for _tryDecrypt
  • Loading branch information
tomato42 committed Jan 10, 2019
2 parents 2a1e00a + 95a5729 commit 58f3e2c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tlslite/tlsconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2186,11 +2186,11 @@ def _serverSendTickets(self, settings):

def _tryDecrypt(self, settings, identity):
if not settings.ticketKeys:
return
return None, None

if len(identity.identity) < 13:
# too small for an encrypted ticket
return
return None, None

iv, encrypted_ticket = identity.identity[:12], identity.identity[12:]
for key in settings.ticketKeys:
Expand Down Expand Up @@ -2222,6 +2222,9 @@ def _tryDecrypt(self, settings, identity):

return ((identity.identity, psk, prf), ticket)

# no keys
return None, None

def _serverTLS13Handshake(self, settings, clientHello, cipherSuite,
privateKey, serverCertChain, version, scheme,
srv_alpns, reqCert):
Expand Down

0 comments on commit 58f3e2c

Please sign in to comment.