forked from rpms/openssh
don't create RSA1 key in FIPS mode
This commit is contained in:
parent
7294a991a2
commit
2539b1c4f2
10
sshd-keygen
10
sshd-keygen
@ -17,8 +17,16 @@ RSA1_KEY=/etc/ssh/ssh_host_key
|
|||||||
RSA_KEY=/etc/ssh/ssh_host_rsa_key
|
RSA_KEY=/etc/ssh/ssh_host_rsa_key
|
||||||
DSA_KEY=/etc/ssh/ssh_host_dsa_key
|
DSA_KEY=/etc/ssh/ssh_host_dsa_key
|
||||||
|
|
||||||
|
fips_enabled() {
|
||||||
|
if [ -r /proc/sys/crypto/fips_enabled ]; then
|
||||||
|
cat /proc/sys/crypto/fips_enabled
|
||||||
|
else
|
||||||
|
echo 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
do_rsa1_keygen() {
|
do_rsa1_keygen() {
|
||||||
if [ ! -s $RSA1_KEY ]; then
|
if [ ! -s $RSA1_KEY -a `fips_enabled` -eq 0 ]; then
|
||||||
echo -n $"Generating SSH1 RSA host key: "
|
echo -n $"Generating SSH1 RSA host key: "
|
||||||
rm -f $RSA1_KEY
|
rm -f $RSA1_KEY
|
||||||
if test ! -f $RSA1_KEY && $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then
|
if test ! -f $RSA1_KEY && $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then
|
||||||
|
Loading…
Reference in New Issue
Block a user