From df7a637fa2dd94980f4f9a52dd667c4391ba6ba6 Mon Sep 17 00:00:00 2001 From: Peace-Maker Date: Sun, 19 Nov 2023 19:29:06 +0100 Subject: [PATCH] Set tls_session.server_key too It doesn't seem to be used, but mimic the tls automation implementation. https://github.com/secdev/scapy/blob/5160430bd16c6084d5aef2a10e47dc0455aace40/scapy/layers/tls/automaton_srv.py#L243-L245 --- converters/tls.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/converters/tls.py b/converters/tls.py index de8282b2..2003975c 100755 --- a/converters/tls.py +++ b/converters/tls.py @@ -4,6 +4,7 @@ TLSApplicationData, Cert, PrivKey, + PrivKeyRSA, tlsSession, load_nss_keys, ) @@ -35,7 +36,9 @@ def handle_stream(self, stream: Stream) -> Result: tls_session.ipdst = stream.Metadata.ServerHost if key_path.exists(): key = PrivKey(key_path) - tls_session.server_rsa_key = key + tls_session.server_key = key + if isinstance(key, PrivKeyRSA): + tls_session.server_rsa_key = key if cert_path.exists(): cert = Cert(cert_path) tls_session.server_certs = [cert]