summary refs log tree commit diff stats
path: root/plugins/fishlim/tests/tests.c
diff options
context:
space:
mode:
authorSimon Chopin <simon.chopin@canonical.com>2021-11-30 13:56:56 +0100
committerPatrick <tingping@tingping.se>2021-11-30 08:35:04 -0600
commitbbd60a96ecd0e190625c68bedca4e46928ee2b4d (patch)
tree13210fa25f482b13d732e4487b26fa5f00fe5aa2 /plugins/fishlim/tests/tests.c
parent8443755772160e61679e3122190da18ba10d8878 (diff)
fish: enable the legacy provider if build against OpenSSL3
OpenSSL 3.0 disables a number of "legacy" algorithms by default, and we
need to enable them manually using their provider system. Note that
explicitly loading a provider will disable the implicit default
provider, which is why we need to load it explicitly.

Closes #2629

Signed-off-by: Simon Chopin <simon.chopin@canonical.com>

V2:
  * use a local OSSL_LIB_CTX to avoid leaking the legacy algorithms
    into the main SSL context.
  * Simplify the fish_init() error paths by calling fish_deinit()
Diffstat (limited to 'plugins/fishlim/tests/tests.c')
-rw-r--r--plugins/fishlim/tests/tests.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/fishlim/tests/tests.c b/plugins/fishlim/tests/tests.c
index f3e852d2..12b10d1d 100644
--- a/plugins/fishlim/tests/tests.c
+++ b/plugins/fishlim/tests/tests.c
@@ -278,5 +278,8 @@ main(int argc, char *argv[]) {
     g_test_add_func("/fishlim/max_text_command_len", test_max_text_command_len);
     g_test_add_func("/fishlim/foreach_utf8_data_chunks", test_foreach_utf8_data_chunks);
 
-    return g_test_run();
+    fish_init();
+    int ret = g_test_run();
+    fish_deinit();
+    return ret;
 }