-
Notifications
You must be signed in to change notification settings - Fork 26
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
Make Sign1 and Verify1 difficult to misuse #64
Comments
For For Overall, I think we should just remove those two methods :D |
How common are timestamp signatures?
Agree that |
At least, we are sure to drop @thomas-fossati Could we have more inputs on |
|
As there seems to be quorum on updating |
Problem statement
NCC Group found a (known) footgun in our API:
Example:
The same applies to
Verify()
:We initially added
Sign1
andVerify1
to make it easier to sign and verify messages, but with the current signature they don't prevent user to misusego-cose
.Proposal
Me proposal is to change these two functions so they don't work with
Sign1Message
but just deal with cbor-marshaled messages:func Verify1(verifier Verifier, cbor_msg []byte, external []byte) error
With this change, users that don't need the flexibility of
Sign1Message
won't need to even know it exist, as the signature would be represented an opaque, difficult-to-misuse,[]byte
.Worth nothing that users can still misuse
Sign1Message.Sign()
andSign1Message.Verify()
, but keeping them as-is allow advanced users to do their custom marshalling or validations.Edited: Update
Sign1
proposed API.Edit2: Notice that the proposed signature is very similar to .Net's static CoseSign1Message.Sign(...).
Edit3:
Verify1
is proposed to be removed as per thread discussion.The text was updated successfully, but these errors were encountered: