Questa pagina mostra come validare la modalità FIPS della vostra installazione OpenSSL.
$openssl = "D:\Projects\openssl-3.6.0\bin\bin\openssl.exe" # Impostare environment $env:OPENSSL_CONF = "D:\Projects\openssl-3.6.0\bin\ssl\openssl.cnf" # Elencare i provider & $openssl list -providers
Con FIPS attivo:
Providers:
base
name: OpenSSL Base Provider
version: 3.6.0
status: active
fips
name: OpenSSL FIPS Provider
version: 3.6.0
status: active
Senza FIPS:
Providers:
default
name: OpenSSL Default Provider
version: 3.6.0
status: active
In modalità FIPS sono disponibili solo algoritmi certificati.
& $openssl list -digest-algorithms
Consentiti FIPS:
Non consentiti FIPS:
& $openssl list -signature-algorithms
Consentiti FIPS:
Il provider FIPS esegue auto-test durante il caricamento:
# Modalità verbose per output auto-test $env:OPENSSL_FIPS_TEST = "1" & $openssl list -providers
In caso di auto-test falliti, il provider FIPS non viene attivato!
I moduli FIPS hanno un hash integrato per la verifica dell'integrità:
# Generare/verificare hash modulo FIPS & $openssl fipsinstall -verify -module "D:\Projects\openssl-3.6.0\bin\lib\ossl-modules\fips.dll" -in "D:\Projects\openssl-3.6.0\bin\ssl\fipsmodule.cnf"
Output atteso:
VERIFY PASSED
In caso di errore:
VERIFY FAILED
Se VERIFY FAILED: La DLL potrebbe essere stata modificata. Ricompilare!
In modalità FIPS, MD5 dovrebbe essere bloccato:
# MD5 dovrebbe fallire & $openssl dgst -md5 test.txt 2>&1
Output atteso (con FIPS):
Error setting digest xxxx:error:0308010C:digital envelope routines:inner_evp_generic_fetch:unsupported
Se MD5 funziona, FIPS non è attivo!
In C o .NET potete verificare FIPS programmaticamente:
// Esempio C# P/Invoke [DllImport("libcrypto-3-x64.dll")] private static extern int OSSL_PROVIDER_available(IntPtr libctx, string name); public static bool IsFipsAvailable() { return OSSL_PROVIDER_available(IntPtr.Zero, "fips") == 1; }
| # | Punto di Verifica | Stato |
| — | ——————- | ——- |
| 1 | enable-fips usato durante il build | ☐ |
| 2 | fips.dll presente in ossl-modules/ | ☐ |
| 3 | fipsmodule.cnf generato | ☐ |
| 4 | openssl.cnf con provider FIPS attivato | ☐ |
| 5 | openssl list -providers mostra FIPS attivo | ☐ |
| 6 | fipsinstall -verify PASSED | ☐ |
| 7 | MD5 bloccato (test) | ☐ |
enable-fips?fips.dll è presente?openssl.cnf è configurato correttamente?nmake install_fipsopenssl fipsinstall …default_properties = fips=yes manca in openssl.cnfOPENSSL_CONF non impostatoWolfgang van der Stille @ EMSR DATA d.o.o. - Post-Quantum Cryptography Professional