summaryrefslogtreecommitdiff
path: root/fmt-merge-msg.c
diff options
context:
space:
mode:
authorFabian Stelzer <fs@gigacodes.de>2021-09-10 20:07:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-09-10 21:15:51 (GMT)
commitb5726a5d9cabba0bd8fb6c1b25a887bc7ea4650d (patch)
tree860bc5a2e2479906a8db791bfe7c8ad07580c519 /fmt-merge-msg.c
parentdaab8a564f8bbac55f70f8bf86c070e001a9b006 (diff)
downloadgit-b5726a5d9cabba0bd8fb6c1b25a887bc7ea4650d.zip
git-b5726a5d9cabba0bd8fb6c1b25a887bc7ea4650d.tar.gz
git-b5726a5d9cabba0bd8fb6c1b25a887bc7ea4650d.tar.bz2
ssh signing: preliminary refactoring and clean-up
Openssh v8.2p1 added some new options to ssh-keygen for signature creation and verification. These allow us to use ssh keys for git signatures easily. In our corporate environment we use PIV x509 Certs on Yubikeys for email signing/encryption and ssh keys which I think is quite common (at least for the email part). This way we can establish the correct trust for the SSH Keys without setting up a separate GPG Infrastructure (which is still quite painful for users) or implementing x509 signing support for git (which lacks good forwarding mechanisms). Using ssh agent forwarding makes this feature easily usable in todays development environments where code is often checked out in remote VMs / containers. In such a setup the keyring & revocationKeyring can be centrally generated from the x509 CA information and distributed to the users. To be able to implement new signing formats this commit: - makes the sigc structure more generic by renaming "gpg_output" to "output" - introduces function pointers in the gpg_format structure to call format specific signing and verification functions - moves format detection from verify_signed_buffer into the check_signature api function and calls the format specific verify - renames and wraps sign_buffer to handle format specific signing logic as well Signed-off-by: Fabian Stelzer <fs@gigacodes.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fmt-merge-msg.c')
-rw-r--r--fmt-merge-msg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fmt-merge-msg.c b/fmt-merge-msg.c
index 0f66818..fb300bb 100644
--- a/fmt-merge-msg.c
+++ b/fmt-merge-msg.c
@@ -526,11 +526,11 @@ static void fmt_merge_msg_sigs(struct strbuf *out)
buf = payload.buf;
len = payload.len;
if (check_signature(payload.buf, payload.len, sig.buf,
- sig.len, &sigc) &&
- !sigc.gpg_output)
+ sig.len, &sigc) &&
+ !sigc.output)
strbuf_addstr(&sig, "gpg verification failed.\n");
else
- strbuf_addstr(&sig, sigc.gpg_output);
+ strbuf_addstr(&sig, sigc.output);
}
signature_check_clear(&sigc);