]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authordjm@openbsd.org <djm@openbsd.org>
Fri, 21 Aug 2015 23:52:30 +0000 (23:52 +0000)
committerDamien Miller <djm@mindrot.org>
Sat, 22 Aug 2015 01:17:07 +0000 (11:17 +1000)
Fix expansion of HostkeyAlgorithms=+...

Reported by Bryan Drewery

Upstream-ID: 70ca1deea39d758ba36d36428ae832e28566f78d

servconf.c

index 6c7a91e6b22fe15e5b379e91264e3f04c4124f57..b5db0f74375a1262a10ddcee3165428b048617ca 100644 (file)
@@ -1,5 +1,5 @@
 
-/* $OpenBSD: servconf.c,v 1.280 2015/08/06 14:53:21 deraadt Exp $ */
+/* $OpenBSD: servconf.c,v 1.281 2015/08/21 23:52:30 djm Exp $ */
 /*
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
  *                    All rights reserved
@@ -259,8 +259,6 @@ fill_default_server_options(ServerOptions *options)
                options->hostbased_authentication = 0;
        if (options->hostbased_uses_name_from_packet_only == -1)
                options->hostbased_uses_name_from_packet_only = 0;
-       if (options->hostkeyalgorithms == NULL)
-               options->hostkeyalgorithms = xstrdup(KEX_DEFAULT_PK_ALG);
        if (options->rsa_authentication == -1)
                options->rsa_authentication = 1;
        if (options->pubkey_authentication == -1)
@@ -346,6 +344,8 @@ fill_default_server_options(ServerOptions *options)
            kex_assemble_names(KEX_SERVER_MAC, &options->macs) != 0 ||
            kex_assemble_names(KEX_SERVER_KEX, &options->kex_algorithms) != 0 ||
            kex_assemble_names(KEX_DEFAULT_PK_ALG,
+           &options->hostkeyalgorithms) != 0 ||
+           kex_assemble_names(KEX_DEFAULT_PK_ALG,
            &options->hostbased_key_types) != 0 ||
            kex_assemble_names(KEX_DEFAULT_PK_ALG,
            &options->pubkey_key_types) != 0)