Example partial emulation of git log -1 --show-signature
with SSH signatures
#1448
Replies: 3 comments 1 reply
-
@jelmer Maybe this is worth putting in the docs? Not sure if it should be a tutorial or how-to guide in the terminology of https://docs.divio.com/documentation-system/ In either case, there is a clear target for the tutorial/how-to guide which is print SSH signatures in a commit (using Dulwich and ssh-keygen). Let me know if you want a PR or a tutorial or how-to guide adapted from the above example. |
Beta Was this translation helpful? Give feedback.
-
I'm open to PRs to document this, especially in lieu of actual support for verifying SSH sigs. That said, I think it's a lot more useful to just add support for SSH sigs in .verify(). People who want to know how this works under the hood (rather than just verifying a signature) can look at the source code in that case. |
Beta Was this translation helpful? Give feedback.
-
Here is the corresponding variation that does verification using a
The core logic in git for calling |
Beta Was this translation helpful? Give feedback.
-
A new
Commit.raw_without_sig
method is getting added and it enables the following interop between Dulwich and signature verification code. The following script behaves very similarly togit log -1 --show-signature
. In this example the signature verification code is callingssh-keygen
, the utility thatgit
calls as a subprocess to print commit SSH signature information.The output looks like this:
NOTE:
This example does not verify who made the signature. A "Good" signature as reported by ssh-keygen only means the commit was signed with the reported key. The signer might have nothing to do with the actual committer or author. In the above example, the ED25519 key might be of a hacker. Additional steps are required to determine if the SSH public key used to sign the commit is appropriate.
Beta Was this translation helpful? Give feedback.
All reactions