From 4a61ee99fc6b2361a67af162f1f0d278701d226c Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 18 Jan 2013 15:47:34 +0100 Subject: 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 --- meta/recipes-core/dropbear/dropbear/init | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'meta/recipes-core/dropbear/dropbear') diff --git a/meta/recipes-core/dropbear/dropbear/init b/meta/recipes-core/dropbear/dropbear/init index e882bae689..5cc2d656e8 100755 --- a/meta/recipes-core/dropbear/dropbear/init +++ b/meta/recipes-core/dropbear/dropbear/init @@ -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 -- cgit v1.2.3-54-g00ecf