Last active
July 8, 2024 00:06
-
-
Save ldmsys/a4a2111f8488ffe1981a6ac1f41b3431 to your computer and use it in GitHub Desktop.
Arch Linux mkinitcpio-dropbear patch for support copying ED25519 key from host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- dropbear.old 2024-07-08 08:56:16.334606650 +0900 | |
+++ dropbear 2024-07-08 09:05:31.146341355 +0900 | |
@@ -8,7 +8,7 @@ | |
display_fingerprints() { | |
local keyfile | |
- for keyfile in "/etc/dropbear/dropbear_rsa_host_key" "/etc/dropbear/dropbear_dss_host_key" "/etc/dropbear/dropbear_ecdsa_host_key" ; do | |
+ for keyfile in "/etc/dropbear/dropbear_rsa_host_key" "/etc/dropbear/dropbear_dss_host_key" "/etc/dropbear/dropbear_ecdsa_host_key" "/etc/dropbear/dropbear_ed25519_host_key" ; do | |
if [ -s "${keyfile}" ] ; then | |
echo "$(basename "${keyfile}") : $(get_fingerprint "${keyfile}")" | |
fi | |
@@ -19,6 +19,7 @@ | |
local osshrsa="/etc/ssh/ssh_host_rsa_key" | |
local osshdsa="/etc/ssh/ssh_host_dsa_key" | |
local osshecdsa="/etc/ssh/ssh_host_ecdsa_key" | |
+ local osshed25519="/etc/ssh/ssh_host_ed25519_key" | |
local dbpre="/etc/dropbear/dropbear_" | |
@@ -39,12 +40,17 @@ | |
return_code=0 | |
fi | |
+ if [ -s "$osshed25519" ]; then | |
+ dropbearconvert openssh dropbear $osshed25519 ${dbpre}ed25519_host_key | |
+ return_code=0 | |
+ fi | |
+ | |
return $return_code | |
} | |
generate_keys() { | |
local keyfile keytype | |
- for keytype in rsa dss ecdsa ; do | |
+ for keytype in rsa dss ecdsa ed25519 ; do | |
keyfile="/etc/dropbear/dropbear_${keytype}_host_key" | |
if [ ! -s "$keyfile" ]; then | |
echo "Generating ${keytype} host key for dropbear ..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment