Browse Source

mkinitramfs: introduced dropbear_install_hostkey()

user/chris/0.1.0/grsecurity
Alejandro Mery 14 years ago
parent
commit
ccb7289daa
  1. 36
      base/mkinitramfs/install/D%libdir_ssh.in.txt

36
base/mkinitramfs/install/D%libdir_ssh.in.txt

@ -3,7 +3,7 @@
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# #
# Filename: package/.../mkinitramfs/install/D%libdir_ssh.in.txt # 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. # 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. # GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END --- # --- SDE-COPYRIGHT-NOTE-END ---
openssh_hostkey() { openssh_install_hostkey() {
case "$1" in local type="$1" key=
rsa|dsa) case "$type" in
echo "/etc/ssh/ssh_host_${1}_key" rsa|dsa) key="/etc/ssh/ssh_host_${type}_key" ;;
;;
esac 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() { dropbear_install_hostkey() {
local key=$(openssh_hostkey "$1") 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 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" cp -vf "$root$key" "$tmpdir$key"
else else
false false

Loading…
Cancel
Save