[Openvpn-devel] Don't use BF-CBC in unit tests if we don't have it

Message ID 20211208134655.28905-1-maximilian.fillinger@foxcrypto.com
State Accepted
Headers show
Series [Openvpn-devel] Don't use BF-CBC in unit tests if we don't have it | expand

Commit Message

Max Fillinger Dec. 8, 2021, 2:46 a.m. UTC
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
 tests/unit_tests/openvpn/test_ncp.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)


Gert Doering Dec. 8, 2021, 2:52 a.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

I do not have a "non blowfish" mbedtls to test with, but the fix
is "obviously correct", as discussed on IRC.

Your patch has been applied to the master + release/2.5 branch (bugfix).

commit 0e075c0e1b7b1d55a837d98b7a6c2bc8c7d65375 (master)
commit 57820e8bb1eca8e9e08df003204b8da76379b714 (release/2.5)
Author: Max Fillinger
Date:   Wed Dec 8 14:46:55 2021 +0100

     Don't use BF-CBC in unit tests if we don't have it

     Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20211208134655.28905-1-maximilian.fillinger@foxcrypto.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23354.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>

kind regards,

Gert Doering


diff --git a/tests/unit_tests/openvpn/test_ncp.c b/tests/unit_tests/openvpn/test_ncp.c
index 6702133a..f4c28ffd 100644
--- a/tests/unit_tests/openvpn/test_ncp.c
+++ b/tests/unit_tests/openvpn/test_ncp.c
@@ -120,8 +120,11 @@  test_check_ncp_ciphers_list(void **state)
                                                &gc), "AES-128-GCM:AES-256-GCM");
-    assert_string_equal(mutate_ncp_cipher_list("BLOWFISH-CBC",
-                                               &gc), "BF-CBC");
+    if (have_blowfish)
+    {
+        assert_string_equal(mutate_ncp_cipher_list("BLOWFISH-CBC",
+                                                   &gc), "BF-CBC");
+    }