diff options
author | Henning Schild <henning.schild@siemens.com> | 2018-07-17 14:50:12 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-18 19:02:23 +0200 |
commit | 1e7adb97566bff7d3431ce64b8d0d854a6863ed5 (patch) | |
tree | 50d344fab57c89acb71ec573600156d30ca54e2c /gpg-interface.c | |
parent | gpg-interface: introduce new config to select per gpg format program (diff) | |
download | git-1e7adb97566bff7d3431ce64b8d0d854a6863ed5.tar.xz git-1e7adb97566bff7d3431ce64b8d0d854a6863ed5.zip |
gpg-interface: introduce new signature format "x509" using gpgsm
This commit allows git to create and check x509 type signatures using
gpgsm.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gpg-interface.c')
-rw-r--r-- | gpg-interface.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gpg-interface.c b/gpg-interface.c index a158f08c13..bb8ea668b3 100644 --- a/gpg-interface.c +++ b/gpg-interface.c @@ -24,11 +24,23 @@ static const char *openpgp_sigs[] = { NULL }; +static const char *x509_verify_args[] = { + NULL +}; +static const char *x509_sigs[] = { + "-----BEGIN SIGNED MESSAGE-----", + NULL +}; + static struct gpg_format gpg_format[] = { { .name = "openpgp", .program = "gpg", .verify_args = openpgp_verify_args, .sigs = openpgp_sigs }, + { .name = "x509", .program = "gpgsm", + .verify_args = x509_verify_args, + .sigs = x509_sigs + }, }; static struct gpg_format *use_format = &gpg_format[0]; @@ -192,6 +204,9 @@ int git_gpg_config(const char *var, const char *value, void *cb) if (!strcmp(var, "gpg.program") || !strcmp(var, "gpg.openpgp.program")) fmtname = "openpgp"; + if (!strcmp(var, "gpg.x509.program")) + fmtname = "x509"; + if (fmtname) { fmt = get_format_by_name(fmtname); return git_config_string(&fmt->program, var, value); |