summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-09-08 04:19:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-11-05 04:40:25 (GMT)
commit2f47eae2a1337bd0cb50dbc936df6433f460bb4a (patch)
tree6433828b342b5bc1bb5d1d133f9052fd143b82ab /Makefile
parent3dfbe68fc29248feea3a384e156497ca2463f932 (diff)
downloadgit-2f47eae2a1337bd0cb50dbc936df6433f460bb4a.zip
git-2f47eae2a1337bd0cb50dbc936df6433f460bb4a.tar.gz
git-2f47eae2a1337bd0cb50dbc936df6433f460bb4a.tar.bz2
Split GPG interface into its own helper library
This mostly moves existing code from builtin/tag.c (for signing) and builtin/verify-tag.c (for verifying) to a new gpg-interface.c file to provide a more generic library interface. - sign_buffer() takes a payload strbuf, a signature strbuf, and a signing key, runs "gpg" to produce a detached signature for the payload, and appends it to the signature strbuf. The contents of a signed tag that concatenates the payload and the detached signature can be produced by giving the same strbuf as payload and signature strbuf. - verify_signed_buffer() takes a payload and a detached signature as <ptr, len> pairs, and runs "gpg --verify" to see if the payload matches the signature. It can optionally capture the output from GPG to allow the callers to pretty-print it in a way more suitable for their contexts. "verify-tag" (aka "tag -v") used to save the whole tag contents as if it is a detached signature, and fed gpg the payload part of the tag. It relied on gpg to fail when the given tag is not signed but just is annotated. The updated run_gpg_verify() function detects the lack of detached signature in the input, and errors out without bothering "gpg". Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 2 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 17404c4..e4b14af 100644
--- a/Makefile
+++ b/Makefile
@@ -528,6 +528,7 @@ LIB_H += exec_cmd.h
LIB_H += fsck.h
LIB_H += gettext.h
LIB_H += git-compat-util.h
+LIB_H += gpg-interface.h
LIB_H += graph.h
LIB_H += grep.h
LIB_H += hash.h
@@ -621,6 +622,7 @@ LIB_OBJS += entry.o
LIB_OBJS += environment.o
LIB_OBJS += exec_cmd.o
LIB_OBJS += fsck.o
+LIB_OBJS += gpg-interface.o
LIB_OBJS += graph.o
LIB_OBJS += grep.o
LIB_OBJS += hash.o