Skip OpenSSL specific tests w/out OpenSSL.

Allows unit tests to pass when configure'ed --without-openssl.
This commit is contained in:
Darren Tucker 2020-06-19 18:38:39 +10:00
parent 80610e97a7
commit e684b1ea36
2 changed files with 10 additions and 0 deletions

View File

@ -422,6 +422,7 @@ sshkey_file_tests(void)
sshkey_free(k1);
#if defined(WITH_OPENSSL) && defined(OPENSSL_HAS_ECC)
TEST_START("parse ECDSA-SK from private");
buf = load_file("ecdsa_sk1");
ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, "", &k1, NULL), 0);
@ -485,6 +486,7 @@ sshkey_file_tests(void)
TEST_DONE();
sshkey_free(k1);
#endif
TEST_START("parse Ed25519-SK from private");
buf = load_file("ed25519_sk1");

View File

@ -80,8 +80,10 @@ tests(void)
log_init("test_sshsig", SYSLOG_LEVEL_DEBUG3, SYSLOG_FACILITY_AUTH, 1);
#endif
#ifdef WITH_OPENSSL
OpenSSL_add_all_algorithms();
ERR_load_CRYPTO_strings();
#endif
TEST_START("load data");
msg = load_file("namespace");
@ -91,6 +93,7 @@ tests(void)
msg = load_file("signed-data");
TEST_DONE();
#ifdef WITH_OPENSSL
TEST_START("check RSA signature");
check_sig("rsa", "rsa.sig", msg, namespace);
TEST_DONE();
@ -99,17 +102,22 @@ tests(void)
check_sig("dsa", "dsa.sig", msg, namespace);
TEST_DONE();
#ifdef OPENSSL_HAS_ECC
TEST_START("check ECDSA signature");
check_sig("ecdsa", "ecdsa.sig", msg, namespace);
TEST_DONE();
#endif
#endif
TEST_START("check ED25519 signature");
check_sig("ed25519", "ed25519.sig", msg, namespace);
TEST_DONE();
#if defined(WITH_OPENSSL) && defined(OPENSSL_HAS_ECC)
TEST_START("check ECDSA-SK signature");
check_sig("ecdsa_sk", "ecdsa_sk.sig", msg, namespace);
TEST_DONE();
#endif
TEST_START("check ED25519-SK signature");
check_sig("ed25519_sk", "ed25519_sk.sig", msg, namespace);