diff options
Diffstat (limited to 'regress/unittests/sshkey/test_file.c')
-rw-r--r-- | regress/unittests/sshkey/test_file.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/regress/unittests/sshkey/test_file.c b/regress/unittests/sshkey/test_file.c index 65610dacc..55627bc12 100644 --- a/regress/unittests/sshkey/test_file.c +++ b/regress/unittests/sshkey/test_file.c | |||
@@ -19,13 +19,15 @@ | |||
19 | #include <string.h> | 19 | #include <string.h> |
20 | #include <unistd.h> | 20 | #include <unistd.h> |
21 | 21 | ||
22 | #ifdef WITH_OPENSSL | ||
22 | #include <openssl/bn.h> | 23 | #include <openssl/bn.h> |
23 | #include <openssl/rsa.h> | 24 | #include <openssl/rsa.h> |
24 | #include <openssl/dsa.h> | 25 | #include <openssl/dsa.h> |
25 | #include <openssl/objects.h> | 26 | #include <openssl/objects.h> |
26 | #ifdef OPENSSL_HAS_NISTP256 | 27 | #ifdef OPENSSL_HAS_NISTP256 |
27 | # include <openssl/ec.h> | 28 | # include <openssl/ec.h> |
28 | #endif | 29 | #endif /* OPENSSL_HAS_NISTP256 */ |
30 | #endif /* WITH_OPENSSL */ | ||
29 | 31 | ||
30 | #include "../test_helper/test_helper.h" | 32 | #include "../test_helper/test_helper.h" |
31 | 33 | ||
@@ -44,7 +46,9 @@ sshkey_file_tests(void) | |||
44 | { | 46 | { |
45 | struct sshkey *k1, *k2; | 47 | struct sshkey *k1, *k2; |
46 | struct sshbuf *buf, *pw; | 48 | struct sshbuf *buf, *pw; |
49 | #ifdef WITH_OPENSSL | ||
47 | BIGNUM *a, *b, *c; | 50 | BIGNUM *a, *b, *c; |
51 | #endif | ||
48 | char *cp; | 52 | char *cp; |
49 | 53 | ||
50 | TEST_START("load passphrase"); | 54 | TEST_START("load passphrase"); |
@@ -52,6 +56,7 @@ sshkey_file_tests(void) | |||
52 | TEST_DONE(); | 56 | TEST_DONE(); |
53 | 57 | ||
54 | 58 | ||
59 | #ifdef WITH_OPENSSL | ||
55 | TEST_START("parse RSA from private"); | 60 | TEST_START("parse RSA from private"); |
56 | buf = load_file("rsa_1"); | 61 | buf = load_file("rsa_1"); |
57 | ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, "", &k1, NULL), 0); | 62 | ASSERT_INT_EQ(sshkey_parse_private_fileblob(buf, "", &k1, NULL), 0); |
@@ -350,6 +355,7 @@ sshkey_file_tests(void) | |||
350 | 355 | ||
351 | sshkey_free(k1); | 356 | sshkey_free(k1); |
352 | #endif /* OPENSSL_HAS_ECC */ | 357 | #endif /* OPENSSL_HAS_ECC */ |
358 | #endif /* WITH_OPENSSL */ | ||
353 | 359 | ||
354 | TEST_START("parse Ed25519 from private"); | 360 | TEST_START("parse Ed25519 from private"); |
355 | buf = load_file("ed25519_1"); | 361 | buf = load_file("ed25519_1"); |