All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpg-interface: trim CR from ssh-keygen -Y find-principals
@ 2021-12-03 13:31 Johannes Schindelin via GitGitGadget
  2021-12-03 14:18 ` Fabian Stelzer
                   ` (2 more replies)
  0 siblings, 3 replies; 30+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2021-12-03 13:31 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, pedro martelletto

From: pedro martelletto <pedro@yubico.com>

We need to trim \r from the output of 'ssh-keygen -Y find-principals' on
Windows, or we end up calling 'ssh-keygen -Y verify' with a bogus signer
identity. ssh-keygen.c:2841 contains a call to puts(3), which confirms this
hypothesis. Signature verification passes with the fix.

Signed-off-by: pedro martelletto <pedro@yubico.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
    Allow for CR in the output of ssh-keygen
    
    This came in via https://github.com/git-for-windows/git/pull/3561. It
    affects current Windows versions of OpenSSH (but apparently not the
    MSYS2 version included in Git for Windows).

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1090%2Fdscho%2Fallow-cr-from-ssh-keygen-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1090/dscho/allow-cr-from-ssh-keygen-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1090

 gpg-interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gpg-interface.c b/gpg-interface.c
index 3e7255a2a91..85e26882782 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -497,7 +497,7 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,
 			if (!*line)
 				break;
 
-			trust_size = strcspn(line, "\n");
+			trust_size = strcspn(line, "\r\n");
 			principal = xmemdupz(line, trust_size);
 
 			child_process_init(&ssh_keygen);

base-commit: abe6bb3905392d5eb6b01fa6e54d7e784e0522aa
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2022-01-10 17:51 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 13:31 [PATCH] gpg-interface: trim CR from ssh-keygen -Y find-principals Johannes Schindelin via GitGitGadget
2021-12-03 14:18 ` Fabian Stelzer
2021-12-03 15:58 ` Jeff King
2021-12-04 13:11   ` Fabian Stelzer
2021-12-05  5:50     ` Junio C Hamano
     [not found]       ` <CABPYr=y+sDDko9zPxQTOM6Tz4E7CafH7hJc6oB1zv7XYA9KH1A@mail.gmail.com>
2021-12-09 16:33         ` Fabian Stelzer
     [not found]           ` <CABPYr=xfotWvTQK9k1eKHa0kP4SsB=TKKuM0d8cpMb5BtuUZLA@mail.gmail.com>
2021-12-09 17:20             ` Fabian Stelzer
2021-12-30 10:25             ` Fabian Stelzer
2021-12-05 23:06     ` Damien Miller
2021-12-06  8:39       ` Fabian Stelzer
2022-01-03  9:53 ` [PATCH v2] gpg-interface: trim CR from ssh-keygen Fabian Stelzer
2022-01-03 17:17   ` Eric Sunshine
2022-01-03 23:34     ` Junio C Hamano
2022-01-04  0:41       ` Eric Sunshine
2022-01-04  1:19         ` Junio C Hamano
2022-01-04  3:06           ` Eric Sunshine
2022-01-04 12:55             ` Fabian Stelzer
2022-01-04 19:33               ` Junio C Hamano
2022-01-05  7:09                 ` Eric Sunshine
2022-01-05 10:36                   ` Fabian Stelzer
2022-01-05 20:40                     ` Junio C Hamano
2022-01-06 10:26                       ` Fabian Stelzer
2022-01-06 17:50                         ` Junio C Hamano
2022-01-09 20:49                     ` Eric Sunshine
2022-01-10 12:28                       ` Fabian Stelzer
2022-01-07  9:07   ` [PATCH v3] " Fabian Stelzer
2022-01-09 21:37     ` Eric Sunshine
2022-01-10 12:59       ` Fabian Stelzer
2022-01-10 17:51         ` Junio C Hamano
2022-01-10 17:03       ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.