Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when returning errors for _tryDecrypt #336

Merged
merged 1 commit into from
Jan 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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