mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
don't explicitely pass the header binary to the unpacker
This commit is contained in:
parent
ce6b9f2f1d
commit
c912860a94
5 changed files with 24 additions and 24 deletions
|
@ -40,7 +40,7 @@ func newPacketUnpacker(aead quicAEAD, version protocol.VersionNumber) unpacker {
|
|||
}
|
||||
}
|
||||
|
||||
func (u *packetUnpacker) Unpack(headerBinary []byte, hdr *wire.ExtendedHeader, data []byte) (*unpackedPacket, error) {
|
||||
func (u *packetUnpacker) Unpack(hdr *wire.ExtendedHeader, data []byte) (*unpackedPacket, error) {
|
||||
pn := protocol.DecodePacketNumber(
|
||||
hdr.PacketNumberLen,
|
||||
u.largestRcvdPacketNumber,
|
||||
|
@ -56,16 +56,16 @@ func (u *packetUnpacker) Unpack(headerBinary []byte, hdr *wire.ExtendedHeader, d
|
|||
var err error
|
||||
switch hdr.Type {
|
||||
case protocol.PacketTypeInitial:
|
||||
decrypted, err = u.aead.OpenInitial(buf, data, pn, headerBinary)
|
||||
decrypted, err = u.aead.OpenInitial(buf, data, pn, hdr.Raw)
|
||||
encryptionLevel = protocol.EncryptionInitial
|
||||
case protocol.PacketTypeHandshake:
|
||||
decrypted, err = u.aead.OpenHandshake(buf, data, pn, headerBinary)
|
||||
decrypted, err = u.aead.OpenHandshake(buf, data, pn, hdr.Raw)
|
||||
encryptionLevel = protocol.EncryptionHandshake
|
||||
default:
|
||||
if hdr.IsLongHeader {
|
||||
return nil, fmt.Errorf("unknown packet type: %s", hdr.Type)
|
||||
}
|
||||
decrypted, err = u.aead.Open1RTT(buf, data, pn, headerBinary)
|
||||
decrypted, err = u.aead.Open1RTT(buf, data, pn, hdr.Raw)
|
||||
encryptionLevel = protocol.Encryption1RTT
|
||||
}
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue