-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Key fixes #154
Conversation
This sits on top of #153 |
Codecov Report
@@ 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
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
2de9dd1
to
efc9cd7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see that this PR fixes my first point from #151 (comment).
This is addressed by d591f36
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The alg parameter is unnecessary, and makes these functions more awkward to use. The input PublicKey/PrivateKey is now identified via a type switch, and the algorithm is derived from it. Signed-off-by: setrofim <setrofim@gmail.com>
RFC8152 allows for unregistered curves, therefore we should not fail key validation if a curve is not recognised when marshalling. We should only fail when a known curve is used with an incorrect key type. Signed-off-by: setrofim <setrofim@gmail.com>
Ensure that the KeyType is the expected one for the Curve when creating crypto.PublicKey or crypto.PrivateKey. Signed-off-by: setrofim <setrofim@gmail.com>
RFC8152 allows public parts to be omitted from private keys, as they could be derived (though it recommends that they are present). crypto.PrivateKey implementations require for them to be present. Signed-off-by: setrofim <setrofim@gmail.com>
Add test for String() calls not exercised by other test cases to placate Codecov. Signed-off-by: setrofim <setrofim@gmail.com>
Signed-off-by: setrofim <setrofim@gmail.com>
A number of spec compliance fixes and interface adjustements for
COSE_Key
.This address points 1, 3, 4, and 5 in #151 (comment)