MD5 not allowed in FIPS 140-2 mode, using SHA-1 for key fing

I’m using SLES11 SP4, wants to enable FIPS mode at OS level, here is what I have done:

  1. add fips=1 in /boot/grub/menu.lst
  2. remove openssh-openssl1 in my OS
  3. install latest packages:
    openssh-fips-6.6p1-36.15.1
    openssh-6.6p1-36.15.1
    libopenssl0_9_8-hmac-0.9.8j-0.106.18.1
    4.reboot

at this point, I can successfully SSH into my server, however, when I met following issues:

  1. cmd> ssh -vvv localhost date 2>&1

I got following error :MD5 not allowed in FIPS 140-2 mode, using SHA-1 for key fing. Here are the details:

OpenSSH_6.6.1, OpenSSL 0.9.8j-fips 07 Jan 2009
debug1: Reading configuration data /home/admin/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 25: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load “/home/admin/.ssh/id_rsa” as a RSA1 public key
debug1: identity file /home/admin/.ssh/id_rsa type -1
debug1: identity file /home/admin/.ssh/id_rsa-cert type -1
debug1: identity file /home/admin/.ssh/id_dsa type -1
debug1: identity file /home/admin/.ssh/id_dsa-cert type -1
debug1: identity file /home/admin/.ssh/id_ecdsa type -1
debug1: identity file /home/admin/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/admin/.ssh/id_ed25519 type -1
debug1: identity file /home/admin/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host “localhost” from file “/home/admin/.ssh/known_hosts”
debug3: load_hostkeys: found key type ECDSA in file /home/admin/.ssh/known_hosts:3
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
debug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-ed25519,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-sha1-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1,hmac-sha2-256,hmac-sha2-512,
debug2: kex_parse_kexinit: hmac-sha1-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1,hmac-sha2-256,hmac-sha2-512,
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-sha1-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1,hmac-sha2-256,hmac-sha2-512,
debug2: kex_parse_kexinit: hmac-sha1-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1,hmac-sha2-256,hmac-sha2-512,
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: setup hmac-sha1-etm@openssh.com
debug1: kex: server->client aes128-ctr hmac-sha1-etm@openssh.com none
debug2: mac_setup: setup hmac-sha1-etm@openssh.com
debug1: kex: client->server aes128-ctr hmac-sha1-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
[COLOR="#FF0000"]debug1: MD5 not allowed in FIPS 140-2 mode, using SHA-1 for key fingerprints instead.[/COLOR]

  1. cmd> ssh-agent bash
    cmd> ssh-add /home/admin/.ssh/admin_key
    cmd> ssh-add -l

I got error: [COLOR="#FF0000"]key_fingerprint_raw: digest_memory failed[/COLOR]

I believe the 2 issues are caused by MD5 was used for hash the key, but I don’t know how to config ssh to use SHA1…
My questions is how do I solve this issue? Thanks!

1.) You should configure your SSH-Server (sshd) and SSH-Client for a secure operation. Please read:
https://forums.suse.com/showthread.php?12955-How-to-secure-ssh-accessible-from-the-internet&p=55830#post55830

BSI TR-02102-4:
https://www.bsi.bund.de/EN/Publications/TechnicalGuidelines/tr02102/tr02102_node.html

[CODE]# man sshd_config

man ssh_config[/CODE]

and chaptre 14 in “Security Guide”.
https://www.suse.com/documentation/

2.) Check the FIPS certificate:
https://forums.suse.com/showthread.php?13161-systemd-gets-stuck-with-FIPS-enabled&p=56436#post56436

and read careful the instruction in chapter “Guidance” of each “FIPS 140-2 Security Policy”:
https://forums.suse.com/showthread.php?12171-Loading-graphical-environment-is-slow-when-FIPS-is-enabled&p=52864#post52864

3.) Prepare key fingerprints correct:
=> add this to /etc/ssh/sshd_config and /etc/ssh/ssh_config:

FingerprintHash sha256=> see manual pages sshd_config and ssh_config for more information.

[CODE]# more ~/.ssh/known_hosts

rm ~/.ssh/known_hosts[/CODE]

I tried the setting as mentioned, all these settings are not valid for SLES11 SP4. Some settings are for SLES12.

here, I’m using sles11sp4: sshd version OpenSSH_6.6.1, OpenSSL 0.9.8j-fips 07 Jan 2009.

I can use SSH to login my server with fips=1 enabled, but the issue is: the ssh-add doesn’t work!

cmd> ssh-agent bash
cmd> ssh-add /home/admin/.ssh/admin_key
cmd> ssh-add -l
cmd> [COLOR="#FF0000"]error: key_fingerprint_raw: digest_memory failed[/COLOR]

Anybody know the root caused? Many thanks!

Again and in clear text:

OpenSSH under SLES11 is not FIPS 140-validated!
There is no FIPS 140-certificate for SLES11 AND OpenSSH available!
For OpenSSH in FIPS mode, you have to upgrade to SLES12!

=> You waste time with your ssh-add issue…