Commit 7da8b5b8 authored by Sylvain Berfini's avatar Sylvain Berfini 🐮
Browse files

Moved ephemeral secure group chat tests to dedicated suite

parent 55f55529
......@@ -212,6 +212,7 @@ set(SOURCE_FILES_C
flexisip_tester.c
group_chat_tester.c
group_chat_secure_tester.c
group_chat_ephemeral_tester.c
liblinphone_tester.c
log_collection_tester.c
message_tester.c
......
This diff is collapsed.
This diff is collapsed.
......@@ -324,6 +324,7 @@ void liblinphone_tester_add_suites() {
#ifdef HAVE_ADVANCED_IM
bc_tester_add_suite(&group_chat_test_suite);
bc_tester_add_suite(&secure_group_chat_test_suite);
bc_tester_add_suite(&ephemeral_group_chat_test_suite);
#endif
bc_tester_add_suite(&tunnel_test_suite);
bc_tester_add_suite(&offeranswer_test_suite);
......
......@@ -65,6 +65,7 @@ extern test_suite_t main_db_test_suite;
extern test_suite_t flexisip_test_suite;
extern test_suite_t group_chat_test_suite;
extern test_suite_t secure_group_chat_test_suite;
extern test_suite_t ephemeral_group_chat_test_suite;
extern test_suite_t log_collection_test_suite;
extern test_suite_t message_test_suite;
extern test_suite_t session_timers_test_suite;
......@@ -562,6 +563,16 @@ extern MSSndCardDesc dummy_test_snd_card_desc;
extern MSSndCardDesc dummy2_test_snd_card_desc;
#define DUMMY2_TEST_SOUNDCARD "dummy2 test sound card"
/**
* Set the requested curve and matching lime server url in the given core manager
* WARNING: uses a dirty trick: the linphone_core_set_lime_x3dh_server_url will actually restart
* the encryption engine (only if the given url is different than the current one). It will thus parse
* again the curve setting that is changed BEFORE.
*/
void set_lime_curve(const int curveId, LinphoneCoreManager *manager);
void set_lime_curve_list(const int curveId, bctbx_list_t *managerList);
#ifdef __cplusplus
};
#endif
......
......@@ -2396,3 +2396,24 @@ static MSSndCard* create_dummy2_test_snd_card(void) {
static void dummy2_test_snd_card_detect(MSSndCardManager *m) {
ms_snd_card_manager_prepend_card(m, create_dummy2_test_snd_card());
}
void set_lime_curve(const int curveId, LinphoneCoreManager *manager) {
if (curveId == 448) {
// Change the curve setting before the server URL
lp_config_set_string(linphone_core_get_config(manager->lc),"lime","curve","c448");
// changing the url will restart the encryption engine allowing to also use the changed curve config
linphone_core_set_lime_x3dh_server_url(manager->lc, lime_server_c448_url);
} else {
// Change the curve setting before the server URL
lp_config_set_string(linphone_core_get_config(manager->lc),"lime","curve","c25519");
// changing the url will restart the encryption engine allowing to also use the changed curve config
linphone_core_set_lime_x3dh_server_url(manager->lc, lime_server_c25519_url);
}
}
void set_lime_curve_list(const int curveId, bctbx_list_t *managerList) {
bctbx_list_t *item = managerList;
for (item = managerList; item; item = bctbx_list_next(item)) {
set_lime_curve(curveId, (LinphoneCoreManager *)(bctbx_list_get_data(item)));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment