changeset 20576:6e584af6f758

lib-dcrypt: Skip checks if no backend found
author Aki Tuomi <aki.tuomi@dovecot.fi>
date Thu, 04 Aug 2016 19:39:56 +0300
parents bceac5d8ae3b
children 2d3c5cc2bdab
files src/lib-dcrypt/test-crypto.c src/lib-dcrypt/test-stream.c
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-dcrypt/test-crypto.c	Tue Aug 02 22:31:50 2016 +0300
+++ b/src/lib-dcrypt/test-crypto.c	Thu Aug 04 19:39:56 2016 +0300
@@ -619,7 +619,10 @@
 
 int main(void) {
 	random_init();
-	dcrypt_initialize("openssl", NULL, NULL);
+	if (!dcrypt_initialize(NULL, NULL, NULL)) {
+		i_error("No functional dcrypt backend found - skipping tests");
+		return 0;
+	}
 
 	static void (*test_functions[])(void) = {
 		test_cipher_test_vectors,
--- a/src/lib-dcrypt/test-stream.c	Tue Aug 02 22:31:50 2016 +0300
+++ b/src/lib-dcrypt/test-stream.c	Thu Aug 04 19:39:56 2016 +0300
@@ -424,7 +424,10 @@
 }
 
 int main(void) {
-	dcrypt_initialize("openssl", NULL, NULL);
+	if (!dcrypt_initialize(NULL, NULL, NULL)) {
+		i_error("No functional dcrypt backend found - skipping tests");
+		return 0;
+	}
 	random_init();
 
 	test_assert(dcrypt_key_load_private(&test_v1_kp.priv, key_v1_priv, NULL, NULL, NULL));