aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-01-18 15:47:34 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-20 12:56:58 +0000
commit16b57e352f5844f301cc6c7ea4f87bf750c11d67 (patch)
treeb82dc80071d548b5068488dfa13ef14d58aaa55e
parent0f4112016bac07f0294f2a4d0fde4659c0fed2d2 (diff)
downloadopenembedded-core-contrib-16b57e352f5844f301cc6c7ea4f87bf750c11d67.tar.gz
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/dropbear/dropbear.inc2
-rwxr-xr-xmeta/recipes-core/dropbear/dropbear/init6
2 files changed, 7 insertions, 1 deletions
diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear.inc
index 3e430f22bf..3a39c95225 100644
--- a/meta/recipes-core/dropbear/dropbear.inc
+++ b/meta/recipes-core/dropbear/dropbear.inc
@@ -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
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