Skip to content

Commit

Permalink
🐛 Write the ClientHello packet correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mertyildiran committed Oct 18, 2023
1 parent 7b7ae26 commit f428caf
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions tls_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,13 @@ func (t *tlsStream) writeClientHello() {
log.Error().Err(err).Send()
}

packet := gopacket.NewPacket(data, layers.LayerTypeEthernet, gopacket.Lazy)
outgoingPacket := packet.Data()

info := t.createCaptureInfo(outgoingPacket)

err = t.poller.sorter.GetMasterPcap().WritePacket(info, outgoingPacket)
if err != nil {
log.Error().Err(err).Msg("Error writing PCAP:")
}
t.writePacket(
layers.LayerTypeEthernet,
t.layers.ethernet,
t.layers.ipv4,
t.layers.tcp,
gopacket.Payload(data),
)

t.doTcpSeqAckWalk(true, uint32(len(data)))
t.clientHello = true
Expand Down

0 comments on commit f428caf

Please sign in to comment.