]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dcrypt: Skip checks if no backend found
authorAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 4 Aug 2016 16:39:56 +0000 (19:39 +0300)
committerGitLab <gitlab@git.dovecot.net>
Thu, 4 Aug 2016 17:23:38 +0000 (20:23 +0300)
src/lib-dcrypt/test-crypto.c
src/lib-dcrypt/test-stream.c

index 1eb9150e00de30c139b74225fef6ebfc13432d2b..401c38ad569bbd55784a5f5e8b9b407ca40eb791 100644 (file)
@@ -619,7 +619,10 @@ void test_load_invalid_keys(void) {
 
 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,
index 2cc2d7ebebecd55791f7ab2445eb71372d8e549e..00dfe0610d4d25a502810439b7abd4eb1a45b26b 100644 (file)
@@ -424,7 +424,10 @@ void test_free_keys() {
 }
 
 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));