Module Name:    src
Committed By:   christos
Date:           Mon Jul 25 03:04:23 UTC 2011

Modified Files:
        src/etc/rc.d: sshd

Log Message:
generate ecdsa key


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/etc/rc.d/sshd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc.d/sshd
diff -u src/etc/rc.d/sshd:1.20 src/etc/rc.d/sshd:1.21
--- src/etc/rc.d/sshd:1.20	Fri Aug 13 14:08:03 2004
+++ src/etc/rc.d/sshd	Sun Jul 24 23:04:23 2011
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: sshd,v 1.20 2004/08/13 18:08:03 mycroft Exp $
+# $NetBSD: sshd,v 1.21 2011/07/25 03:04:23 christos Exp $
 #
 
 # PROVIDE: sshd
@@ -37,6 +37,15 @@
 		    -f /etc/ssh/ssh_host_dsa_key -N ''
 	fi
 
+	if [ -f /etc/ssh/ssh_host_ecdsa_key ]; then
+		echo "You already have a ECDSA host key" \
+		    "in /etc/ssh/ssh_host_ecdsa_key"
+		echo "Skipping protocol version 1 ECDSA Key Generation"
+	else
+		/usr/bin/ssh-keygen -t ecdsa -b 521 \
+		    -f /etc/ssh/ssh_host_ecdsa_key -N ''
+	fi
+
 	if [ -f /etc/ssh/ssh_host_rsa_key ]; then
 		echo "You already have a RSA host key" \
 		    "in /etc/ssh/ssh_host_rsa_key"
@@ -52,6 +61,7 @@
 {
 	if [ ! -f /etc/ssh/ssh_host_key -o \
 	    ! -f /etc/ssh/ssh_host_dsa_key -o \
+	    ! -f /etc/ssh/ssh_host_ecdsa_key -o \
 	    ! -f /etc/ssh/ssh_host_rsa_key ]; then
 		run_rc_command keygen
 	fi

Reply via email to