veraison / go-cose

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

Key fixes #154

Closed setrofim closed 1 year ago

setrofim commented 1 year ago

A number of spec compliance fixes and interface adjustements for COSE_Key.

This address points 1, 3, 4, and 5 in https://github.com/veraison/go-cose/issues/151#issuecomment-1613196732

setrofim commented 1 year ago

This sits on top of https://github.com/veraison/go-cose/pull/153

codecov[bot] commented 1 year ago

Codecov Report

Merging #154 (f83d377) into main (a579021) will increase coverage by 0.42%. The diff coverage is 100.00%.

:exclamation: Current head f83d377 differs from pull request most recent head 7c18bbe. Consider uploading reports for the commit 7c18bbe to get more accurate results

@@            Coverage Diff             @@
##             main     #154      +/-   ##
==========================================
+ Coverage   90.87%   91.30%   +0.42%     
==========================================
  Files          12       12              
  Lines        1611     1633      +22     
==========================================
+ Hits         1464     1491      +27     
+ Misses        109      104       -5     
  Partials       38       38              
Impacted Files Coverage Δ
key.go 89.71% <100.00%> (+2.21%) :arrow_up:

... and 1 file with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

setrofim commented 1 year ago

I don't see that this PR fixes my first point from https://github.com/veraison/go-cose/issues/151#issuecomment-1613196732.

This is addressed by https://github.com/veraison/go-cose/pull/154/commits/d591f36f5bf3963fdc317647d68af73fddc261b1

Validate() is changed to only check that a know curve is used with an appropriate key type (.e.g that CurveEd25519 with KeyTypeEC2 results in an error). However, unknown curves are no longer reported as errors.