fix error code for invalid certificate chains

This commit is contained in:
Marten Seemann
2016-11-16 14:38:52 +07:00
parent 52ba2ce9f8
commit a388d6bf6a
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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() {