In migrating my OpenSSL 1.0.2 FIPS app to OpenSSL 3.0.1, I am having difficulty in loading the FIPS module. I am following closely the "Programmatically loading the FIPS module (default library context)" section of the fips module guide doc.
With the following changes, FIPS module failed to load. In fact, OSSL_PROVIDER_available(NULL, "fips") returns 0.
Can someone please review my changes and see what might still be missing?
Config/Installation changes:
enable-fips, --api=1.1.1, and --libdir=lib were added to config (latter 2 for app compat)
- After build & install,
openssl-3.0.1/providers/fips.so, openssl-3.0.1/providers/fipsmodule.cnf and openssl-3.0.1/apps/openssl.cnf were copied from the build VM to the app VM.
App changes:
- Edited the
openssl.cnf to have the settings described in the fips module guide.
- Pointed app to the openssl config location:
OPENSSL_config("/opt/uno/etc/openssl.cnf")
- Added the following loading code:
const char* default_search_path = "/opt/uno/lib/crypto";
OSSL_PROVIDER_set_default_search_path(NULL, default_search_path);
if (!OSSL_PROVIDER_available(NULL, "fips")) {
SvcLog(LEVEL_ERROR, "FIPS provider not available");
return false;
}
fips = OSSL_PROVIDER_load(NULL, "fips");
if (fips == NULL) {
SvcLog(LEVEL_ERROR,"Failed to load FIPS provider\n");
return false;
}
Key file locations in app:
[root@ven-rhel lib]# ls /opt/uno/lib/crypto/fips.so
/opt/uno/lib/crypto/fips.so
[root@ven-rhel etc]# ls /opt/uno/etc/openssl.cnf /opt/uno/etc/fipsmodule.cnf
/opt/uno/etc/fipsmodule.cnf /opt/uno/etc/openssl.cnf
Selected content from openssl.cnf
openssl_conf = openssl_init
.include fipsmodule.cnf
[openssl_init]
providers = provider_sect
[provider_sect]
fips = fips_sect
base = base_sect
[base_sect]
activate = 1
fipsmodule.cnf content
[root@ven-rhel etc]# cat fipsmodule.cnf
[fips_sect]
# activate = 1
conditional-errors = 1
security-checks = 1
module-mac = 67:48:52:5C:46:50:3C:D9:FD:73:DD:77:C0:51:DB:1C:32:48:8D:73:DA:CF:55:B6:38:C9:40:C1:54:7B:B6:D1
In migrating my OpenSSL 1.0.2 FIPS app to OpenSSL 3.0.1, I am having difficulty in loading the FIPS module. I am following closely the "Programmatically loading the FIPS module (default library context)" section of the fips module guide doc.
With the following changes, FIPS module failed to load. In fact,
OSSL_PROVIDER_available(NULL, "fips")returns 0.Can someone please review my changes and see what might still be missing?
Config/Installation changes:
enable-fips,--api=1.1.1, and--libdir=libwere added toconfig(latter 2 for app compat)openssl-3.0.1/providers/fips.so,openssl-3.0.1/providers/fipsmodule.cnfandopenssl-3.0.1/apps/openssl.cnfwere copied from the build VM to the app VM.App changes:
openssl.cnfto have the settings described in the fips module guide.OPENSSL_config("/opt/uno/etc/openssl.cnf")Key file locations in app:
Selected content from openssl.cnf
fipsmodule.cnf content