Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test by close_notify alert and enable tests disabled because of #1308 #133

Merged
merged 2 commits into from
Sep 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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