diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-02-26 13:00:36 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-02-26 13:01:36 +0000 |
commit | 631e05bb3e705d0665d0606ac482567de4b70a44 (patch) | |
tree | 17ec4b0302b643359d0cf823f81a35c86ccc85bb /main/openssh | |
parent | d8e492cc529e0e7ced5076a932202fbcaec6c714 (diff) | |
download | aports-631e05bb3e705d0665d0606ac482567de4b70a44.tar.bz2 aports-631e05bb3e705d0665d0606ac482567de4b70a44.tar.xz |
main/openssh: generate ecdsa host key
Diffstat (limited to 'main/openssh')
-rw-r--r-- | main/openssh/APKBUILD | 4 | ||||
-rw-r--r-- | main/openssh/sshd.initd | 34 |
2 files changed, 21 insertions, 17 deletions
diff --git a/main/openssh/APKBUILD b/main/openssh/APKBUILD index 2864b2c1e..8741c511f 100644 --- a/main/openssh/APKBUILD +++ b/main/openssh/APKBUILD @@ -2,7 +2,7 @@ pkgname=openssh pkgver=5.8_p1 _myver=${pkgver%_*}${pkgver#*_} -pkgrel=0 +pkgrel=1 pkgdesc="Port of OpenBSD's free SSH release" url="http://www.openssh.org/portable.html" arch="all" @@ -88,5 +88,5 @@ client() { md5sums="86f5e1c23b4c4845f23b9b7b493fb53d openssh-5.8p1.tar.gz 4c96723cb6dd02f76fe263c4d68c6a6f openssh5.8-dynwindow_noneswitch.diff.gz 578fb646bab2d312172ec716970031b1 openssh5.8-peaktput.diff -d993cc91e9fab6c6012390874c28af0a sshd.initd +e36e847812214822044b6d3e0027d3fc sshd.initd b35e9f3829f4cfca07168fcba98749c7 sshd.confd" diff --git a/main/openssh/sshd.initd b/main/openssh/sshd.initd index 34852c4e3..d1e6e16d4 100644 --- a/main/openssh/sshd.initd +++ b/main/openssh/sshd.initd @@ -1,9 +1,9 @@ #!/sbin/runscript -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/files/sshd.rc6,v 1.23 2007/09/20 07:38:06 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/files/sshd.rc6.2,v 1.1 2011/01/24 02:55:47 vapier Exp $ -opts="reload" +opts="${opts} reload checkconfig gen_keys" depend() { use logger dns @@ -31,20 +31,23 @@ checkconfig() { "${SSHD_BINARY}" -t ${myopts} || return 1 } -gen_keys() { - if [ ! -e "${SSHD_CONFDIR}"/ssh_host_key ] ; then - einfo "Generating Hostkey..." - /usr/bin/ssh-keygen -t rsa1 -b 1024 -f "${SSHD_CONFDIR}"/ssh_host_key -N '' || return 1 - fi - if [ ! -e "${SSHD_CONFDIR}"/ssh_host_dsa_key ] ; then - einfo "Generating DSA-Hostkey..." - /usr/bin/ssh-keygen -d -f "${SSHD_CONFDIR}"/ssh_host_dsa_key -N '' || return 1 +gen_key() { + local type=$1 key ks + [ $# -eq 1 ] && ks="${type}_" + key="${SSHD_CONFDIR}/ssh_host_${ks}key" + if [ ! -e "${key}" ] ; then + ebegin "Generating ${type} host key" + ssh-keygen -t ${type} -f "${key}" -N '' + eend $? || return $? fi - if [ ! -e "${SSHD_CONFDIR}"/ssh_host_rsa_key ] ; then - einfo "Generating RSA-Hostkey..." - /usr/bin/ssh-keygen -t rsa -f "${SSHD_CONFDIR}"/ssh_host_rsa_key -N '' || return 1 +} + +gen_keys() { + if egrep -q '^[[:space:]]*Protocol[[:space:]]+.*1' "${SSHD_CONFDIR}"/sshd_config ; then + gen_key rsa1 "" || return 1 fi - return 0 + gen_key dsa && gen_key rsa && gen_key ecdsa + return $? } start() { @@ -74,6 +77,7 @@ stop() { } reload() { + checkconfig || return 1 ebegin "Reloading ${SVCNAME}" start-stop-daemon --stop --signal HUP --oknodo \ --exec "${SSHD_BINARY}" --pidfile "${SSHD_PIDFILE}" |