ssh signing: support non ssh-* keytypes
commit350a2518c8ea4f42934b4d6f3466d2815efff97f
authorFabian Stelzer <fs@gigacodes.de>
Fri, 19 Nov 2021 15:07:06 +0000 (19 16:07 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Nov 2021 17:05:25 +0000 (19 09:05 -0800)
tree2d16edddbdec7676643793a024c40f5338ebf756
parentcd3e606211bb1cf8bc57f7d76bab98cc17a150bc
ssh signing: support non ssh-* keytypes

The user.signingKey config for ssh signing supports either a path to a
file containing the key or for the sake of convenience a literal string
with the ssh public key. To differentiate between those two cases we
check if the first few characters contain "ssh-" which is unlikely to be
the start of a path. ssh supports other key types which are not prefixed
with "ssh-" and will currently be treated as a file path and therefore
fail to load. To remedy this we move the prefix check into its own
function and introduce the prefix `key::` for literal ssh keys. This way
we don't need to add new key types when they become available. The
existing `ssh-` prefix is retained for compatibility with current user
configs but removed from the official documentation to discourage its
use.

Signed-off-by: Fabian Stelzer <fs@gigacodes.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/user.txt
gpg-interface.c
t/lib-gpg.sh
t/t7528-signed-commit-ssh.sh