Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit c5e6da6

Browse files
committed
chore: tidy
1 parent c2e39cd commit c5e6da6

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

image/sysroot-tree/usr/libexec/openssh/sshd-keygen

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,39 @@ set -x
66
# Create the host keys for the OpenSSH server.
77
KEYTYPE=$1
88
case $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 ;;
1920
esac
2021
mkdir -p /var/run/state/ssh
2122
KEY=/var/run/state/ssh/ssh_host_${KEYTYPE}_key
2223

2324
KEYGEN=/usr/bin/ssh-keygen
2425
if [[ ! -x $KEYGEN ]]; then
25-
exit 13
26+
exit 13
2627
fi
2728

2829
# remove old keys
2930
rm -f $KEY{,.pub}
3031

3132
# create new keys
3233
if ! $KEYGEN -q -t $KEYTYPE -f $KEY -C '' -N '' >&/dev/null; then
33-
exit 1
34+
exit 1
3435
fi
3536

3637
# sanitize permissions
3738
/usr/bin/chmod 600 $KEY
3839
/usr/bin/chmod 644 $KEY.pub
3940
if [[ -x /usr/sbin/restorecon ]]; then
40-
/usr/sbin/restorecon $KEY{,.pub}
41+
/usr/sbin/restorecon $KEY{,.pub}
4142
fi
4243

4344
exit 0

0 commit comments

Comments
 (0)