summaryrefslogtreecommitdiff
path: root/gpg-interface.c
diff options
context:
space:
mode:
authorHenning Schild <henning.schild@siemens.com>2018-07-17 12:50:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-18 17:02:23 (GMT)
commit1e7adb97566bff7d3431ce64b8d0d854a6863ed5 (patch)
tree50d344fab57c89acb71ec573600156d30ca54e2c /gpg-interface.c
parentb02f51b196deec70867d9616872e533e2633473c (diff)
downloadgit-1e7adb97566bff7d3431ce64b8d0d854a6863ed5.zip
git-1e7adb97566bff7d3431ce64b8d0d854a6863ed5.tar.gz
git-1e7adb97566bff7d3431ce64b8d0d854a6863ed5.tar.bz2
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.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gpg-interface.c b/gpg-interface.c
index a158f08..bb8ea66 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);