Skip to content

Commit

Permalink
add next protocol negotiation probes from draft-agl-tls-nextprotoneg-04
Browse files Browse the repository at this point in the history
  • Loading branch information
tomato42 committed Aug 27, 2016
1 parent aeb017a commit d3b1295
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions prober.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@
SessionTicketOverflow(),
SessionTicketOverflow12(),
SessionTicketOverflow12PFS(),
NPNNotNull(),
NPNNotNull12(),
NPNNotNull12PFS()
]

def probe(ipaddress, port, starttls, specified_probe):
Expand Down
25 changes: 25 additions & 0 deletions probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2740,3 +2740,28 @@ class SessionTicketOverflow12(SessionTicketOverflow, NormalHandshake12):
class SessionTicketOverflow12PFS(SessionTicketOverflow, NormalHandshake12PFS):
'''Send session ticket ext with too large length in PFS TLSv1.2 hello'''
pass


class NPNNotNull(NormalHandshake):
'''Send non empty NPN extension in hello'''

def make_npn_hello(self, value):
npn_ext = Extension.create(
extension_type=13172,
data=value)
return self.make_hello([npn_ext])

def test(self, sock):
logging.debug('Sending Client Hello...')
# normal extension has to be empty
sock.write(self.make_npn_hello(b'\x04'))


class NPNNotNull12(NPNNotNull, NormalHandshake12):
'''Send non empty NPN extension in TLSv1.2 hello'''
pass


class NPNNotNull12PFS(NPNNotNull, NormalHandshake12PFS):
'''Send non empty NPN extension in PFS TLSv1.2 hello'''
pass

0 comments on commit d3b1295

Please sign in to comment.