summaryrefslogtreecommitdiff
path: root/tests/unit_tests/openvpn
diff options
context:
space:
mode:
authorBernhard Schmidt <berni@debian.org>2020-10-28 19:46:08 +0100
committerBernhard Schmidt <berni@debian.org>2020-10-28 19:46:08 +0100
commit8231554c9f1ba25cb4e698ad5cfb3a56b258610a (patch)
tree029108888123856ca13e34c612d4dd4845c2b6c3 /tests/unit_tests/openvpn
parent5bac5f7608a14e0989e95db1a1da2e65d9322127 (diff)
parent76fee93e6fe89e5575bae2840b585d2f025b9050 (diff)
Merge tag 'debian/2.5.0-1' into buster-backports
openvpn Debian release 2.5.0-1
Diffstat (limited to 'tests/unit_tests/openvpn')
-rw-r--r--tests/unit_tests/openvpn/test_ncp.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/unit_tests/openvpn/test_ncp.c b/tests/unit_tests/openvpn/test_ncp.c
index a4334c8..4077be5 100644
--- a/tests/unit_tests/openvpn/test_ncp.c
+++ b/tests/unit_tests/openvpn/test_ncp.c
@@ -50,7 +50,9 @@ test_check_ncp_ciphers_list(void **state)
struct gc_arena gc = gc_new();
bool have_chacha = cipher_kt_get("CHACHA20-POLY1305");
-
+ assert_string_equal(mutate_ncp_cipher_list("none", &gc), "none");
+ assert_string_equal(mutate_ncp_cipher_list("AES-256-GCM:none", &gc),
+ "AES-256-GCM:none");
assert_string_equal(mutate_ncp_cipher_list(aes_ciphers, &gc), aes_ciphers);
@@ -139,7 +141,7 @@ test_poor_man(void **state)
char *best_cipher;
const char *serverlist = "CHACHA20_POLY1305:AES-128-GCM";
- const char *serverlistbfcbc = "CHACHA20_POLY1305:AES-128-GCM:BF-CBC";
+ const char *serverlistbfcbc = "CHACHA20_POLY1305:AES-128-GCM:BF-CBC:none";
best_cipher = ncp_get_best_cipher(serverlist,
"IV_YOLO=NO\nIV_BAR=7",
@@ -166,6 +168,14 @@ test_poor_man(void **state)
assert_string_equal(best_cipher, "AES-128-GCM");
+ best_cipher = ncp_get_best_cipher(serverlist, NULL,
+ "none", &gc);
+ assert_ptr_equal(best_cipher, NULL);
+
+ best_cipher = ncp_get_best_cipher(serverlistbfcbc, NULL,
+ "none", &gc);
+ assert_string_equal(best_cipher, "none");
+
best_cipher = ncp_get_best_cipher(serverlist, NULL,NULL, &gc);
assert_ptr_equal(best_cipher, NULL);