[openssh-commits] [openssh] 09/13: upstream: piece of UpdateHostkeys client strictification: when

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Jan 7 09:21:56 AEDT 2022


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 8832402bd500d1661ccc80a476fd563335ef6cdc
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Thu Jan 6 22:02:52 2022 +0000

    upstream: piece of UpdateHostkeys client strictification: when
    
    updating known_hosts with new keys, ignore NULL keys (forgot to include in
    prior commit)
    
    OpenBSD-Commit-ID: 49d2eda6379490e1ceec40c3b670b973f63dea08
---
 hostfile.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hostfile.c b/hostfile.c
index a035b381..bd49e3ac 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostfile.c,v 1.92 2021/10/02 03:17:01 dtucker Exp $ */
+/* $OpenBSD: hostfile.c,v 1.93 2022/01/06 22:02:52 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -642,7 +642,7 @@ hostfile_replace_entries(const char *filename, const char *host, const char *ip,
 	/* Re-add the requested keys */
 	want = HKF_MATCH_HOST | (ip == NULL ? 0 : HKF_MATCH_IP);
 	for (i = 0; i < nkeys; i++) {
-		if ((want & ctx.match_keys[i]) == want)
+		if (keys[i] == NULL || (want & ctx.match_keys[i]) == want)
 			continue;
 		if ((fp = sshkey_fingerprint(keys[i], hash_alg,
 		    SSH_FP_DEFAULT)) == NULL) {

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list