From 4b5072913bf8da67ac39f26fccb94c3b1a8944d8 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 30 Nov 2017 09:33:50 +0100 Subject: [PATCH] network_parse_test.c: Only test security features if libgcrypt is available. Fixes: #2583 --- src/libcollectdclient/network_parse_test.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libcollectdclient/network_parse_test.c b/src/libcollectdclient/network_parse_test.c index 9efd4bd8..07010fbd 100644 --- a/src/libcollectdclient/network_parse_test.c +++ b/src/libcollectdclient/network_parse_test.c @@ -412,6 +412,7 @@ static int test_parse_values() { return ret; } +#if HAVE_GCRYPT_H static int test_verify_sha256() { int ret = 0; @@ -441,7 +442,9 @@ static int test_verify_sha256() { return ret; } +#endif +#if HAVE_GCRYPT_H static int test_decrypt_aes256() { char const *iv_str = "4cbe2a747c9f9dcfa0e66f0c2fa74875"; uint8_t iv[16] = {0}; @@ -480,12 +483,11 @@ static int test_decrypt_aes256() { return 0; } +#endif int main(void) { int ret = 0; - printf("libcollectdclient/server_test.c\n"); - int status; if ((status = test_network_parse())) { ret = status; @@ -500,12 +502,14 @@ int main(void) { ret = status; } +#if HAVE_GCRYPT_H if ((status = test_verify_sha256())) { ret = status; } if ((status = test_decrypt_aes256())) { ret = status; } +#endif return ret; } -- 2.11.0