Skip to content
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

[FEATURE-REQUEST] support ssh-keygen -Y format data signature #25

Open
gzm55 opened this issue May 26, 2023 · 12 comments
Open

[FEATURE-REQUEST] support ssh-keygen -Y format data signature #25

gzm55 opened this issue May 26, 2023 · 12 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@gzm55
Copy link

gzm55 commented May 26, 2023

can we support the native data signature format, generated via command ssh-keygen -Y sign ...?

@scheibling
Copy link
Collaborator

Let me look into it, I'll just leave some notes for myself below. Shouldn't be too hard to accomplish, we have most of the pieces for the generation and formatting in place already

https://man.openbsd.org/ssh-keygen.1#Y~4
https://github.com/openssh/openssh-portable/blob/d575cf44895104e0fcb0629920fb645207218129/PROTOCOL.sshsig
https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.sshsig
https://www.agwa.name/blog/post/ssh_signatures

@scheibling scheibling self-assigned this May 26, 2023
@scheibling scheibling added this to the 0.9.2 milestone May 26, 2023
@scheibling scheibling added the enhancement New feature or request label May 30, 2023
@scheibling
Copy link
Collaborator

Scheduling this for the next minor version (0.10.1) due to a larger amount of changes

@scheibling scheibling modified the milestones: 0.9.2, 0.10.1 May 30, 2023
@scheibling
Copy link
Collaborator

Moving to 0.11.1 instead due to DSA deprecation requiring 0.10.1

@scheibling scheibling modified the milestones: 0.10.1, 0.11.1 Jun 7, 2023
@gzm55
Copy link
Author

gzm55 commented Jul 20, 2023

Moving to 0.11.1 instead due to DSA deprecation requiring 0.10.1

@scheibling any recent updates?

@scheibling
Copy link
Collaborator

@gzm55 Yes, sorry for the late reply. Currently working on this in a feature branch, hopefully I'll be able to finally finish it this week... This fall has been a bit hectic

@scheibling
Copy link
Collaborator

@gzm55 So, finally another update. I'm getting closer, if you have time and wanna have a look it's in the dev-data-signatures branch.

There's still some checks and finetuning to do, and some smaller bugs to fix, but if you have a look in the validate_signatures.py-file in that branch the loading and parsing of the signatures works, including the validation (although I haven't run this through any larger testing yet, so it's not production-ready by any measure). Signing and saving to file should work in most cases as well!

@gzm55
Copy link
Author

gzm55 commented Jan 2, 2024

@gzm55 So, finally another update. I'm getting closer, if you have time and wanna have a look it's in the dev-data-signatures branch.

There's still some checks and finetuning to do, and some smaller bugs to fix, but if you have a look in the validate_signatures.py-file in that branch the loading and parsing of the signatures works, including the validation (although I haven't run this through any larger testing yet, so it's not production-ready by any measure). Signing and saving to file should work in most cases as well!

hooray, i will try in the week end~

@scheibling
Copy link
Collaborator

@gzm55 Did you have a chance to try this out?

@gzm55
Copy link
Author

gzm55 commented Jan 26, 2024

@gzm55 Did you have a chance to try this out?

Hi @scheibling , i have tested the signature feature. validate_signatures.py works fine except that the cryptography has to be limited to <42,>=41.0.5.

Another thing, the generated signature by ed25519sig.sign(ed25519_data), cannot be verified by ssh-keygen, cause the namespace has to be non null. After setting namespace via ed25519sig.fields.namespace.value = 'new-ns' and writing the signature to file, we can validate the sig via command:

ssh-keygen -Y check-novalidate -n 'new-ns' -s testkeys/ed25519.txt.sig3 < testkeys/ed25519.txt

@scheibling
Copy link
Collaborator

Ah, yes, I've fixed that in the latest version but haven't had time to pull it to the dev branch yet

Wonderful, I'm really grateful for the feedback! I'll add some more validation for namespaces and write the tests for consistency, hopefully I'll be ready to release in a couple of days

@gzm55
Copy link
Author

gzm55 commented Jan 27, 2024

now the SSHSignature.verify matches the behavior of ssh-keygen -Y check-novalidate. And the full verify action, ssh-keygen -Y verify also needs a allowed signers list file and key revokation list file which should be distributed from CA owners. Do we plan to support these features?

@scheibling
Copy link
Collaborator

Yep, have those on the Roadmap as well!

@scheibling scheibling modified the milestones: 0.11.1, 0.12.1 May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants