Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2021-02-11 05:08:06 +0300
committerJunio C Hamano <gitster@pobox.com>2021-02-11 10:35:42 +0300
commit9b27b49240f6bf760ff58d917491bec0981aaf9f (patch)
tree189bc11259d633e7cd134c02bf0fdb80b7b20e78 /gpg-interface.c
parent88bce0e24c8f777fce1f726b4553bd32286bba04 (diff)
gpg-interface: remove other signature headers before verifying
When we have a multiply signed commit, we need to remove the signature in the header before verifying the object, since the trailing signature will not be over both pieces of data. Do so, and verify that we validate the signature appropriately. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gpg-interface.c')
-rw-r--r--gpg-interface.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gpg-interface.c b/gpg-interface.c
index c6274c14af..127aecfc2b 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "commit.h"
#include "config.h"
#include "run-command.h"
#include "strbuf.h"
@@ -366,6 +367,7 @@ int parse_signature(const char *buf, size_t size, struct strbuf *payload, struct
size_t match = parse_signed_buffer(buf, size);
if (match != size) {
strbuf_add(payload, buf, match);
+ remove_signature(payload);
strbuf_add(signature, buf + match, size - match);
return 1;
}