Skip to content

Commit cf6c0b3

Browse files
committed
upstream: fix hard-to-reach NULL deref during pubkey auth
To hit this, the user must be using a PEM style private key with no corresponding .pub key adjacent to it. OpenBSD-Commit-ID: b7150acc5322fa33f21491834d9471fbe3d30f20
1 parent 55df196 commit cf6c0b3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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.385 2026/04/02 07:48:13 djm Exp $ */
1+
/* $OpenBSD: sshconnect2.c,v 1.386 2026/05/13 05:11:02 djm Exp $ */
22
/*
33
* Copyright (c) 2000 Markus Friedl. All rights reserved.
44
* Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -1277,7 +1277,7 @@ identity_sign(struct identity *id, u_char **sigp, size_t *lenp,
12771277
* PKCS#11 tokens may not support all signature algorithms,
12781278
* so check what we get back.
12791279
*/
1280-
if ((id->key->flags & SSHKEY_FLAG_EXT) != 0 &&
1280+
if (id->key != NULL && (id->key->flags & SSHKEY_FLAG_EXT) != 0 &&
12811281
(r = sshkey_check_sigtype(*sigp, *lenp, alg)) != 0) {
12821282
debug_fr(r, "sshkey_check_sigtype");
12831283
goto out;

0 commit comments

Comments
 (0)