]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
openssh: update sshd_check_keys script to make use of 'sshd -G'
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Fri, 29 Sep 2023 08:43:15 +0000 (10:43 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 4 Oct 2023 22:54:51 +0000 (23:54 +0100)
commitdd27f9d869b8aa28dfb18de037a24ab0ec735718
tree656065d110ea23027eedfa6d3276f4d9accfe1d8
parent605938b3bb19dcf6c7218648b4d16df9eaa675fc
openssh: update sshd_check_keys script to make use of 'sshd -G'

Parsing sshd's config file with 'sed' does not work in for example the
case where somebody has made use of the new ability to add a config
fragment in /etc/ssh/sshd_config.d/ with one or more HostKey
stanzas. Also, sshd_config keywords are case-insensitive, but the
current sed pattern only matches the CamelCase spelling of HostKey.

In openssh 9.3, sshd learnt a new command line flag '-G', which causes
sshd to parse the given configuration file and print the resulting
effective configuration on stdout. So use that instead.

Furthermore, since that "effective configuration" includes the default
set of host keys if the configuration file has no HostKey stanzas, we
also avoid the script needing to know what sshd's default is - that
could plausibly change with some future release.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-connectivity/openssh/openssh/sshd_check_keys