Skip to content

Commit

Permalink
TLSv1.2 versions of MaxFragmentInvalid probe
Browse files Browse the repository at this point in the history
  • Loading branch information
tomato42 committed Aug 27, 2016
1 parent 1596c0e commit 8ef1007
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
2 changes: 2 additions & 0 deletions prober.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@
MaxFragmentNull12(),
MaxFragmentNull12PFS(),
MaxFragmentInvalid(),
MaxFragmentInvalid12(),
MaxFragmentInvalid12PFS(),
ClientCertURLsNotNull(),
TrustedCANull(),
TrustedCAOverflow(),
Expand Down
10 changes: 10 additions & 0 deletions probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,16 @@ def test(self, sock):
sock.write(self.make_fragment_hello('\x08'))


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


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


class ClientCertURLsNotNull(NormalHandshake):
'''Send client certificate URL indication extension that is not empty'''

Expand Down
43 changes: 43 additions & 0 deletions tests/test_probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1662,6 +1662,49 @@ def test_test(self):
b'\x08'])


class TestMaxFragmentInvalid12(unittest.TestCase):
def test_test(self):
probe = MaxFragmentInvalid12()
sock = MockSock()

probe.test(sock)

self.assertEqual(sock.sent_data,
[b'\x16\x03\x01\x00X'
b'\x01\x00\x00T'
b'\x03\x03' +
RANDOM_STR +
b'\x00'
b'\x00&' +
DEFAULT_12_CIPHERS_STR +
b'\x01\x00'
b'\x00\x05'
b'\x00\x01\x00\x01'
b'\x08'])


class TestMaxFragmentInvalid12PFS(unittest.TestCase):
def test_test(self):
probe = MaxFragmentInvalid12PFS()
sock = MockSock()

probe.test(sock)

self.maxDiff = None
self.assertEqual(sock.sent_data,
[b"\x16\x03\x01\x00\x90"
b"\x01\x00\x00\x8c"
b"\x03\x03" +
RANDOM_STR +
b"\x00"
b"\x00^" +
DEFAULT_PFS_CIPHERS_STR +
b"\x01\x00"
b'\x00\x05'
b'\x00\x01\x00\x01'
b'\x08'])


class TestClientCertURLsNotNull(unittest.TestCase):
def test_test(self):
probe = ClientCertURLsNotNull()
Expand Down

0 comments on commit 8ef1007

Please sign in to comment.