mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-18 21:28:02 +00:00
dropbear: configure hostkey auto-generation
Config option "HostKeyTypes" specifies which hostkeys to auto-generate for dropbear. uci set dropbear.@dropbear[-1].HostKeyTypes='ed25519' Signed-off-by: John Kirk <johnskirk@proton.me>
This commit is contained in:
parent
ff5f77ecdd
commit
caf53ef0a2
@ -80,7 +80,20 @@ hk_config()
|
||||
# $1 - host key file name
|
||||
hk_config__keyfile() { hk_config keyfile "$1" ; }
|
||||
|
||||
ktype_all='ed25519 ecdsa rsa'
|
||||
hk_enabled_ktypes() {
|
||||
local ktypes ktype values value ret
|
||||
|
||||
ktypes=$($PROG --help 2>&1|awk '/\s+- /{print $2}')
|
||||
values=$(uci get dropbear.@dropbear[-1].HostKeyTypes 2>/dev/null)
|
||||
for ktype in $ktypes ; do
|
||||
for value in $values ; do
|
||||
[ $value = $ktype ] && ret="${ret}${ret:+ }${ktype}"
|
||||
done
|
||||
done
|
||||
echo ${ret:=$ktypes}
|
||||
}
|
||||
|
||||
ktype_all=$(hk_enabled_ktypes)
|
||||
|
||||
hk_generate_as_needed()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user