-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Describe the bug
The output of ssh_transport:supported_algorithms() when used with FIPS-enabled OpenSSL contains algorithms that should not be supported (if I'm reading FIPS 140-3 right, which is not an easy read):
Erlang/OTP 27 [erts-15.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
Eshell V15.2.2 (press Ctrl+G to abort, type help(). for help)
1> crypto:enable_fips_mode(true).
true
2> ssh_transport:supported_algorithms().
[{kex,['ecdh-sha2-nistp521','ecdh-sha2-nistp384',
'ecdh-sha2-nistp256','diffie-hellman-group-exchange-sha256',
'diffie-hellman-group16-sha512',
'diffie-hellman-group18-sha512',
'diffie-hellman-group14-sha256',
'diffie-hellman-group14-sha1',
'diffie-hellman-group-exchange-sha1',
'diffie-hellman-group1-sha1']},
{public_key,['ecdsa-sha2-nistp521','ecdsa-sha2-nistp384',
'ecdsa-sha2-nistp256','rsa-sha2-512','rsa-sha2-256',
'ssh-rsa','ssh-dss']},
{cipher,[{client2server,['[email protected]',
'aes256-ctr','aes192-ctr','[email protected]',
'aes128-ctr','AEAD_AES_256_GCM','AEAD_AES_128_GCM',
'aes256-cbc','aes192-cbc','aes128-cbc','3des-cbc']},
{server2client,['[email protected]','aes256-ctr',
'aes192-ctr','[email protected]','aes128-ctr',
'AEAD_AES_256_GCM','AEAD_AES_128_GCM','aes256-cbc',
'aes192-cbc','aes128-cbc','3des-cbc']}]},
{mac,[{client2server,['[email protected]',
'[email protected]','hmac-sha2-512',
'hmac-sha2-256','[email protected]','hmac-sha1',
'hmac-sha1-96','AEAD_AES_256_GCM','AEAD_AES_128_GCM']},
{server2client,['[email protected]',
'[email protected]','hmac-sha2-512',
'hmac-sha2-256','[email protected]','hmac-sha1',
'hmac-sha1-96','AEAD_AES_256_GCM','AEAD_AES_128_GCM']}]},
{compression,[{client2server,[none,'[email protected]',zlib]},
{server2client,[none,'[email protected]',zlib]}]}]
3> crypto:info_fips().
enabled
4> crypto:info_lib().
[{<<"OpenSSL">>,805306368,<<"OpenSSL 3.0.0 7 sep 2021">>}]
As one can see ssh-dss
and ssh-rsa
are present in the list as supported, although they use SHA1 which is not allowed for signature generation in FIPS 140-3 (and DSA has restriction on bitsize >= 2048 to be allowed, which is not supported by ssh-keygen
from OpenSSH). Also among ciphers there is 3DES, which is allowed only for decryption (even in 3-key mode after 2023) so practically it cannot be used by SSH (although maybe there are clients/servers that allow for asymmetrical cipher choice - I have not met one yet).
To Reproduce
Build OTP with OpenSSL3.0.0 + FIPS provider, check the supported algorithms. Note that the output of crypto:supports()
while containing SHA1, 3DES etc is technically correct as it does not assume specific usage of these algorithms.
Expected behavior
A list of supported algorithms in OTP SSH should not include those that are not allowed to be used in FIPS mode.
Affected versions
OTP27.2.2