Skip to content

Commit

Permalink
Merge pull request #133 from tempesta-tech/avb-1308
Browse files Browse the repository at this point in the history
add test by close_notify alert and enable tests disabled because of #1308
  • Loading branch information
avbelov23 authored Sep 6, 2019
2 parents c40d2a5 + 2ae637d commit 7d5e35c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 25 deletions.
26 changes: 1 addition & 25 deletions tests_disabled.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,33 +97,9 @@
"name" : "tls.test_tls_handshake.TlsHandshakeTest.test_10byte_transfer",
"reason" : "Bug #1324."
},
{
"name" : "tls.test_tls_handshake.TlsHandshakeTest.test_long_sni",
"reason" : "Bug #1308: Tempesta doesn't send TLS alerts."
},
{
"name" : "tls.test_tls_handshake.TlsHandshakeTest.test_bad_sni",
"reason" : "Bug #1308: Tempesta doesn't send TLS alerts."
},
{
"name" : "tls.test_tls_handshake.TlsHandshakeTest.test_bad_sign_algs",
"reason" : "Bug #1308: Tempesta doesn't send TLS alerts."
},
{
"name" : "tls.test_tls_handshake.TlsHandshakeTest.test_bad_elliptic_curves",
"reason" : "Bug #1308: Tempesta doesn't send TLS alerts."
},
{
"name" : "tls.test_tls_handshake.TlsHandshakeTest.test_bad_renegotiation_info",
"reason" : "Bug #1308: Tempesta doesn't send TLS alerts."
},
{
"name" : "tls.test_tls_handshake.TlsVhostHandshakeTest.test_empty_sni_default",
"reason" : "Bug #1308: Tempesta doesn't send TLS alerts."
},
{
"name" : "tls.test_tls_handshake.TlsHandshakeTest.test_many_ciphers",
"reason" : "Bug #1308: Tempesta doesn't send TLS alerts."
"reason" : "Bug #1347: Tempesta doesn't send TLS alerts on empty sni default."
},
{
"name" : "tls.test_tls_handshake.TlsHandshakeTest.test_fuzzing",
Expand Down
16 changes: 16 additions & 0 deletions tls/test_tls_handshake.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,22 @@ def test_alert(self):
res = tls_conn._do_12_req()
self.assertFalse(res, "Request processed on closed socket")

def test_close_notify(self):
self.start_all()
tls_conn = TlsHandshake()
with tls_conn.socket_ctx():
self.assertTrue(tls_conn._do_12_hs(), "Can not connect to Tempesta")
res = tls_conn._do_12_req()
self.assertTrue(res, "Wrong request result: %s" % res)
tls_conn.send_12_alert(tls.TLSAlertLevel.WARNING,
tls.TLSAlertDescription.CLOSE_NOTIFY)
resp = tls_conn.sock.recvall(timeout=tls_conn.io_to)
self.assertTrue(resp.haslayer(tls.TLSAlert))
if resp.haslayer(tls.TLSAlert):
alert = resp[tls.TLSAlert]
self.assertEqual(alert.level, 20)
self.assertEqual(alert.description, 3)

@util.profiled
def test_fuzzing(self):
"""
Expand Down

0 comments on commit 7d5e35c

Please sign in to comment.