]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: simply disable UpdateHostkeys when a certificate
authordjm@openbsd.org <djm@openbsd.org>
Wed, 7 Oct 2020 02:20:35 +0000 (02:20 +0000)
committerDamien Miller <djm@mindrot.org>
Wed, 7 Oct 2020 02:34:11 +0000 (13:34 +1100)
successfully authenticated the host; simpler than the complicated plumbing
via kex->flags we have now.

ok markus@

OpenBSD-Commit-ID: 80e39644eed75717d563a7f177e8117a0e14f42c

sshconnect.c

index 31e012df29756e9f5a5f521bdbfec24ac59be105..ba07a5ff3a1de47cdbcdd04094295b27479c1f1c 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.c,v 1.335 2020/10/04 09:45:01 djm Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.336 2020/10/07 02:20:35 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -609,7 +609,12 @@ check_host_cert(const char *host, const struct sshkey *key)
                    "(null)" : key->cert->signature_type, ssh_err(r));
                return 0;
        }
-
+       /* Do not attempt hostkey update if a certificate was successful */
+       if (options.update_hostkeys != 0) {
+               options.update_hostkeys = 0;
+               debug3("%s: certificate host key in use; disabling "
+                   "UpdateHostkeys", __func__);
+       }
        return 1;
 }