Skip to content

Commit

Permalink
Fixes an issue, where TLSClientHello extensions were overwritten
Browse files Browse the repository at this point in the history
  • Loading branch information
Loris1123 authored and gpotter2 committed Feb 3, 2024
1 parent 86e1764 commit a147956
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions scapy/layers/tls/automaton_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,16 @@ def should_add_ClientHello(self):
p = self.client_hello
else:
p = TLSClientHello()
ext = []
# Add TLS_Ext_SignatureAlgorithms for TLS 1.2 ClientHello
if self.cur_session.advertised_tls_version == 0x0303:
ext += [TLS_Ext_SignatureAlgorithms(sig_algs=["sha256+rsa"])]
# Add TLS_Ext_ServerName
if self.server_name:
ext += TLS_Ext_ServerName(
servernames=[ServerName(servername=self.server_name)]
)
p.ext = ext
ext = []
# Add TLS_Ext_SignatureAlgorithms for TLS 1.2 ClientHello
if self.cur_session.advertised_tls_version == 0x0303:
ext += [TLS_Ext_SignatureAlgorithms(sig_algs=["sha256+rsa"])]
# Add TLS_Ext_ServerName
if self.server_name:
ext += TLS_Ext_ServerName(
servernames=[ServerName(servername=self.server_name)]
)
p.ext = ext
self.add_msg(p)
raise self.ADDED_CLIENTHELLO()

Expand Down

0 comments on commit a147956

Please sign in to comment.