Patchwork openssh: Update init file to add ED25519 Key generation

login
register
mail settings
Submitter Saul Wold
Date March 17, 2014, 6:33 p.m.
Message ID <1395081182-21903-1-git-send-email-sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/68769/
State New
Headers show

Comments

Saul Wold - March 17, 2014, 6:33 p.m.
[YOCTO #5983]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/recipes-connectivity/openssh/openssh/init | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/recipes-connectivity/openssh/openssh/init b/meta/recipes-connectivity/openssh/openssh/init
index e7f3971..37c8e7b 100644
--- a/meta/recipes-connectivity/openssh/openssh/init
+++ b/meta/recipes-connectivity/openssh/openssh/init
@@ -20,6 +20,7 @@  mkdir -p $SYSCONFDIR
 HOST_KEY_RSA=$SYSCONFDIR/ssh_host_rsa_key
 HOST_KEY_DSA=$SYSCONFDIR/ssh_host_dsa_key
 HOST_KEY_ECDSA=$SYSCONFDIR/ssh_host_ecdsa_key
+HOST_KEY_ED25519=$SYSCONFDIR/ssh_host_ed25519_key
 
 check_for_no_start() {
     # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists
@@ -51,10 +52,14 @@  check_keys() {
 		echo "  generating ssh ECDSA key..."
 		ssh-keygen -q -f $HOST_KEY_ECDSA -N '' -t ecdsa
 	fi
-	if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
+	if [ ! -f $HOST_KEY_DSA ]; then
 		echo "  generating ssh DSA key..."
 		ssh-keygen -q -f $HOST_KEY_DSA -N '' -t dsa
 	fi
+	if [ ! -f $HOST_KEY_ED25519 ]; then
+		echo "  generating ssh ED25519 key..."
+		ssh-keygen -q -f $HOST_KEY_ED25519 -N '' -t ed25519
+	fi
 }
 
 export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"