mirror of
https://git.yoctoproject.org/poky
synced 2026-05-08 05:09:24 +00:00
dropbear: Deal with truncated host keys by removing them
Dropbear does not start when the host key is empty and it is possible that a device is switched off before the host key is generated. This is possible because the dropbearkey code doesn't create a temporary file first. Detect truncated keys and then remove them which will lead to the re-generation. This way the dropbear process will always start. (From OE-Core rev: 16b57e352f5844f301cc6c7ea4f87bf750c11d67) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
63ccf62420
commit
4a61ee99fc
@@ -2,7 +2,7 @@ DESCRIPTION = "Dropbear is a lightweight SSH and SCP implementation"
|
||||
HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html"
|
||||
SECTION = "console/network"
|
||||
|
||||
INC_PR = "r1"
|
||||
INC_PR = "r2"
|
||||
|
||||
# some files are from other projects and have others license terms:
|
||||
# public domain, OpenSSH 3.5p1, OpenSSH3.6.1p2, PuTTY
|
||||
|
||||
@@ -58,9 +58,15 @@ gen_keys() {
|
||||
for t in $DROPBEAR_KEYTYPES; do
|
||||
case $t in
|
||||
rsa)
|
||||
if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
|
||||
rm $DROPBEAR_RSAKEY || true
|
||||
fi
|
||||
test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY
|
||||
;;
|
||||
dsa)
|
||||
if [ -f "$DROPBEAR_DSSKEY" -a ! -s "$DROPBEAR_DSSKEY" ]; then
|
||||
rm $DROPBEAR_DSSKEY || true
|
||||
fi
|
||||
test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user