mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 04:37:36 +03:00
drop support for gQUIC
This commit is contained in:
parent
8f8ed03254
commit
3266e36811
195 changed files with 2638 additions and 35430 deletions
|
@ -14,10 +14,6 @@ type unpackedPacket struct {
|
|||
frames []wire.Frame
|
||||
}
|
||||
|
||||
type gQUICAEAD interface {
|
||||
Open(dst, src []byte, packetNumber protocol.PacketNumber, associatedData []byte) ([]byte, protocol.EncryptionLevel, error)
|
||||
}
|
||||
|
||||
type quicAEAD interface {
|
||||
OpenInitial(dst, src []byte, pn protocol.PacketNumber, ad []byte) ([]byte, error)
|
||||
OpenHandshake(dst, src []byte, pn protocol.PacketNumber, ad []byte) ([]byte, error)
|
||||
|
@ -49,40 +45,7 @@ func (u *packetUnpackerBase) parseFrames(decrypted []byte, hdr *wire.Header) ([]
|
|||
return fs, nil
|
||||
}
|
||||
|
||||
// The packetUnpackerGQUIC unpacks gQUIC packets.
|
||||
type packetUnpackerGQUIC struct {
|
||||
packetUnpackerBase
|
||||
aead gQUICAEAD
|
||||
}
|
||||
|
||||
var _ unpacker = &packetUnpackerGQUIC{}
|
||||
|
||||
func newPacketUnpackerGQUIC(aead gQUICAEAD, version protocol.VersionNumber) unpacker {
|
||||
return &packetUnpackerGQUIC{
|
||||
packetUnpackerBase: packetUnpackerBase{version: version},
|
||||
aead: aead,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *packetUnpackerGQUIC) Unpack(headerBinary []byte, hdr *wire.Header, data []byte) (*unpackedPacket, error) {
|
||||
decrypted, encryptionLevel, err := u.aead.Open(data[:0], data, hdr.PacketNumber, headerBinary)
|
||||
if err != nil {
|
||||
// Wrap err in quicError so that public reset is sent by session
|
||||
return nil, qerr.Error(qerr.DecryptionFailure, err.Error())
|
||||
}
|
||||
|
||||
fs, err := u.parseFrames(decrypted, hdr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &unpackedPacket{
|
||||
encryptionLevel: encryptionLevel,
|
||||
frames: fs,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// The packetUnpacker unpacks IETF QUIC packets.
|
||||
// The packetUnpacker unpacks QUIC packets.
|
||||
type packetUnpacker struct {
|
||||
packetUnpackerBase
|
||||
aead quicAEAD
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue