Skip to content

Commit 771fe1b

Browse files
martellettodscho
authored andcommitted
gpg-interface: trim CR from ssh-keygen -Y find-principals
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 <[email protected]>
1 parent 56b9149 commit 771fe1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gpg-interface.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,
509509
if (!*line)
510510
break;
511511

512-
trust_size = strcspn(line, "\n");
512+
trust_size = strcspn(line, "\r\n");
513513
principal = xmemdupz(line, trust_size);
514514

515515
child_process_init(&ssh_keygen);

0 commit comments

Comments
 (0)