ssh signing: make git log verify key lifetime

Set the payload_type for check_signature() when calling git log.
Implements the same tests as for verify-commit.

Signed-off-by: Fabian Stelzer <fs@gigacodes.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Fabian Stelzer
2021-12-09 09:52:46 +01:00
committed by Junio C Hamano
parent 6393c956f4
commit 4bbf3780ff
2 changed files with 45 additions and 0 deletions

View File

@ -513,6 +513,7 @@ static void show_signature(struct rev_info *opt, struct commit *commit)
if (parse_signed_commit(commit, &payload, &signature, the_hash_algo) <= 0)
goto out;
sigc.payload_type = SIGNATURE_PAYLOAD_COMMIT;
sigc.payload = strbuf_detach(&payload, &sigc.payload_len);
status = check_signature(&sigc, signature.buf, signature.len);
if (status && !sigc.output)
@ -583,6 +584,7 @@ static int show_one_mergetag(struct commit *commit,
status = -1;
if (parse_signature(extra->value, extra->len, &payload, &signature)) {
/* could have a good signature */
sigc.payload_type = SIGNATURE_PAYLOAD_TAG;
sigc.payload = strbuf_detach(&payload, &sigc.payload_len);
status = check_signature(&sigc, signature.buf, signature.len);
if (sigc.output)