mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
tests: Provide minimal openssl configuration file
When we use empty configuration file, some stuff go south in c10s and for example fips mode detection does not work anymore. Providing minimal configuration file avoids the issues of loading the provider too early, while keeping fips mode activation working and tests happy. It also configures the pkcs11-provider to assume the token provides FIPS approved crypto so the tests can work. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Pavol Žáčik <pzacik@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -283,7 +283,7 @@ int torture_run_tests(void)
|
|||||||
* tokens, causing unexpected failures.
|
* tokens, causing unexpected failures.
|
||||||
* Make sure this comes before ssh_init(), which initializes OpenSSL!
|
* Make sure this comes before ssh_init(), which initializes OpenSSL!
|
||||||
*/
|
*/
|
||||||
setenv("OPENSSL_CONF", "/dev/null", 1);
|
setenv("OPENSSL_CONF", SOURCEDIR "/tests/etc/openssl.cnf", 1);
|
||||||
|
|
||||||
ssh_init();
|
ssh_init();
|
||||||
torture_filter_tests(tests);
|
torture_filter_tests(tests);
|
||||||
|
|||||||
11
tests/etc/openssl.cnf
Normal file
11
tests/etc/openssl.cnf
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
openssl_conf = openssl_init
|
||||||
|
[openssl_init]
|
||||||
|
providers = provider_sect
|
||||||
|
[provider_sect]
|
||||||
|
default = default_sect
|
||||||
|
pkcs11 = pkcs11_sect
|
||||||
|
[default_sect]
|
||||||
|
activate = 1
|
||||||
|
[pkcs11_sect]
|
||||||
|
activate = 1
|
||||||
|
pkcs11-module-assume-fips = true
|
||||||
@@ -569,7 +569,7 @@ int torture_run_tests(void) {
|
|||||||
* tokens, causing unexpected failures.
|
* tokens, causing unexpected failures.
|
||||||
* Make sure this comes before ssh_init(), which initializes OpenSSL!
|
* Make sure this comes before ssh_init(), which initializes OpenSSL!
|
||||||
*/
|
*/
|
||||||
setenv("OPENSSL_CONF", "/dev/null", 1);
|
setenv("OPENSSL_CONF", SOURCEDIR "/tests/etc/openssl.cnf", 1);
|
||||||
|
|
||||||
ssh_init();
|
ssh_init();
|
||||||
ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
|
ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
|
||||||
|
|||||||
@@ -338,7 +338,7 @@ int torture_run_tests(void)
|
|||||||
* tokens, causing unexpected failures.
|
* tokens, causing unexpected failures.
|
||||||
* Make sure this comes before ssh_init(), which initializes OpenSSL!
|
* Make sure this comes before ssh_init(), which initializes OpenSSL!
|
||||||
*/
|
*/
|
||||||
setenv("OPENSSL_CONF", "/dev/null", 1);
|
setenv("OPENSSL_CONF", SOURCEDIR "/tests/etc/openssl.cnf", 1);
|
||||||
|
|
||||||
ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
|
ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
|
||||||
|
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ torture_run_tests(void)
|
|||||||
* tokens, causing unexpected failures.
|
* tokens, causing unexpected failures.
|
||||||
* Make sure this comes before ssh_init(), which initializes OpenSSL!
|
* Make sure this comes before ssh_init(), which initializes OpenSSL!
|
||||||
*/
|
*/
|
||||||
setenv("OPENSSL_CONF", "/dev/null", 1);
|
setenv("OPENSSL_CONF", SOURCEDIR "/tests/etc/openssl.cnf", 1);
|
||||||
|
|
||||||
ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
|
ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user