Skip to content

Commit 8ec40a2

Browse files
committed
Test TLS 1.2 decryption using a NSS Key Log
1 parent 683ac73 commit 8ec40a2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/tls.uts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,3 +1565,16 @@ assert [type(x) for x in pkt.msg] == [TLSServerHello, TLSCertificate, TLSCertifi
15651565
# see test/tls/tests_tls_netaccess.uts
15661566

15671567

1568+
###############################################################################
1569+
####################### Decrypt packets from a pcap ##########################
1570+
###############################################################################
1571+
1572+
bck_conf = conf
1573+
conf.tls_session_enable = True
1574+
conf.tls_nss_filename = scapy_path("doc/notebooks/tls/raw_data/tls_nss_example.keys.txt")
1575+
1576+
packets = rdpcap(scapy_path("doc/notebooks/tls/raw_data/tls_nss_example.pcap"))
1577+
assert b"GET /secret.txt HTTP/1.0\n" in packets[11].msg[0].data
1578+
assert b"z2|gxarIKOxt,G1d>.Q2MzGY[k@" in packets[13].msg[0].data
1579+
1580+
conf = bck_conf

0 commit comments

Comments
 (0)