Skip to content

Commit d7950ac

Browse files
committed
upstream: In ssh(1), don't try to match certificates held in an
agent to private keys. This matching is done to support certificates that were loaded without their private key material, but is unnecessary for agent-hosted certificate which always have private key material loaded in the agent. Worse, this matching would mess up the request sent to the agent in such a way as to break usage of these keys when the key usage was restricted in the agent. Patch from Thibault Cools via bz3752, ok dtucker@ OpenBSD-Commit-ID: ebfe37817dad4841c53339930565242ec683d726
1 parent b0d0b71 commit d7950ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sshconnect2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: sshconnect2.c,v 1.378 2025/09/15 04:51:35 djm Exp $ */
1+
/* $OpenBSD: sshconnect2.c,v 1.379 2026/01/21 23:58:20 djm Exp $ */
22
/*
33
* Copyright (c) 2000 Markus Friedl. All rights reserved.
44
* Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -1341,7 +1341,7 @@ sign_and_send_pubkey(struct ssh *ssh, Identity *id)
13411341
* This will try to set sign_id to the private key that will perform
13421342
* the signature.
13431343
*/
1344-
if (sshkey_is_cert(id->key)) {
1344+
if (id->agent_fd == -1 && sshkey_is_cert(id->key)) {
13451345
TAILQ_FOREACH(private_id, &authctxt->keys, next) {
13461346
if (sshkey_equal_public(id->key, private_id->key) &&
13471347
id->key->type != private_id->key->type) {

0 commit comments

Comments
 (0)