[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

Maximilian 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(-)

Comments

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

Patch

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)
     assert_string_equal(mutate_ncp_cipher_list("id-aes128-GCM:id-aes256-GCM",
                                                &gc), "AES-128-GCM:AES-256-GCM");
 #else
-    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");
+    }
 #endif
     gc_free(&gc);
 }