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 <pedro@yubico.com>
This commit is contained in:
pedro martelletto
2021-11-26 17:11:43 +01:00
committed by Johannes Schindelin
parent 107be938e5
commit 1383ae5f12

View File

@@ -509,7 +509,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);