git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 6/6] ssh signing: fmt-merge-msg/check_signature with tag date

From
Fabian Stelzer <fs@gigacodes.de>
Date
Oct 25, 2021, 08:39 UTC
Message-ID
<8ff17f0e-9877-1004-4057-4f4af21531a1@gigacodes.de>
In-Reply-To
<211022.86a6j0kjoi.gmgdl@evledraar.gmail.com>
On 22.10.21 20:12, Ævar Arnfjörð Bjarmason wrote:
Show 21 quoted lines
> 
> On Fri, Oct 22 2021, Fabian Stelzer wrote:
> 
>>  			buf = payload.buf;
>>  			len = payload.len;
>> -			if (check_signature(payload.buf, payload.len, 0, NULL,
>> +
>> +			if (parse_signed_buffer_metadata(payload.buf, "tagger",
>> +							 &payload_timestamp,
>> +							 &payload_signer))
>> +				strbuf_addstr(&sig,
>> +					_("failed to parse timestamp and signer info from payload"));
>> +
>> +			if (check_signature(payload.buf, payload.len,
>> +					    payload_timestamp, &payload_signer,
>>  					    sig.buf, sig.len, &sigc) &&
>>  			    !sigc.output)
>>  				strbuf_addstr(&sig, "gpg verification failed.\n");
> 
> I haven't tested this, but your addition to &sig here lacks a \n,
> compared to the &sig seen right above here in the diff context.
You are correct. I have added the newline.
Show 5 quoted lines
> 
> The whole business of seemingly mixing error messages and a signature
> payload in the same variable seems a bit odd, but maybe I'm misreading
> it. In any case it seems to pre-date this series...
> 

True, it is a bit odd. This function generates the message text when merging a (signed) tag. It verifies the tag upon doing so and includes the result information in the message.

I'm not sure what should happen in this error case. (especially since this is one of those "this should never happen" errors). I don't know if i can just warn() here or if that would be lost or even corrupt the merge message :/ If the buffer parsing fails this could result in ssh signatures being marked as valid even though they expired. So i think it it important to include this info. But the error has no effect on gpg signatures. So telling users about not being able to check key lifetime here might paint a wrong picture.

Thanks, Fabian

Previous: Ævar Arnfjörð BjarmasonNext: Fabian Stelzer
Message 13 of 14 in “ssh signing: verify key lifetime”
  1. 0/6 ssh signing: verify key lifetimeFabian Stelzer, Oct 22, 2021
  2. 1/6 ssh signing: extend check_signature to accept payload metadataFabian Stelzer, Oct 22, 2021
  3. Junio C HamanoOct 23, 2021
  4. Fabian StelzerOct 25, 2021
  5. Junio C HamanoOct 25, 2021
  6. 3/6 ssh signing: verify-commit/check_signature with commit dateFabian Stelzer, Oct 22, 2021
  7. Ævar Arnfjörð BjarmasonOct 22, 2021
  8. Fabian StelzerOct 25, 2021
  9. 4/6 ssh signing: git log/check_signature with commit dateFabian Stelzer, Oct 22, 2021
  10. 5/6 ssh signing: verify-tag/check_signature with tag dateFabian Stelzer, Oct 22, 2021
  11. 6/6 ssh signing: fmt-merge-msg/check_signature with tag dateFabian Stelzer, Oct 22, 2021
  12. Ævar Arnfjörð BjarmasonOct 22, 2021
  13. Fabian StelzerOct 25, 2021
  14. 2/6 ssh signing: add key lifetime test prereqsFabian Stelzer, Oct 22, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.