|
|
|
@ -3,7 +3,7 @@
|
|
|
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
|
|
|
# |
|
|
|
|
# Filename: package/.../mkinitramfs/install/D%libdir_ssh.in.txt |
|
|
|
|
# Copyright (C) 2008 The OpenSDE Project |
|
|
|
|
# Copyright (C) 2008 - 2010 The OpenSDE Project |
|
|
|
|
# |
|
|
|
|
# More information can be found in the files COPYING and README. |
|
|
|
|
# |
|
|
|
@ -13,24 +13,34 @@
|
|
|
|
|
# GNU General Public License can be found in the file COPYING. |
|
|
|
|
# --- SDE-COPYRIGHT-NOTE-END --- |
|
|
|
|
|
|
|
|
|
openssh_hostkey() { |
|
|
|
|
case "$1" in |
|
|
|
|
rsa|dsa) |
|
|
|
|
echo "/etc/ssh/ssh_host_${1}_key" |
|
|
|
|
;; |
|
|
|
|
openssh_install_hostkey() { |
|
|
|
|
local type="$1" key= |
|
|
|
|
case "$type" in |
|
|
|
|
rsa|dsa) key="/etc/ssh/ssh_host_${type}_key" ;; |
|
|
|
|
esac |
|
|
|
|
|
|
|
|
|
if [ -n "$key" -a -s "$root$key" ]; then |
|
|
|
|
echo "Injecting OpenSSH Host Key ($type)..." |
|
|
|
|
cp -vf "$root$key" "$tmpdir$key" |
|
|
|
|
else |
|
|
|
|
false |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
openssh_has_hostkey() { |
|
|
|
|
local key=$(openssh_hostkey "$1") |
|
|
|
|
dropbear_install_hostkey() { |
|
|
|
|
local type="$1" key= |
|
|
|
|
|
|
|
|
|
[ -n "$key" -a -s "$root$key" ] |
|
|
|
|
} |
|
|
|
|
# translation |
|
|
|
|
case "$type" in |
|
|
|
|
dsa) type=dss ;; |
|
|
|
|
esac |
|
|
|
|
|
|
|
|
|
case "$type" in |
|
|
|
|
rsa|dss) key="/etc/dropbear/dropbear_${type}_host_key" ;; |
|
|
|
|
esac |
|
|
|
|
|
|
|
|
|
openssh_install_hostkey() { |
|
|
|
|
local key=$(openssh_hostkey "$1") |
|
|
|
|
if [ -n "$key" -a -s "$root$key" ]; then |
|
|
|
|
echo "Injecting OpenSSH Host Key ($1)..." |
|
|
|
|
echo "Injecting Dropbear Host Key ($type)..." |
|
|
|
|
cp -vf "$root$key" "$tmpdir$key" |
|
|
|
|
else |
|
|
|
|
false |
|
|
|
|