| @@ -1,16 +1,16 @@ | | | @@ -1,16 +1,16 @@ |
1 | #!@RCD_SCRIPTS_SHELL@ | | 1 | #!@RCD_SCRIPTS_SHELL@ |
2 | # | | 2 | # |
3 | # $NetBSD: sshd.sh,v 1.13 2011/05/17 03:26:52 taca Exp $ | | 3 | # $NetBSD: sshd.sh,v 1.14 2014/05/22 03:14:01 taca Exp $ |
4 | # | | 4 | # |
5 | # PROVIDE: sshd | | 5 | # PROVIDE: sshd |
6 | # REQUIRE: DAEMON LOGIN | | 6 | # REQUIRE: DAEMON LOGIN |
7 | | | 7 | |
8 | if [ -f /etc/rc.subr ] | | 8 | if [ -f /etc/rc.subr ] |
9 | then | | 9 | then |
10 | . /etc/rc.subr | | 10 | . /etc/rc.subr |
11 | fi | | 11 | fi |
12 | | | 12 | |
13 | name="sshd" | | 13 | name="sshd" |
14 | rcvar=$name | | 14 | rcvar=$name |
15 | command="@PREFIX@/sbin/${name}" | | 15 | command="@PREFIX@/sbin/${name}" |
16 | keygen_command="@PREFIX@/bin/ssh-keygen" | | 16 | keygen_command="@PREFIX@/bin/ssh-keygen" |
| @@ -40,35 +40,44 @@ sshd_keygen() | | | @@ -40,35 +40,44 @@ sshd_keygen() |
40 | @ECHO@ "You already have a RSA host key in @PKG_SYSCONFDIR@/ssh_host_rsa_key" | | 40 | @ECHO@ "You already have a RSA host key in @PKG_SYSCONFDIR@/ssh_host_rsa_key" |
41 | @ECHO@ "Skipping protocol version 2 RSA Key Generation" | | 41 | @ECHO@ "Skipping protocol version 2 RSA Key Generation" |
42 | else | | 42 | else |
43 | ${keygen_command} -t rsa -f @PKG_SYSCONFDIR@/ssh_host_rsa_key -N '' | | 43 | ${keygen_command} -t rsa -f @PKG_SYSCONFDIR@/ssh_host_rsa_key -N '' |
44 | fi | | 44 | fi |
45 | /* HAVE_ECDSA_START */ | | 45 | /* HAVE_ECDSA_START */ |
46 | if [ -f @PKG_SYSCONFDIR@/ssh_host_ecdsa_key ]; then | | 46 | if [ -f @PKG_SYSCONFDIR@/ssh_host_ecdsa_key ]; then |
47 | @ECHO@ "You already have a ECDSA host key in @PKG_SYSCONFDIR@/ssh_host_ecdsa_key" | | 47 | @ECHO@ "You already have a ECDSA host key in @PKG_SYSCONFDIR@/ssh_host_ecdsa_key" |
48 | @ECHO@ "Skipping protocol version 2 ECDSA Key Generation" | | 48 | @ECHO@ "Skipping protocol version 2 ECDSA Key Generation" |
49 | else | | 49 | else |
50 | ${keygen_command} -t ecdsa -f @PKG_SYSCONFDIR@/ssh_host_ecdsa_key -N '' | | 50 | ${keygen_command} -t ecdsa -f @PKG_SYSCONFDIR@/ssh_host_ecdsa_key -N '' |
51 | fi | | 51 | fi |
52 | /* HAVE_ECDSA_STOP */ | | 52 | /* HAVE_ECDSA_STOP */ |
| | | 53 | /* HAVE_ED25519_START */ |
| | | 54 | if [ -f @PKG_SYSCONFDIR@/ssh_host_ed25519_key ]; then |
| | | 55 | @ECHO@ "You already have a ED25519 host key in @PKG_SYSCONFDIR@/ssh_host_ed25519_key" |
| | | 56 | @ECHO@ "Skipping protocol version 2 ED25519 Key Generation" |
| | | 57 | else |
| | | 58 | ${keygen_command} -t ed25519 -f @PKG_SYSCONFDIR@/ssh_host_ed25519_key -N '' |
| | | 59 | fi |
| | | 60 | /* HAVE_ED25519_STOP */ |
53 | ) | | 61 | ) |
54 | } | | 62 | } |
55 | | | 63 | |
56 | sshd_precmd() | | 64 | sshd_precmd() |
57 | { | | 65 | { |
58 | if [ ! -f @PKG_SYSCONFDIR@/ssh_host_key -o \ | | 66 | if [ ! -f @PKG_SYSCONFDIR@/ssh_host_key -o \ |
59 | ! -f @PKG_SYSCONFDIR@/ssh_host_dsa_key -o \ | | 67 | ! -f @PKG_SYSCONFDIR@/ssh_host_dsa_key -o \ |
60 | ! -f @PKG_SYSCONFDIR@/ssh_host_rsa_key -o \ | | 68 | ! -f @PKG_SYSCONFDIR@/ssh_host_rsa_key -o \ |
61 | ! -f @PKG_SYSCONFDIR@/ssh_host_ecdsa_key ]; then | | 69 | ! -f @PKG_SYSCONFDIR@/ssh_host_ecdsa_key -o \ |
| | | 70 | ! -f @PKG_SYSCONFDIR@/ssh_host_ed25519_key ]; then |
62 | if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -f /etc/rc.d/DAEMON ] | | 71 | if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -f /etc/rc.d/DAEMON ] |
63 | then | | 72 | then |
64 | run_rc_command keygen | | 73 | run_rc_command keygen |
65 | else | | 74 | else |
66 | eval ${keygen_cmd} | | 75 | eval ${keygen_cmd} |
67 | fi | | 76 | fi |
68 | fi | | 77 | fi |
69 | } | | 78 | } |
70 | | | 79 | |
71 | keygen_cmd=sshd_keygen | | 80 | keygen_cmd=sshd_keygen |
72 | start_precmd=sshd_precmd | | 81 | start_precmd=sshd_precmd |
73 | | | 82 | |
74 | if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -f /etc/rc.d/DAEMON ] | | 83 | if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -f /etc/rc.d/DAEMON ] |