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

Re: [PATCH v2] ssh signing: return an error when signature cannot be read

From
Fabian Stelzer <fs@gigacodes.de>
Date
Oct 6, 2022, 08:28 UTC
Message-ID
<20221006082817.4uxywfxjokfyml6y@fs>
In-Reply-To
<pull.1371.v2.git.1664877694430.gitgitgadget@gmail.com>
On 04.10.2022 10:01, Phillip Wood via GitGitGadget wrote:
Show 12 quoted lines
>From: Phillip Wood <phillip.wood@dunelm.org.uk>
>
>If the signature file cannot be read we print an error message but do
>not return an error to the caller. In practice it seems unlikely that
>the file would be unreadable if the call to ssh-keygen succeeds.
>
>The unlink_or_warn() call is moved to the end of the function so that
>we always try and remove the signature file. This isn't strictly
>necessary at the moment but it protects us against any extra code
>being added between trying to read the signature file and the cleanup
>at the end of the function in the future. unlink_or_warn() only prints
>a warning if it exists and cannot be removed.
Sounds sensible and the change looks good to me.
Show 15 quoted lines
>
>Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
>---
>    ssh signing: return an error when signature cannot be read
>
>    Thanks to Junio for his comments. I've updated the patch to always use
>    unlink_or_warn() to remove the signature file as it does not warn on
>    missing files.
>
>    V1 cover letter
>
>    This patch is based on maint. In the longer term the code could be
>    simplified by using pipes rather than tempfiles as we do for gpg.
>    ssh-keygen has supported reading the data to be signed from stdin and
>    writing the signature to stdout since it introduced signing.

The ssh-keygen call is already using stdin for the content to sign or verify. The signature and the signing key need to be files passed as parameters to ssh-keygen. I'm not aware of any other option of providing them to it.

Cheers, Fabian

Previous: Phillip Wood via GitGitGadgetNext: Phillip Wood
Message 4 of 6 in “ssh signing: return an error when signature cannot be read”
  1. ssh signing: return an error when signature cannot be readPhillip Wood via GitGitGadget, Oct 3, 2022
  2. Junio C HamanoOct 3, 2022
  3. ssh signing: return an error when signature cannot be readPhillip Wood via GitGitGadget, Oct 4, 2022
  4. Fabian StelzerOct 6, 2022
  5. Phillip WoodOct 6, 2022
  6. Fabian StelzerOct 6, 2022

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.