From: Fabian Stelzer <fs@gigacodes.de>
To: Phillip Wood via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH v2] ssh signing: return an error when signature cannot be read
Date: Thu, 6 Oct 2022 10:28:17 +0200 [thread overview]
Message-ID: <20221006082817.4uxywfxjokfyml6y@fs> (raw)
In-Reply-To: <pull.1371.v2.git.1664877694430.gitgitgadget@gmail.com>
On 04.10.2022 10:01, Phillip Wood via GitGitGadget wrote:
>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.
>
>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
next prev parent reply other threads:[~2022-10-06 8:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-03 9:24 [PATCH] ssh signing: return an error when signature cannot be read Phillip Wood via GitGitGadget
2022-10-03 16:13 ` Junio C Hamano
2022-10-04 10:01 ` [PATCH v2] " Phillip Wood via GitGitGadget
2022-10-06 8:28 ` Fabian Stelzer [this message]
2022-10-06 13:05 ` Phillip Wood
2022-10-06 14:19 ` Fabian Stelzer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221006082817.4uxywfxjokfyml6y@fs \
--to=fs@gigacodes.de \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=phillip.wood@dunelm.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).