This repository was archived by the owner on Jan 22, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed
image/sysroot-tree/usr/libexec/openssh Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change 66# Create the host keys for the OpenSSH server.
77KEYTYPE=$1
88case $KEYTYPE in
9- " dsa" ) ;& # disabled in FIPS
10- " ed25519" )
11- FIPS=/proc/sys/crypto/fips_enabled
12- if [[ -r " $FIPS " && $( cat $FIPS ) == " 1" ]]; then
13- exit 0
14- fi ;;
15- " rsa" ) ;; # always ok
16- " ecdsa" ) ;;
17- * ) # wrong argument
18- exit 12 ;;
9+ " dsa" ) ;& # disabled in FIPS
10+ " ed25519" )
11+ FIPS=/proc/sys/crypto/fips_enabled
12+ if [[ -r $FIPS && $( cat $FIPS ) == " 1" ]]; then
13+ exit 0
14+ fi
15+ ;;
16+ " rsa" ) ;; # always ok
17+ " ecdsa" ) ;;
18+ * ) # wrong argument
19+ exit 12 ;;
1920esac
2021mkdir -p /var/run/state/ssh
2122KEY=/var/run/state/ssh/ssh_host_${KEYTYPE} _key
2223
2324KEYGEN=/usr/bin/ssh-keygen
2425if [[ ! -x $KEYGEN ]]; then
25- exit 13
26+ exit 13
2627fi
2728
2829# remove old keys
2930rm -f $KEY {,.pub}
3031
3132# create new keys
3233if ! $KEYGEN -q -t $KEYTYPE -f $KEY -C ' ' -N ' ' >& /dev/null; then
33- exit 1
34+ exit 1
3435fi
3536
3637# sanitize permissions
3738/usr/bin/chmod 600 $KEY
3839/usr/bin/chmod 644 $KEY .pub
3940if [[ -x /usr/sbin/restorecon ]]; then
40- /usr/sbin/restorecon $KEY {,.pub}
41+ /usr/sbin/restorecon $KEY {,.pub}
4142fi
4243
4344exit 0
You can’t perform that action at this time.
0 commit comments