Commit ff4a6a21 authored by Matthieu Tanon's avatar Matthieu Tanon

Second corrections based on merge review

parent 2d533416
......@@ -104,9 +104,9 @@ struct _LinphoneAccountCreator {
LinphoneTransportType transport; /**< Transport used */
// test
int account_created;
int confirmation_key;
int account_activated;
bool_t account_created;
bool_t confirmation_key_received;
bool_t account_activated;
/* Deprecated */
char *route;
......@@ -140,14 +140,6 @@ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_create_account_linphone(LinphoneAccountCreator *creator);
/**
* Send an XML-RPC request to delete a Linphone account.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
* @donotwrap
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_delete_account_linphone(LinphoneAccountCreator *creator);
/**
* Send an XML-RPC request to activate a Linphone account with phone number.
* @param[in] creator LinphoneAccountCreator object
......@@ -169,14 +161,6 @@ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_activate_e
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_activated_linphone(LinphoneAccountCreator *creator);
/**
* Send an XML-RPC request to get the confirmation key of a Linphone account.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
* @donotwrap
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_get_confirmation_key_linphone(LinphoneAccountCreator *creator);
/**
* Send an XML-RPC request to test the existence a phone number with a Linphone account.
* @param[in] creator LinphoneAccountCreator object
......
......@@ -144,7 +144,10 @@ static void linphone_proxy_config_init(LinphoneCore* lc, LinphoneProxyConfig *cf
cfg->avpf_rr_interval = lc ? !!lp_config_get_default_int(lc->config, "proxy", "avpf_rr_interval", 5) : 5;
cfg->publish_expires= lc ? lp_config_get_default_int(lc->config, "proxy", "publish_expires", -1) : -1;
cfg->publish = lc ? !!lp_config_get_default_int(lc->config, "proxy", "publish", FALSE) : FALSE;
cfg->lime_x3dh = lc ? !!lp_config_get_int(lc->config, "lime", "lime_v2", FALSE) : FALSE;
cfg->lime_x3dh = lc ? !!lp_config_get_int(lc->config, "lime", "lime_x3dh", FALSE) : FALSE;
if (!cfg->lime_x3dh) {
cfg->lime_x3dh = lc ? !!lp_config_get_int(lc->config, "lime", "lime_v2", FALSE) : FALSE;
}
cfg->push_notification_allowed = lc ? !!lp_config_get_default_int(lc->config, "proxy", "push_notification_allowed", TRUE) : TRUE;
cfg->refkey = refkey ? ms_strdup(refkey) : NULL;
if (nat_policy_ref) {
......@@ -1042,10 +1045,6 @@ const char *linphone_proxy_config_get_contact_uri_parameters(const LinphoneProxy
return cfg->contact_uri_params;
}
bool_t linphone_proxy_config_lime_x3dh_enabled(const LinphoneProxyConfig *cfg){
return cfg->lime_x3dh;
}
void linphone_proxy_config_enable_lime_x3dh(LinphoneProxyConfig *cfg, const bool_t val){
cfg->lime_x3dh=val;
}
......@@ -1274,7 +1273,10 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore* lc
CONFIGURE_STRING_VALUE(cfg, config, key, ref_key, "refkey")
CONFIGURE_INT_VALUE(cfg, config, key, publish_expires, "publish_expires", int)
CONFIGURE_BOOL_VALUE(cfg, config, key, lime_x3dh, "lime_v2")
CONFIGURE_BOOL_VALUE(cfg, config, key, lime_x3dh, "lime_x3dh")
if (!cfg->lime_x3dh) {
CONFIGURE_BOOL_VALUE(cfg, config, key, lime_x3dh, "lime_v2")
}
nat_policy_ref = lp_config_get_string(config, key, "nat_policy_ref", NULL);
if (nat_policy_ref != NULL) {
......
......@@ -125,6 +125,76 @@ LINPHONE_PUBLIC int linphone_friend_list_get_revision(const LinphoneFriendList *
LINPHONE_PUBLIC int linphone_remote_provisioning_load_file( LinphoneCore* lc, const char* file_path);
/**
* Send an XML-RPC request to delete a Linphone account.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
* @donotwrap Exists for tests purposes only
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_delete_account_linphone(LinphoneAccountCreator *creator);
/**
* Send an XML-RPC request to get the confirmation key of a Linphone account.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
* @donotwrap Exists for tests purposes only
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_get_confirmation_key_linphone(LinphoneAccountCreator *creator);
/**
* Send a request to delete an account on server.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
* @donotwrap Exists for tests purposes only
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_delete_account(LinphoneAccountCreator *creator);
/**
* Send a request to get the account confirmation key on server.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
* @donotwrap Exists for tests purposes only
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_get_confirmation_key(LinphoneAccountCreator *creator);
/**
* Get the delete account request.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @return The current delete account request.
* @donotwrap Exists for tests purposes only
**/
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_delete_account(const LinphoneAccountCreatorCbs *cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @param[in] cb The delete account request to be used.
* @donotwrap Exists for tests purposes only
**/
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_delete_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
/**
* Get the get confirmation key request.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @return The current is account exist request.
* @donotwrap Exists for tests purposes only
**/
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_get_confirmation_key(const LinphoneAccountCreatorCbs *cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @param[in] cb The get confirmation key request to be used.
* @donotwrap Exists for tests purposes only
**/
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_get_confirmation_key(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
/**
* Deletes local LIME X3DH database
* @param[in] lc LinphoneCore object
* @donotwrap Exists for tests purposes only
**/
LINPHONE_PUBLIC void linphone_core_delete_local_encryption_db(const LinphoneCore *lc);
#ifndef __cplusplus
LINPHONE_PUBLIC Sal *linphone_core_get_sal(const LinphoneCore *lc);
......
......@@ -423,11 +423,12 @@ void linphone_xml_rpc_session_send_request(LinphoneXmlRpcSession *session, Linph
LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(session->core);
if (cfg) {
const char *addr = linphone_address_as_string_uri_only(linphone_proxy_config_get_identity_address(cfg));
char *addr = linphone_address_as_string_uri_only(linphone_proxy_config_get_identity_address(cfg));
req = belle_http_request_create("POST", uri,
belle_sip_header_content_type_create("text", "xml"),
belle_http_header_create("From", addr),
NULL);
bctbx_free(addr);
} else {
req = belle_http_request_create("POST", uri,
belle_sip_header_content_type_create("text", "xml"),
......
......@@ -69,14 +69,6 @@ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_create_account(LinphoneAccountCreator *creator);
/**
* Send a request to delete an account on server.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
* @donotwrap This is a security breach, exists for tests purposes only
**/
LinphoneAccountCreatorStatus linphone_account_creator_delete_account(LinphoneAccountCreator *creator);
/**
* Send a request to know if an account is activated on server.
* @param[in] creator #LinphoneAccountCreator object
......@@ -84,14 +76,6 @@ LinphoneAccountCreatorStatus linphone_account_creator_delete_account(LinphoneAcc
**/
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_activated(LinphoneAccountCreator *creator);
/**
* Send a request to get the account confirmation key on server.
* @param[in] creator LinphoneAccountCreator object
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
* @donotwrap This is a security breach, exists for tests purposes only
**/
LinphoneAccountCreatorStatus linphone_account_creator_get_confirmation_key(LinphoneAccountCreator *creator);
/**
* Send a request to activate an account on server.
* @param[in] creator #LinphoneAccountCreator object
......@@ -409,22 +393,6 @@ LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_g
**/
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_create_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
/**
* Get the delete account request.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @return The current delete account request.
* @donotwrap This is a security breach, exists for tests purposes only
**/
LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_delete_account(const LinphoneAccountCreatorCbs *cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @param[in] cb The delete account request to be used.
* @donotwrap This is a security breach, exists for tests purposes only
**/
void linphone_account_creator_cbs_set_delete_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
/**
* Get the is account exist request.
* @param[in] cbs #LinphoneAccountCreatorCbs object.
......@@ -439,22 +407,6 @@ LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_g
**/
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_account_exist(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
/**
* Get the get confirmation key request.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @return The current is account exist request.
* @donotwrap This is a security breach, exists for tests purposes only
**/
LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_get_confirmation_key(const LinphoneAccountCreatorCbs *cbs);
/**
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
* @param[in] cbs LinphoneAccountCreatorCbs object.
* @param[in] cb The get confirmation key request to be used.
* @donotwrap This is a security breach, exists for tests purposes only
**/
void linphone_account_creator_cbs_set_get_confirmation_key(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
/**
* Get the activate account request.
* @param[in] cbs #LinphoneAccountCreatorCbs object.
......
......@@ -1539,7 +1539,7 @@ LINPHONE_PUBLIC bool_t linphone_core_lime_available(const LinphoneCore *lc);
* Tells to LinphoneCore to use LIME X3DH
* @param[in] lc LinphoneCore object
* @param[in] enable A boolean value telling whether to enable or disable LIME X3DH
* @ingroup network_parameters
* @ingroup misc
*/
LINPHONE_PUBLIC void linphone_core_enable_lime_x3dh(LinphoneCore *lc, bool_t enable);
......@@ -1547,24 +1547,17 @@ LINPHONE_PUBLIC void linphone_core_enable_lime_x3dh(LinphoneCore *lc, bool_t ena
* Tells wether LIME X3DH is enabled or not
* @param[in] lc LinphoneCore object
* @return The current lime state
* @ingroup network_parameters
* @ingroup misc
**/
LINPHONE_PUBLIC bool_t linphone_core_lime_x3dh_enabled(const LinphoneCore *lc);
/**
* Tells if LIME X3DH is available
* @param[in] lc LinphoneCore object
* @ingroup network_parameters
* @ingroup misc
**/
LINPHONE_PUBLIC bool_t linphone_core_lime_x3dh_available(const LinphoneCore *lc);
/**
* Deletes local LIME X3DH database
* @param[in] lc LinphoneCore object
* @ingroup network_parameters
**/
LINPHONE_PUBLIC void linphone_core_delete_local_lime_x3dh_db(const LinphoneCore *lc);
/**
* Tells whether IPv6 is enabled or not.
* @param[in] lc #LinphoneCore object
......
......@@ -365,11 +365,6 @@ LINPHONE_PUBLIC void linphone_proxy_config_set_contact_uri_parameters(LinphonePr
**/
LINPHONE_PUBLIC const char* linphone_proxy_config_get_contact_uri_parameters(const LinphoneProxyConfig *cfg);
/**
* @return TRUE if LIME X3DH is enabled.
**/
LINPHONE_PUBLIC bool_t linphone_proxy_config_lime_x3dh_enabled(const LinphoneProxyConfig *cfg);
/**
* @param[in] cfg #LinphoneProxyConfig object.
* @param val if TRUE LIME X3DH will be enabled for this proxy config
......
......@@ -51,9 +51,6 @@ static void _linphone_core_destructor (LinphoneCore *lc) {
}
void linphone_core_set_im_encryption_engine (LinphoneCore *lc, LinphoneImEncryptionEngine *imee) {
auto core = L_GET_CPP_PTR_FROM_C_OBJECT(lc);
core->setEncryptionEngine(new LimeLegacyEncryptionEngine(core));
if (lc->im_encryption_engine) {
linphone_im_encryption_engine_unref(lc->im_encryption_engine);
lc->im_encryption_engine = NULL;
......@@ -77,10 +74,8 @@ bool_t linphone_core_lime_x3dh_available (const LinphoneCore *lc) {
return L_GET_CPP_PTR_FROM_C_OBJECT(lc)->limeX3dhAvailable();
}
void linphone_core_delete_local_lime_x3dh_db (const LinphoneCore *lc) {
if (L_GET_CPP_PTR_FROM_C_OBJECT(lc)->limeX3dhEnabled()) {
L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getEncryptionEngine()->cleanDb();
} else {
lWarning() << "Trying to clean local LIME X3DH databases but LIME X3DH is disabled";
}
void linphone_core_delete_local_encryption_db (const LinphoneCore *lc) {
auto encryptionEngine = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getEncryptionEngine();
if (encryptionEngine)
encryptionEngine->cleanDb();
}
......@@ -43,8 +43,8 @@
F(MagicSearch, MagicSearch) \
F(MediaSessionParams, CallParams) \
F(Participant, Participant) \
F(ParticipantImdnState, ParticipantImdnState) \
F(ParticipantDevice, ParticipantDevice) \
F(ParticipantImdnState, ParticipantImdnState) \
F(SearchResult, SearchResult)
#define L_REGISTER_SUBTYPES(F) \
......
......@@ -135,8 +135,8 @@ public:
void enableSenderAuthentication (bool value) { senderAuthenticationEnabled = value; }
void setAuthorizationWarning (bool value) { authorizationWarning = value; } // TODO find better name
bool getAuthorizationWarning () { return authorizationWarning; } // TODO find better name
void setUnencryptedContentWarning (bool value) { unencryptedContentWarning = value; }
bool getUnencryptedContentWarning () { return unencryptedContentWarning; }
// -----------------------------------------------------------------------------
// Deprecated methods only used for C wrapper, to be removed some day...
......@@ -225,7 +225,7 @@ private:
IdentityAddress fromAddress;
IdentityAddress authenticatedFromAddress;
bool senderAuthenticationEnabled = true;
bool authorizationWarning = false; // TODO find a better name
bool unencryptedContentWarning = false;
IdentityAddress toAddress;
ChatMessage::State state = ChatMessage::State::Idle;
......
......@@ -557,10 +557,9 @@ LinphoneReason ChatMessagePrivate::receive () {
currentRecvStep |= ChatMessagePrivate::Step::Cpim;
}
// Message Authorization
if (getAuthorizationWarning()) {
lWarning() << "Message authorization warning raised by encryption engine";
// Check if incoming message was flagged as unencrypted in an encrypted context
if (getUnencryptedContentWarning()) {
lWarning() << "Unencrypted content warning raised by encryption engine";
// Allow error IMDN exclusively
if (q->getSharedFromThis()->getInternalContent().getContentType() != ContentType::Imdn && !Imdn::isError(q->getSharedFromThis())) {
......
......@@ -21,7 +21,6 @@
#define _L_CLIENT_GROUP_CHAT_ROOM_P_H_
#include "chat/chat-room/chat-room-p.h"
#include "chat/encryption/encryption-engine.h"
#include "client-group-chat-room.h"
#include "utils/background-task.h"
......
......@@ -271,6 +271,13 @@ ChatMessageModifier::Result LimeX3DHEncryptionEngine::processOutgoingMessage (
Content finalContent = ContentManager::contentListToMultipart(contents, MultipartBoundary, true);
// Insert protocol param before boundary for flexisip
ContentType contentType(finalContent.getContentType());
contentType.removeParameter("boundary");
contentType.addParameter("protocol", "\"application/lime\"");
contentType.addParameter("boundary", MultipartBoundary);
finalContent.setContentType(contentType);
message->setInternalContent(finalContent);
message->getPrivate()->send(); // seems to leak when called for the second time
*result = ChatMessageModifier::Result::Done;
......@@ -316,8 +323,8 @@ ChatMessageModifier::Result LimeX3DHEncryptionEngine::processIncomingMessage (
if (incomingContentType != expectedContentType) {
lError() << "LIMEv2 unexpected content-type: " << incomingContentType;
// Set authorization warning flag because incoming message type is unexpected
message->getPrivate()->setAuthorizationWarning(true);
// Set unencrypted content warning flag because incoming message type is unexpected
message->getPrivate()->setUnencryptedContentWarning(true);
// Disable sender authentication otherwise the unexpected message will always be discarded
message->getPrivate()->enableSenderAuthentication(false);
return ChatMessageModifier::Result::Skipped;
......
......@@ -76,8 +76,6 @@ Content ContentManager::contentListToMultipart (const list<Content *> &contents,
SalBodyHandler *sbh = (SalBodyHandler *)mpbh;
sal_body_handler_set_type(sbh, ContentType::Multipart.getType().c_str());
sal_body_handler_set_subtype(sbh, encrypted ? ContentType::Encrypted.getSubType().c_str() : ContentType::Multipart.getSubType().c_str());
if (encrypted)
sal_body_handler_set_content_type_parameter(sbh, "protocol", "\"application/lime\"");
sal_body_handler_set_content_type_parameter(sbh, "boundary", boundary.c_str());
LinphoneContent *cContent = linphone_content_from_sal_body_handler(sbh);
......
......@@ -538,18 +538,18 @@ static void server_delete_account_test(void) {
linphone_account_creator_cbs_set_user_data(cbs, stats);
account_creator_reset_cb_done(cbs);
linphone_account_creator_service_set_user_data(
linphone_account_creator_get_service(creator),
(void*)LinphoneAccountCreatorStatusRequestOk);
linphone_account_creator_get_service(creator),
(void*)LinphoneAccountCreatorStatusRequestOk);
linphone_account_creator_set_username(creator, "XXXTESTuser_0");
linphone_account_creator_set_email(creator, "user_0@linphone.org");
linphone_account_creator_set_password(creator, "password");
linphone_account_creator_set_algorithm(creator, "SHA-256");
BC_ASSERT_EQUAL(
delete_account_cb(creator),
LinphoneAccountCreatorStatusRequestOk,
LinphoneAccountCreatorStatus,
"%i");
delete_account_cb(creator),
LinphoneAccountCreatorStatusRequestOk,
LinphoneAccountCreatorStatus,
"%i");
wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST);
......@@ -562,18 +562,19 @@ static void server_delete_account_test(void) {
linphone_account_creator_cbs_set_user_data(cbs, stats);
account_creator_reset_cb_done(cbs);
linphone_account_creator_service_set_user_data(
linphone_account_creator_get_service(creator),
(void*)LinphoneAccountCreatorStatusRequestOk);
linphone_account_creator_get_service(creator),
(void*)LinphoneAccountCreatorStatusRequestOk);
linphone_account_creator_set_email(creator, "user_5@linphone.org");
linphone_account_creator_set_password(creator, "password");
linphone_account_creator_set_phone_number(creator, "000555450","1");
linphone_account_creator_set_algorithm(creator, "SHA-256");
BC_ASSERT_EQUAL(
delete_account_cb(creator),
LinphoneAccountCreatorStatusRequestOk,
LinphoneAccountCreatorStatus,
"%i");
delete_account_cb(creator),
LinphoneAccountCreatorStatusRequestOk,
LinphoneAccountCreatorStatus,
"%i"
);
wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST);
......@@ -706,8 +707,8 @@ static void server_account_created_with_email(void) {
linphone_account_creator_cbs_set_user_data(cbs, stats);
account_creator_reset_cb_done(cbs);
linphone_account_creator_service_set_user_data(
linphone_account_creator_get_service(creator),
(void*)LinphoneAccountCreatorStatusAccountCreated);
linphone_account_creator_get_service(creator),
(void*)LinphoneAccountCreatorStatusAccountCreated);
linphone_account_creator_set_username(creator, "XXXTESTuser_0");
linphone_account_creator_set_email(creator, "user_0@linphone.org");
linphone_account_creator_set_password(creator, "password");
......@@ -715,10 +716,10 @@ static void server_account_created_with_email(void) {
linphone_account_creator_cbs_set_create_account(cbs, account_creator_cb);
BC_ASSERT_EQUAL(
linphone_account_creator_create_account(creator),
LinphoneAccountCreatorStatusRequestOk,
LinphoneAccountCreatorStatus,
"%i");
linphone_account_creator_create_account(creator),
LinphoneAccountCreatorStatusRequestOk,
LinphoneAccountCreatorStatus,
"%i");
wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST);
......@@ -785,8 +786,8 @@ static void server_account_created_with_phone_number(void) {
linphone_account_creator_cbs_set_user_data(cbs, stats);
account_creator_reset_cb_done(cbs);
linphone_account_creator_service_set_user_data(
linphone_account_creator_get_service(creator),
(void*)LinphoneAccountCreatorStatusAccountCreated);
linphone_account_creator_get_service(creator),
(void*)LinphoneAccountCreatorStatusAccountCreated);
linphone_account_creator_set_email(creator, "user_5@linphone.org");
linphone_account_creator_set_password(creator, "password");
linphone_account_creator_set_phone_number(creator, "000555450","1");
......@@ -794,10 +795,10 @@ static void server_account_created_with_phone_number(void) {
linphone_account_creator_cbs_set_create_account(cbs, account_creator_cb);
BC_ASSERT_EQUAL(
linphone_account_creator_create_account(creator),
LinphoneAccountCreatorStatusRequestOk,
LinphoneAccountCreatorStatus,
"%i");
linphone_account_creator_create_account(creator),
LinphoneAccountCreatorStatusRequestOk,
LinphoneAccountCreatorStatus,
"%i");
wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST);
ms_free(stats);
......@@ -1151,19 +1152,19 @@ static void server_activate_account_not_activated(void) {
account_creator_reset_cb_done(creator->cbs);
linphone_account_creator_service_set_user_data(
linphone_account_creator_get_service(creator),
(void*)LinphoneAccountCreatorStatusAccountActivated);
linphone_account_creator_get_service(creator),
(void*)LinphoneAccountCreatorStatusAccountActivated);
linphone_account_creator_cbs_set_activate_account(cbs, account_creator_cb);
linphone_account_creator_service_set_activate_account_cb(
linphone_account_creator_get_service(creator),
linphone_account_creator_activate_email_account_linphone);
linphone_account_creator_get_service(creator),
linphone_account_creator_activate_email_account_linphone);
BC_ASSERT_EQUAL(
linphone_account_creator_activate_account(creator),
LinphoneAccountCreatorStatusRequestOk,
LinphoneAccountCreatorStatus,
"%i");
linphone_account_creator_activate_account(creator),
LinphoneAccountCreatorStatusRequestOk,
LinphoneAccountCreatorStatus,
"%i");
wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST);
......@@ -1563,15 +1564,15 @@ static void server_activate_phone_number_for_account(void) {
account_creator_reset_cb_done(creator->cbs);
linphone_account_creator_service_set_user_data(
linphone_account_creator_get_service(creator),
(void*)LinphoneAccountCreatorStatusAccountActivated);
linphone_account_creator_get_service(creator),
(void*)LinphoneAccountCreatorStatusAccountActivated);
linphone_account_creator_cbs_set_activate_alias(cbs, account_creator_cb);
BC_ASSERT_EQUAL(
linphone_account_creator_activate_alias(creator),
LinphoneAccountCreatorStatusRequestOk,
LinphoneAccountCreatorStatus,
"%i");
linphone_account_creator_activate_alias(creator),
LinphoneAccountCreatorStatusRequestOk,
LinphoneAccountCreatorStatus,
"%i");
wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST);
......@@ -2086,15 +2087,15 @@ static void server_update_account_password_with_correct_password(void) {
linphone_account_creator_cbs_set_user_data(cbs, stats);
account_creator_reset_cb_done(cbs);
linphone_account_creator_service_set_user_data(
linphone_account_creator_get_service(creator),
(void*)LinphoneAccountCreatorStatusRequestOk);
linphone_account_creator_get_service(creator),
(void*)LinphoneAccountCreatorStatusRequestOk);
linphone_account_creator_cbs_set_update_account(cbs, account_creator_cb);
BC_ASSERT_EQUAL(
linphone_account_creator_update_account(creator),
LinphoneAccountCreatorStatusRequestOk,
LinphoneAccountCreatorStatus,
"%i");
linphone_account_creator_update_account(creator),
LinphoneAccountCreatorStatusRequestOk,
LinphoneAccountCreatorStatus,
"%i");
wait_for_until(marie->lc, NULL, &stats->cb_done, 1, TIMEOUT_REQUEST);
......
This diff is collapsed.
This diff is collapsed.
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