-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Determine whether OpenSSL needs to be configured (FIPs, SHA1 s… …ignature) #878
Conversation
@elmarco @berrange These are for now the unchanged remainders of the original profiles PR. I believe swtpm still needs to check whether FIPs mode is enabled in OpenSSL but maybe display an error message if it is and algorithms are not functioning and exit, OR allow to disable FIPS mode in the OpenSSL instance if the user passed a command line option. |
It seems there are different ways we could disable the enforcement of disabled algorithms on a host:
My current thinking is to
This is a test program:
On a FIPS-enabled FC-40 host this prints:
Per this man page here https://docs.openssl.org/3.0/man1/openssl-ciphers/#cipher-strings it seems to be necessary to test availability of the following algorithms:
Thought "fips=yes" does have some other meanings not covered via the cipherstrings. |
5024e8f
to
48ad68d
Compare
5c32a1c
to
5b13aa4
Compare
a24385a
to
9e671fd
Compare
…ignature) Get the list of enabled 'RuntimeAlgorithms' from libtpms and determine whether any of these enabled algorithms is disabled in OpenSSL due to FIPS mode. If FIPS mode on the host is enabled then disabled FIPS mode in OpenSSL so that the TPM 2 can function properly. The following algorithms are disabled when OpenSSL is in FIPS mode: - camellia - rsaes - tdes - ECC keys <224 bits - RSA keys <2048 bits Per openssl-ciphers man page it should be possible to disable the following algorithms use by cipher-suites: - AES128, AES256, AES - CAMELLIA128, CAMELLIA256, CAMELLIA - 3DES - SHA1, SHA, SHA256, SHA384 - CBC Note: It's not clear at what API level these are disabled. I have not been able to use !SHA256 to disabled SHA256. Also test whether signatures with SHA1 are working and enable them by setting OPENSSL_ENABLE_SHA1_SIGNATURES=1. The following output is expected for RHEL 9.x and CentOS 9 but does not appear on Fedora 40 since there sha1 signatures are not (yet) disabled. > swtpm socket \ --tpmstate dir=/tmp/myvtpm \ --ctrl type=tcp,port=2322 \ --server type=tcp,port=2321,disconnect \ --flags not-need-init,startup-clear \ --log level=0 \ --tpm2 \ --profile name=null Warning: Profile-enabled algorithms contain disabled 'RSA-1024-sign(SHA1, pkcs1-pss)' Warning: Setting OPENSSL_ENABLE_SHA1_SIGNATURES=1 Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
9e671fd
to
e035994
Compare
Get the list of enabled 'RuntimeAlgorithms' from libtpms and determine
whether any of these enabled algorithms is disabled in OpenSSL due to FIPS
mode. If FIPS mode on the host is enabled then disabled FIPS mode in
OpenSSL so that the TPM 2 can function properly.
The following algorithms are disabled when OpenSSL is in FIPS mode:
Per openssl-ciphers man page it should be possible to disable the following
algorithms use by cipher-suites:
WIP: It's not clear at what API level these are disabled. I have not been able
to use !SHA256 to disabled SHA256.