Skip to content

Commit

Permalink
Skip unimplemented handshake extension types (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioppermann committed Aug 28, 2024
1 parent 23a403e commit 35f558f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packet/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,12 @@ func (c *CIFHandshake) Unmarshal(data []byte) error {
}

c.CongestionCtl = strings.TrimRight(b.String(), "\x00")
} else if extensionType == EXTTYPE_FILTER || extensionType == EXTTYPE_GROUP {
if len(pivot) < extensionLength {
return fmt.Errorf("invalid extension length of %d bytes (%s)", extensionLength, extensionType.String())
}
} else {
return fmt.Errorf("unimplemented extension (%d)", extensionType)
return fmt.Errorf("unknown extension (%d)", extensionType)
}

if len(pivot) > extensionLength {
Expand Down

0 comments on commit 35f558f

Please sign in to comment.