Skip to content

Commit 15fe1ce

Browse files
committed
upstream: bit of webauthn support missed in previous commit
OpenBSD-Commit-ID: 9768454543ded01b7c61567fc5b3e78664346be2
1 parent 670f7d2 commit 15fe1ce

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

authfd.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: authfd.c,v 1.136 2025/08/29 03:50:38 djm Exp $ */
1+
/* $OpenBSD: authfd.c,v 1.137 2026/02/07 02:02:00 djm Exp $ */
22
/*
33
* Author: Tatu Ylonen <ylo@cs.hut.fi>
44
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -437,8 +437,15 @@ ssh_agent_sign(int sock, const struct sshkey *key,
437437
}
438438
if ((r = sshbuf_get_string(msg, &sig, &len)) != 0)
439439
goto out;
440-
/* Check what we actually got back from the agent. */
441-
if ((r = sshkey_check_sigtype(sig, len, alg)) != 0)
440+
/*
441+
* Check what we actually got back from the agent, in case it returned
442+
* an incorrect RSA signature algorithm (e.g. "ssh-rsa" (RSA/SHA1) vs.
443+
* "rsa-sha2-256").
444+
* We don't do this for FIDO signatures as webauthn vs plain are just
445+
* different signature formats and not entirely different algorithms.
446+
*/
447+
if (!sshkey_is_sk(key) &&
448+
(r = sshkey_check_sigtype(sig, len, alg)) != 0)
442449
goto out;
443450
/* success */
444451
*sigp = sig;

0 commit comments

Comments
 (0)