Commit 412151cf authored by jehan's avatar jehan Committed by Simon Morlat

modify testers to use new lime server package

parent 62dd309d
......@@ -813,28 +813,32 @@ void LimeX3dhEncryptionEngine::onRegistrationStateChanged (
if (contactAddress)
ms_free(contactAddress);
stringstream operation;
operation << "create user " << localDeviceId;
lime::limeCallback callback = setLimeCallback(operation.str());
LinphoneConfig *lpconfig = linphone_core_get_config(linphone_proxy_config_get_core(cfg));
lastLimeUpdate = linphone_config_get_int(lpconfig, "lime", "last_update_time", -1);
try {
// create user if not exist
limeManager->create_user(localDeviceId, x3dhServerUrl, curve, callback);
if (!limeManager->is_user(localDeviceId)) {
// create user if not exist
lime::limeCallback callback = setLimeCallback("creating user" + localDeviceId);
limeManager->create_user(localDeviceId, x3dhServerUrl, curve, callback);
} else {
limeManager->set_x3dhServerUrl(localDeviceId,x3dhServerUrl);
// update keys if necessary
int limeUpdateThreshold = lp_config_get_int(lpconfig, "lime", "lime_update_threshold", 86400); // 24 hours = 86400 s
if (ms_time(NULL) - lastLimeUpdate > limeUpdateThreshold) {
update();
lastLimeUpdate = ms_time(NULL);
}
}
lastLimeUpdate = ms_time(NULL);
lp_config_set_int(lpconfig, "lime", "last_update_time", (int)lastLimeUpdate);
} catch (const exception &e) {
lInfo() << "LIME X3DH user already exists or the creation went wrong" << e.what();
// update keys if necessary
int limeUpdateThreshold = lp_config_get_int(lpconfig, "lime", "lime_update_threshold", 86400); // 24 hours = 86400 s
if (ms_time(NULL) - lastLimeUpdate > limeUpdateThreshold) {
update();
lastLimeUpdate = ms_time(NULL);
}
lError()<< "LIME user for id [" << localDeviceId<<"] cannot be created" << e.what();
}
}
LINPHONE_END_NAMESPACE
......@@ -278,7 +278,7 @@ void Core::enableLimeX3dh (bool enable) {
if (d->imee == nullptr) {
LinphoneConfig *lpconfig = linphone_core_get_config(getCCore());
string serverUrl = lp_config_get_string(lpconfig, "lime", "x3dh_server_url", "");
string serverUrl = lp_config_get_string(lpconfig, "lime", "lime_server_url", lp_config_get_string(lpconfig, "lime", "x3dh_server_url", ""));
if (serverUrl.empty()) {
lInfo() << "Lime X3DH server URL not set, can't enable";
//Do not enable encryption engine if url is undefined
......@@ -306,8 +306,9 @@ void Core::setX3dhServerUrl(const std::string &url) {
return;
}
LinphoneConfig *lpconfig = linphone_core_get_config(getCCore());
string prevUrl = lp_config_get_string(lpconfig, "lime", "x3dh_server_url", "");
lp_config_set_string(lpconfig, "lime", "x3dh_server_url", url.c_str());
string prevUrl = lp_config_get_string(lpconfig, "lime", "lime_server_url", lp_config_get_string(lpconfig, "lime", "x3dh_server_url", ""));
lp_config_set_string(lpconfig, "lime", "lime_server_url", url.c_str());
lp_config_clean_entry(lpconfig, "lime", "x3dh_server_url");
if (url.empty()) {
enableLimeX3dh(false);
} else if (url.compare(prevUrl)) {
......
......@@ -96,7 +96,7 @@ static void group_chat_lime_x3dh_change_server_url(void) {
participantsAddresses = bctbx_list_append(participantsAddresses, linphone_address_new(linphone_core_get_identity(pauline->lc)));
linphone_core_set_lime_x3dh_server_url(marie->lc, "http://x3dh.example.org:8082/flexisip-account-manager/x3dh-25519.php");
linphone_core_set_lime_x3dh_server_url(marie->lc, "https://lime.wildcard1.linphone.org:8443/lime-server/lime-server.php");
BC_ASSERT_TRUE(linphone_core_lime_x3dh_enabled(marie->lc)); //should be true now
......
127.0.0.1 sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org sipv4.example.org conf.example.org subscribe.example.org x3dh.example.org http-proxy.example.org
127.0.0.1 sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org sipv4.example.org conf.example.org subscribe.example.org lime.wildcard1.linphone.org http-proxy.example.org
::1 sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org
::1 lime.wildcard1.linphone.org sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org
188.165.46.90 tunnel.wildcard2.linphone.org
......
[lime]
lime_update_threshold=86400
unsafe_if_sas_refused=1
x3dh_server_url=http://x3dh.example.org:8082/flexisip-account-manager/x3dh-25519.php
lime_server_url=https://lime.wildcard1.linphone.org:8443/lime-server/lime-server.php
[sip]
sip_port=-1
......
......@@ -3,7 +3,7 @@ lime_update_threshold=86400
max_nb_device_per_participant=1000
allow_message_in_unsafe_chatroom=0
unsafe_if_sas_refused=1
x3dh_server_url=http://x3dh.example.org:8082/flexisip-account-manager/x3dh-25519.php
lime_server_url=https://lime.wildcard1.linphone.org:8443/lime-server/lime-server.php
[sip]
sip_port=-1
......
[lime]
lime_update_threshold=86400
x3dh_server_url=http://x3dh.example.org:8082/flexisip-account-manager/x3dh-25519.php
lime_server_url=https://lime.wildcard1.linphone.org:8443/lime-server/lime-server.php
[sip]
sip_port=-1
......
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://www.linphone.org/xsds/lpconfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.linphone.org/xsds/lpconfig.xsd lpconfig.xsd">
<section name="lime">
<entry name="x3dh_server_url" overwrite="true">http://sip-staging.linphone.org:8083/flexisip-account-manager/x3dh-25519.php</entry>
<entry name="lime_server_url" overwrite="true">https://lime.wildcard1.linphone.org:8443/lime-server/lime-server.php</entry>
</section>
</config>
\ No newline at end of file
</config>
......@@ -4,7 +4,7 @@ basic_to_client_group_chat_room_migration_timer=180
[lime]
lime_update_threshold=86400
x3dh_server_url=http://x3dh.example.org:8082/flexisip-account-manager/x3dh-25519.php
lime_server_url=https://lime.wildcard1.linphone.org:8443/lime-server/lime-server.php
[sip]
sip_port=-1
......
[lime]
lime_update_threshold=86400
x3dh_server_url=http://x3dh.example.org:8082/flexisip-account-manager/x3dh-25519.php
lime_server_url=https://lime.wildcard1.linphone.org:8443/lime-server/lime-server.php
[sip]
sip_port=-1
......
54.37.202.228 sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org sipv4.example.org conf.example.org subscribe.example.org x3dh.example.org http-proxy.example.org
54.37.202.228 sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org sipv4.example.org conf.example.org subscribe.example.org lime.wildcard1.linphone.org http-proxy.example.org
2001:41d0:700:789::2010 sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org
2001:41d0:700:789::2010 sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org lime.wildcard1.linphone.org
188.165.46.90 tunnel.wildcard2.linphone.org
......
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