Skip to content

Fix git signing on ledger devices #499

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adambor
Copy link

@adambor adambor commented Jul 12, 2025

This PR fixes git signing on Ledger devices by using the 0x06 (ins_sign_generic_hash) instruction instead of 0x04 (ins_sign_ssh_blob), related to LedgerHQ/app-ssh-agent#47

Tested working on linux, with Ledger Nano X and SSH/PGP ledger app version 0.0.8.

@adambor
Copy link
Author

adambor commented Jul 13, 2025

Okay, so just realized it's not really a bug but more so a ledger app expecting a certain format of the message to be signed (the one used when connecting over SSH). However trying to use the agent for e.g. signing git commits uses a different message format and that then breaks the implementation. So really what should be done in the agent:

  • check if the message is conforming to the format expected by the app (duplicate the ledger app parsing logic in the agent):
    • if yes then use the ins_sign_ssh_blob(), type 0x04, which also nicely displays the SSH username
    • if no then use the ins_sign_generic_hash(), type 0x06, which displays just Sign PGP on the ledger device.

Will work on this and then push to this PR.

@adambor adambor force-pushed the ab/fix-ledger-signing branch from 85e1b80 to c0bf5bd Compare July 13, 2025 10:08
@adambor adambor changed the title Fix ssh signing on ledger devices Fix git signing on ledger devices Jul 13, 2025
@adambor adambor force-pushed the ab/fix-ledger-signing branch from c0bf5bd to af561c6 Compare July 13, 2025 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant