summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-05-30 20:04:55 +0000
committerMike Frysinger <vapier@gentoo.org>2014-05-30 20:04:55 +0000
commit487fd51ebab47fe7876b07effd47c4b0162a1ab5 (patch)
treec3d41c6c40a3220500cc42b5f9c06b576416e5a9 /net-misc/dropbear
parentEnable multilib support. (diff)
downloadgentoo-2-487fd51ebab47fe7876b07effd47c4b0162a1ab5.tar.gz
gentoo-2-487fd51ebab47fe7876b07effd47c4b0162a1ab5.tar.bz2
gentoo-2-487fd51ebab47fe7876b07effd47c4b0162a1ab5.zip
Generate keys for all types dropbear supports.
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
Diffstat (limited to 'net-misc/dropbear')
-rw-r--r--net-misc/dropbear/ChangeLog5
-rw-r--r--net-misc/dropbear/files/dropbear.init.d31
2 files changed, 21 insertions, 15 deletions
diff --git a/net-misc/dropbear/ChangeLog b/net-misc/dropbear/ChangeLog
index 51b20e897a9d..c7d9a9e30e9f 100644
--- a/net-misc/dropbear/ChangeLog
+++ b/net-misc/dropbear/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for net-misc/dropbear
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dropbear/ChangeLog,v 1.117 2014/03/10 00:24:19 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dropbear/ChangeLog,v 1.118 2014/05/30 20:04:55 vapier Exp $
+
+ 30 May 2014; Mike Frysinger <vapier@gentoo.org> files/dropbear.init.d:
+ Generate keys for all types dropbear supports.
*dropbear-2014.63 (10 Mar 2014)
diff --git a/net-misc/dropbear/files/dropbear.init.d b/net-misc/dropbear/files/dropbear.init.d
index afdee8c6d3c2..3aadfecb5779 100644
--- a/net-misc/dropbear/files/dropbear.init.d
+++ b/net-misc/dropbear/files/dropbear.init.d
@@ -1,7 +1,7 @@
#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dropbear/files/dropbear.init.d,v 1.2 2004/07/14 23:57:35 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dropbear/files/dropbear.init.d,v 1.3 2014/05/30 20:04:55 vapier Exp $
depend() {
use logger dns
@@ -9,23 +9,26 @@ depend() {
}
check_config() {
- if [ ! -e /etc/dropbear/ ] ; then
- mkdir /etc/dropbear/
- fi
- if [ ! -e /etc/dropbear/dropbear_dss_host_key ] ; then
- einfo "Generating DSS-Hostkey..."
- /usr/bin/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
- fi
- if [ ! -e /etc/dropbear/dropbear_rsa_host_key ] ; then
- einfo "Generating RSA-Hostkey..."
- /usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
- fi
+ mkdir -p /etc/dropbear
+
+ local t k
+ for t in dss rsa ecdsa; do
+ k="/etc/dropbear/dropbear_${t}_host_key"
+ if [ ! -e ${k} ] ; then
+ # See if support is enabled for this key type.
+ if dropbearkey -h 2>&1 | grep -q " ${t}$" ; then
+ einfo "Generating ${k} ..."
+ dropbearkey -t ${t} -f ${k} >/dev/null
+ fi
+ fi &
+ done
+ wait
}
start() {
check_config || return 1
ebegin "Starting dropbear"
- /usr/sbin/dropbear ${DROPBEAR_OPTS}
+ dropbear ${DROPBEAR_OPTS}
eend $?
}