Skip to content

Commit

Permalink
fix tls application
Browse files Browse the repository at this point in the history
  • Loading branch information
xzm committed Aug 19, 2024
1 parent 70cf192 commit e7b77a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gopacket/layers/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (t *TLS) decodeTLSRecords(data []byte, df gopacket.DecodeFeedback) error {
t.Handshake = append(t.Handshake, r)
case TLSApplicationData:
var r TLSAppDataRecord
e := r.decodeFromBytes(h, data[hl:tl], data, df)
e := r.decodeFromBytes(h, data[hl:tl], data[0:tl], df)
if e != nil {
return e
}
Expand Down
8 changes: 4 additions & 4 deletions gopacket/layers/tls_appdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (
// TLSAppDataRecord contains all the information that each AppData Record types should have
type TLSAppDataRecord struct {
TLSRecordHeader
Payload []byte
FullPayload []byte
Payload []byte
WithHeadPayload []byte
}

// DecodeFromBytes decodes the slice into the TLS struct.
func (t *TLSAppDataRecord) decodeFromBytes(h TLSRecordHeader, data, full []byte, df gopacket.DecodeFeedback) error {
func (t *TLSAppDataRecord) decodeFromBytes(h TLSRecordHeader, data, withHeadPayload []byte, df gopacket.DecodeFeedback) error {
// TLS Record Header
t.ContentType = h.ContentType
t.Version = h.Version
Expand All @@ -31,6 +31,6 @@ func (t *TLSAppDataRecord) decodeFromBytes(h TLSRecordHeader, data, full []byte,
}

t.Payload = data
t.FullPayload = full
t.WithHeadPayload = withHeadPayload
return nil
}

0 comments on commit e7b77a9

Please sign in to comment.