summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/dropbear
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-01-18 14:47:34 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-20 12:58:58 (GMT)
commit4a61ee99fc6b2361a67af162f1f0d278701d226c (patch)
tree47a44af078866eac9e25c9d43e4c94763d5a6bba /meta/recipes-core/dropbear
parent63ccf6242064055e280ffd05a4726f89de6b9b98 (diff)
downloadpoky-4a61ee99fc6b2361a67af162f1f0d278701d226c.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. (From OE-Core rev: 16b57e352f5844f301cc6c7ea4f87bf750c11d67) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/dropbear')
-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 3e430f2..3a39c95 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"
2HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html" 2HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html"
3SECTION = "console/network" 3SECTION = "console/network"
4 4
5INC_PR = "r1" 5INC_PR = "r2"
6 6
7# some files are from other projects and have others license terms: 7# some files are from other projects and have others license terms:
8# public domain, OpenSSH 3.5p1, OpenSSH3.6.1p2, PuTTY 8# 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 e882bae..5cc2d65 100755
--- a/meta/recipes-core/dropbear/dropbear/init
+++ b/meta/recipes-core/dropbear/dropbear/init
@@ -58,9 +58,15 @@ gen_keys() {
58for t in $DROPBEAR_KEYTYPES; do 58for t in $DROPBEAR_KEYTYPES; do
59 case $t in 59 case $t in
60 rsa) 60 rsa)
61 if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
62 rm $DROPBEAR_RSAKEY || true
63 fi
61 test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY 64 test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY
62 ;; 65 ;;
63 dsa) 66 dsa)
67 if [ -f "$DROPBEAR_DSSKEY" -a ! -s "$DROPBEAR_DSSKEY" ]; then
68 rm $DROPBEAR_DSSKEY || true
69 fi
64 test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY 70 test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY
65 ;; 71 ;;
66 esac 72 esac