summaryrefslogtreecommitdiffstats
path: root/regress
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2014-07-22 20:27:50 +0200
committerDarren Tucker <dtucker@zip.com.au>2014-07-22 20:27:50 +0200
commitc4ee219a66f3190fa96cbd45b4d11015685c6306 (patch)
tree33e57c46d9f324bfb7e10a8ff711d1868eaf3967 /regress
parent - (djm) [regress/multiplex.sh] change the test for still-open Unix (diff)
downloadopenssh-c4ee219a66f3190fa96cbd45b4d11015685c6306.tar.xz
openssh-c4ee219a66f3190fa96cbd45b4d11015685c6306.zip
- (dtucker) [regress/unittests/sshkey/test_{file,fuzz,sshkey}.c] Wrap ecdsa-
specific tests inside OPENSSL_HAS_ECC.
Diffstat (limited to 'regress')
-rw-r--r--regress/unittests/sshkey/test_file.c2
-rw-r--r--regress/unittests/sshkey/test_fuzz.c6
-rw-r--r--regress/unittests/sshkey/test_sshkey.c10
3 files changed, 18 insertions, 0 deletions
diff --git a/regress/unittests/sshkey/test_file.c b/regress/unittests/sshkey/test_file.c
index de3ae38c1..d113e2da8 100644
--- a/regress/unittests/sshkey/test_file.c
+++ b/regress/unittests/sshkey/test_file.c
@@ -283,6 +283,7 @@ sshkey_file_tests(void)
sshkey_free(k1);
+#ifdef OPENSSL_HAS_ECC
TEST_START("parse ECDSA from private");
buf = load_file("ecdsa_1");
ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, "", "ecdsa_1",
@@ -381,6 +382,7 @@ sshkey_file_tests(void)
TEST_DONE();
sshkey_free(k1);
+#endif /* OPENSSL_HAS_ECC */
TEST_START("parse Ed25519 from private");
buf = load_file("ed25519_1");
diff --git a/regress/unittests/sshkey/test_fuzz.c b/regress/unittests/sshkey/test_fuzz.c
index 163e65512..f9da086a4 100644
--- a/regress/unittests/sshkey/test_fuzz.c
+++ b/regress/unittests/sshkey/test_fuzz.c
@@ -231,6 +231,7 @@ sshkey_fuzz_tests(void)
fuzz_cleanup(fuzz);
TEST_DONE();
+#ifdef OPENSSL_HAS_ECC
TEST_START("fuzz ECDSA private");
buf = load_file("ecdsa_1");
fuzz = fuzz_begin(FUZZ_BASE64, sshbuf_mutable_ptr(buf),
@@ -274,6 +275,7 @@ sshkey_fuzz_tests(void)
sshbuf_free(fuzzed);
fuzz_cleanup(fuzz);
TEST_DONE();
+#endif
TEST_START("fuzz Ed25519 private");
buf = load_file("ed25519_1");
@@ -327,6 +329,7 @@ sshkey_fuzz_tests(void)
sshkey_free(k1);
TEST_DONE();
+#ifdef OPENSSL_HAS_ECC
TEST_START("fuzz ECDSA public");
buf = load_file("ecdsa_1");
ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, "", "key",
@@ -341,6 +344,7 @@ sshkey_fuzz_tests(void)
public_fuzz(k1);
sshkey_free(k1);
TEST_DONE();
+#endif
TEST_START("fuzz Ed25519 public");
buf = load_file("ed25519_1");
@@ -375,6 +379,7 @@ sshkey_fuzz_tests(void)
sshkey_free(k1);
TEST_DONE();
+#ifdef OPENSSL_HAS_ECC
TEST_START("fuzz ECDSA sig");
buf = load_file("ecdsa_1");
ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, "", "key",
@@ -383,6 +388,7 @@ sshkey_fuzz_tests(void)
sig_fuzz(k1);
sshkey_free(k1);
TEST_DONE();
+#endif
TEST_START("fuzz Ed25519 sig");
buf = load_file("ed25519_1");
diff --git a/regress/unittests/sshkey/test_sshkey.c b/regress/unittests/sshkey/test_sshkey.c
index 03dfdba12..292303063 100644
--- a/regress/unittests/sshkey/test_sshkey.c
+++ b/regress/unittests/sshkey/test_sshkey.c
@@ -215,6 +215,7 @@ sshkey_tests(void)
ASSERT_PTR_NE(kd->dsa->priv_key, NULL);
TEST_DONE();
+#ifdef OPENSSL_HAS_ECC
TEST_START("generate KEY_ECDSA");
ASSERT_INT_EQ(sshkey_generate(KEY_ECDSA, 256, &ke), 0);
ASSERT_PTR_NE(ke, NULL);
@@ -222,6 +223,7 @@ sshkey_tests(void)
ASSERT_PTR_NE(EC_KEY_get0_public_key(ke->ecdsa), NULL);
ASSERT_PTR_NE(EC_KEY_get0_private_key(ke->ecdsa), NULL);
TEST_DONE();
+#endif
TEST_START("generate KEY_ED25519");
ASSERT_INT_EQ(sshkey_generate(KEY_ED25519, 256, &kf), 0);
@@ -262,6 +264,7 @@ sshkey_tests(void)
sshkey_free(k1);
TEST_DONE();
+#ifdef OPENSSL_HAS_ECC
TEST_START("demote KEY_ECDSA");
ASSERT_INT_EQ(sshkey_demote(ke, &k1), 0);
ASSERT_PTR_NE(k1, NULL);
@@ -277,6 +280,7 @@ sshkey_tests(void)
ASSERT_INT_EQ(sshkey_equal(ke, k1), 1);
sshkey_free(k1);
TEST_DONE();
+#endif
TEST_START("demote KEY_ED25519");
ASSERT_INT_EQ(sshkey_demote(kf, &k1), 0);
@@ -294,9 +298,11 @@ sshkey_tests(void)
TEST_START("equal mismatched key types");
ASSERT_INT_EQ(sshkey_equal(kd, kr), 0);
+#ifdef OPENSSL_HAS_ECC
ASSERT_INT_EQ(sshkey_equal(kd, ke), 0);
ASSERT_INT_EQ(sshkey_equal(kr, ke), 0);
ASSERT_INT_EQ(sshkey_equal(ke, kf), 0);
+#endif
ASSERT_INT_EQ(sshkey_equal(kd, kf), 0);
TEST_DONE();
@@ -307,9 +313,11 @@ sshkey_tests(void)
ASSERT_INT_EQ(sshkey_generate(KEY_DSA, 1024, &k1), 0);
ASSERT_INT_EQ(sshkey_equal(kd, k1), 0);
sshkey_free(k1);
+#ifdef OPENSSL_HAS_ECC
ASSERT_INT_EQ(sshkey_generate(KEY_ECDSA, 256, &k1), 0);
ASSERT_INT_EQ(sshkey_equal(ke, k1), 0);
sshkey_free(k1);
+#endif
ASSERT_INT_EQ(sshkey_generate(KEY_ED25519, 256, &k1), 0);
ASSERT_INT_EQ(sshkey_equal(kf, k1), 0);
sshkey_free(k1);
@@ -317,7 +325,9 @@ sshkey_tests(void)
sshkey_free(kr);
sshkey_free(kd);
+#ifdef OPENSSL_HAS_ECC
sshkey_free(ke);
+#endif
sshkey_free(kf);
/* XXX certify test */