forked from quic-go/quic-go
fix error code for invalid certificate chains
This commit is contained in:
@@ -29,7 +29,7 @@ func NewCertManager() CertManager {
|
||||
func (c *certManager) SetData(data []byte) error {
|
||||
chain, err := decompressChain(data)
|
||||
if err != nil {
|
||||
return qerr.ProofInvalid
|
||||
return qerr.Error(qerr.InvalidCryptoMessageParameter, "Certificate data invalid")
|
||||
}
|
||||
c.chain = chain
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ var _ = Describe("Cert Manager", func() {
|
||||
|
||||
It("errors when given invalid data", func() {
|
||||
err := cm.SetData([]byte("foobar"))
|
||||
Expect(err).To(MatchError(qerr.ProofInvalid))
|
||||
Expect(err).To(MatchError(qerr.Error(qerr.InvalidCryptoMessageParameter, "Certificate data invalid")))
|
||||
})
|
||||
|
||||
It("decompresses a certificate chain", func() {
|
||||
|
||||
Reference in New Issue
Block a user