-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
proposal: x/crypto/ssh: add SSHSIG support #68197
Comments
CC @golang/security @drakkan |
I suggest we implement a higher-level API, without exposing the formatting of the signed blob to the application.
We can accept both As required by the specification, we will reject |
Initial implementation of proposal golang/go#68197. Want to make sure the API is all right before adding more tests. Also seeking feedback on how to best test this - is it OK to sign and verify in the same test, or do you have other ideas? (maybe a fixed rand reader?).
Thanks @FiloSottile! Implemented it here: golang/crypto#316 Still unsure about how to best unit test this, but otherwise the API feels good I think. |
Change https://go.dev/cl/659715 mentions this issue: |
Thank you for the PR! I see that you implemented it to take/return PEM. In the docs I meant "is usually decoded / encoded" as a suggestion for the user to do it themselves, if they need it armored. We should make the docs clearer if we return raw bytes, or maybe we should return just PEM? As for unit testing, round-trip tests and a test against a ssh-keygen produced signature (for at least each signature algorithm) would be enough. |
Proposal Details
I'd like to propose we support encoding and decoding SSHSIG signature format.
I already have a working implementation (armoring a
*ssh.Signature
and then parsing it back into the signed data), but I'm not sure what the api should look like.We have a couple of steps to create a signature:
To verify a signature, we need to:
publickey.Verify(blob, decodedBlod)
Given all this, I'd suggest the following functions:
We would also need these two structs:
and some constants:
There's also the discussion of which hash algorithms to support... only
rsa-sha2-512
orrsa-sha2-256
, which I think it's easy enough to support both.Finally, the namespace, not sure if we allow to customize that or not.
Anyway, I would love to work on this, just need some direction on how the API should look like.
The text was updated successfully, but these errors were encountered: