Skip to content

Commit a195cfe

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 7e87857 commit a195cfe

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
@@ -497,7 +497,7 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,
497497
if (!*line)
498498
break;
499499

500-
trust_size = strcspn(line, "\n");
500+
trust_size = strcspn(line, "\r\n");
501501
principal = xmemdupz(line, trust_size);
502502

503503
child_process_init(&ssh_keygen);

0 commit comments

Comments
 (0)