veraison / go-cose

go library for CBOR Object Signing and Encryption (COSE)
Mozilla Public License 2.0
50 stars 26 forks source link

Incorrect error code returned from go-cose Verifier instantiation #124

Closed yogeshbdeshpande closed 1 year ago

yogeshbdeshpande commented 1 year ago

File verifier.go, Interface Method: NewVerifier() when switching on Algorithm and a correct algorithm is found, then it checks for ValidPublicKeys().

If the Public Key is not valid, it should return a suitable error code for not valid keys, instead the present code returns ErrAlgorithmMistmatch, which is misleading!

yogeshbdeshpande commented 1 year ago

PR: https://github.com/veraison/go-cose/pull/130 is used to address this issue