summaryrefslogtreecommitdiff
path: root/gpg-interface.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-02-22 16:12:42 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-02-22 16:12:42 -0800
commit15af6e6fee54632358798bef548d89dd3764805d (patch)
treef4464996780c0c94bd0901bab9e161b9679fe05f /gpg-interface.h
parentMerge branch 'dl/stash-cleanup' (diff)
parentgpg-interface: remove other signature headers before verifying (diff)
downloadtgif-15af6e6fee54632358798bef548d89dd3764805d.tar.xz
Merge branch 'bc/signed-objects-with-both-hashes'
Signed commits and tags now allow verification of objects, whose two object names (one in SHA-1, the other in SHA-256) are both signed. * bc/signed-objects-with-both-hashes: gpg-interface: remove other signature headers before verifying ref-filter: hoist signature parsing commit: allow parsing arbitrary buffers with headers gpg-interface: improve interface for parsing tags commit: ignore additional signatures when parsing signed commits ref-filter: switch some uses of unsigned long to size_t
Diffstat (limited to 'gpg-interface.h')
-rw-r--r--gpg-interface.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/gpg-interface.h b/gpg-interface.h
index f4e9b4f371..80567e4894 100644
--- a/gpg-interface.h
+++ b/gpg-interface.h
@@ -38,12 +38,19 @@ struct signature_check {
void signature_check_clear(struct signature_check *sigc);
/*
+ * Look at a GPG signed tag object. If such a signature exists, store it in
+ * signature and the signed content in payload. Return 1 if a signature was
+ * found, and 0 otherwise.
+ */
+int parse_signature(const char *buf, size_t size, struct strbuf *payload, struct strbuf *signature);
+
+/*
* Look at GPG signed content (e.g. a signed tag object), whose
* payload is followed by a detached signature on it. Return the
* offset where the embedded detached signature begins, or the end of
* the data when there is no such signature.
*/
-size_t parse_signature(const char *buf, size_t size);
+size_t parse_signed_buffer(const char *buf, size_t size);
/*
* Create a detached signature for the contents of "buffer" and append