Skip to content

Commit

Permalink
probes with ec point formats extension from RFC 4492
Browse files Browse the repository at this point in the history
  • Loading branch information
tomato42 committed Aug 27, 2016
1 parent 0b5654d commit eb163e0
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 1 deletion.
11 changes: 10 additions & 1 deletion prober.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,16 @@
SupportedGroupsOddLen12PFS(),
SupportedGroupsOverflow(),
SupportedGroupsOverflow12(),
SupportedGroupsOverflow12PFS()
SupportedGroupsOverflow12PFS(),
ECPointFormatsNull(),
ECPointFormatsNull12(),
ECPointFormatsNull12PFS(),
ECPointFormatsOverflow(),
ECPointFormatsOverflow12(),
ECPointFormatsOverflow12PFS(),
ECPointFormatsCompOnly(),
ECPointFormatsCompOnly12(),
ECPointFormatsCompOnly12PFS()
]

def probe(ipaddress, port, starttls, specified_probe):
Expand Down
65 changes: 65 additions & 0 deletions probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1819,3 +1819,68 @@ class SupportedGroupsOverflow12PFS(SupportedGroupsOverflow,
NormalHandshake12PFS):
'''As with SupportedGroupsOverflow but in PFS TLSv1.2 hello'''
pass


class ECPointFormatsNull(NormalHandshake):
'''Send empty ec point formats extension in hello'''

def make_point_formats_hello(self, value):
point_formats_ext = Extension.create(
extension_type=11,
data=value)
return self.make_hello([point_formats_ext])

def test(self, sock):
logging.debug('Sending Client Hello...')
# normal extension has an array, don't send anything
sock.write(self.make_point_formats_hello(b''))


class ECPointFormatsNull12(ECPointFormatsNull, NormalHandshake12):
'''Send empty ec point formats extension in TLSv1.2 hello'''
pass


class ECPointFormatsNull12PFS(ECPointFormatsNull, NormalHandshake12PFS):
'''Send empty ec point formats extension in PFS TLSv1.2 hello'''
pass


class ECPointFormatsOverflow(ECPointFormatsNull):
'''Send ec point formats extension with length larger than data in hello'''

def test(self, sock):
logging.debug('Sending Client Hello...')
# first byte is the length of array, send too large one
sock.write(self.make_point_formats_hello(b'\x04\x00'))


class ECPointFormatsOverflow12(ECPointFormatsOverflow, NormalHandshake12):
'''As with ECPointFormatsOverflow but in TLSv1.2 hello'''
pass


class ECPointFormatsOverflow12PFS(ECPointFormatsOverflow,
NormalHandshake12PFS):
'''As with ECPointFormatsOverflow but in PFS TLSv1.2 hello'''
pass


class ECPointFormatsCompOnly(ECPointFormatsNull):
'''Send ec point formats extension without uncompressed format'''

def test(self, sock):
logging.debug('Sending Client Hello...')
# the uncompressed format is mandatory, send extension without it
sock.write(self.make_point_formats_hello(b'\x02\x01\x02'))


class ECPointFormatsCompOnly12(ECPointFormatsCompOnly, NormalHandshake12):
'''As with ECPointFormatsCompOnly but in TLSv1.2 hello'''
pass


class ECPointFormatsCompOnly12PFS(ECPointFormatsCompOnly,
NormalHandshake12PFS):
'''As with ECPointFormatsCompOnly but in PFS TLS v1.2 hello'''
pass

0 comments on commit eb163e0

Please sign in to comment.