Ovyerus / gfh

Git FIDO Helper - Sign your Git commits with multiple resident SSH keys
MIT License
23 stars 3 forks source link

`git log --show-signature` shows error when using GFH #2

Open Ovyerus opened 1 year ago

Ovyerus commented 1 year ago

When you have a gpg.ssh.allowedSignersFile set in Git and you try to run git log --show-signature, instead of being able to see the validated signatures above each commit, you instead get an error along the lines of this, highlighted in red:

Unable to open allowed keys file "<contents of gpg.ssh.allowedSignersKey has been snipped for the issue>": No such file or directory^M
sig_find_principals: sshsig_find_principal: No such file or directory^M
No principal matched.
thread 'main' panicked at 'git did not provide -f somehow', src/bin/gfh-keygen.rs:16:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It appears that Git calls gpg.ssh.program when using this flag, and since GFH has not been set up to properly handle this scenario it causes this problem. gfh-keygen should handle this situation gracefully, and pass options off to ssh-keygen as normal.