diff --git a/packet_unpacker.go b/packet_unpacker.go index 6fa82b22..58d1009f 100644 --- a/packet_unpacker.go +++ b/packet_unpacker.go @@ -99,7 +99,7 @@ func (u *packetUnpacker) Unpack(hdr *wire.Header, data []byte) (*unpackedPacket, decrypted, err := opener.Open(buf, data, pn, extHdr.Raw) if err != nil { - return nil, qerr.Error(qerr.DecryptionFailure, err.Error()) + return nil, err } // Only do this after decrypting, so we are sure the packet is not attacker-controlled diff --git a/packet_unpacker_test.go b/packet_unpacker_test.go index bd968daa..8d7e73ee 100644 --- a/packet_unpacker_test.go +++ b/packet_unpacker_test.go @@ -147,7 +147,7 @@ var _ = Describe("Packet Unpacker", func() { opener.EXPECT().DecryptHeader(gomock.Any(), gomock.Any(), gomock.Any()) opener.EXPECT().Open(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil, errors.New("test err")) _, err := unpacker.Unpack(hdr, hdrRaw) - Expect(err).To(MatchError(qerr.Error(qerr.DecryptionFailure, "test err"))) + Expect(err).To(MatchError("test err")) }) It("decrypts the header", func() {