Skip to content

Commit

Permalink
add probes with session ticket extension from RFC 4507
Browse files Browse the repository at this point in the history
  • Loading branch information
tomato42 committed Aug 27, 2016
1 parent 7e68463 commit aeb017a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
8 changes: 7 additions & 1 deletion prober.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,13 @@
CachedInfoNull12PFS(),
CachedInfoOverflow(),
CachedInfoOverflow12(),
CachedInfoOverflow12PFS()
CachedInfoOverflow12PFS(),
SessionTicketNull(),
SessionTicketNull12(),
SessionTicketNull12PFS(),
SessionTicketOverflow(),
SessionTicketOverflow12(),
SessionTicketOverflow12PFS(),
]

def probe(ipaddress, port, starttls, specified_probe):
Expand Down
45 changes: 45 additions & 0 deletions probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2695,3 +2695,48 @@ class CachedInfoOverflow12(CachedInfoOverflow, NormalHandshake12):
class CachedInfoOverflow12PFS(CachedInfoOverflow, NormalHandshake12PFS):
'''Send cached info extension with invalid size in PFS TLSv1.2 hello'''
pass


class SessionTicketNull(NormalHandshake):
'''Send empty session ticket extension in hello'''

def make_session_ticket_hello(self, value):
session_ticket_ext = Extension.create(
extension_type=35,
data=value)
return self.make_hello([session_ticket_ext])

def test(self, sock):
logging.debug('Sending Client Hello...')
# first two bytes of the extension are the length, don't include any
sock.write(self.make_session_ticket_hello(b''))


class SessionTicketNull12(SessionTicketNull, NormalHandshake12):
'''Send empty session ticket extension in TLSv1.2 hello'''
pass


class SessionTicketNull12PFS(SessionTicketNull, NormalHandshake12PFS):
'''Send empty session ticket extension in PFS TLSv1.2 hello'''
pass


class SessionTicketOverflow(SessionTicketNull):
'''Send session ticket extension with too large length in hello'''

def test(self, sock):
logging.debug('Sending Client Hello...')
# first two bytes are the length, send too large one
sock.write(self.make_session_ticket_hello(b'\x02\x00' +
b'\xe7' * 0xff))


class SessionTicketOverflow12(SessionTicketOverflow, NormalHandshake12):
'''Send session ticket extension with too large length in TLSv1.2 hello'''
pass


class SessionTicketOverflow12PFS(SessionTicketOverflow, NormalHandshake12PFS):
'''Send session ticket ext with too large length in PFS TLSv1.2 hello'''
pass

0 comments on commit aeb017a

Please sign in to comment.