Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
aa2a7a0f
Commit
aa2a7a0f
authored
Nov 04, 2019
by
Sylvain Berfini
🐮
Browse files
Added possibility to create SHA-256 accounts in tester
parent
c9f43862
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
34 additions
and
29 deletions
+34
-29
coreapi/authentication.c
coreapi/authentication.c
+13
-0
coreapi/carddav.c
coreapi/carddav.c
+2
-6
coreapi/private_functions.h
coreapi/private_functions.h
+1
-0
coreapi/remote_provisioning.c
coreapi/remote_provisioning.c
+1
-6
coreapi/xmlrpc.c
coreapi/xmlrpc.c
+1
-4
src/chat/encryption/lime-x3dh-encryption-engine.cpp
src/chat/encryption/lime-x3dh-encryption-engine.cpp
+2
-10
tester/accountmanager.c
tester/accountmanager.c
+8
-3
tester/rcfiles/marie_lime_x3dh_no_server_rc
tester/rcfiles/marie_lime_x3dh_no_server_rc
+3
-0
tester/rcfiles/marie_lime_x3dh_rc
tester/rcfiles/marie_lime_x3dh_rc
+3
-0
No files found.
coreapi/authentication.c
View file @
aa2a7a0f
...
...
@@ -270,3 +270,16 @@ void linphone_core_clear_all_auth_info(LinphoneCore *lc){
bctbx_list_free
(
lc
->
auth_info
);
lc
->
auth_info
=
NULL
;
}
void
linphone_auth_info_fill_belle_sip_event
(
const
LinphoneAuthInfo
*
auth_info
,
belle_sip_auth_event
*
event
)
{
if
(
auth_info
)
{
const
char
*
auth_username
=
linphone_auth_info_get_username
(
auth_info
);
const
char
*
auth_password
=
linphone_auth_info_get_password
(
auth_info
);
const
char
*
auth_ha1
=
linphone_auth_info_get_ha1
(
auth_info
);
const
char
*
auth_algo
=
linphone_auth_info_get_algorithm
(
auth_info
);
belle_sip_auth_event_set_username
(
event
,
auth_username
);
belle_sip_auth_event_set_passwd
(
event
,
auth_password
);
belle_sip_auth_event_set_ha1
(
event
,
auth_ha1
);
belle_sip_auth_event_set_algorithm
(
event
,
auth_algo
);
}
}
coreapi/carddav.c
View file @
aa2a7a0f
...
...
@@ -475,9 +475,7 @@ static void process_auth_requested_from_carddav_request(void *data, belle_sip_au
const
char
*
domain
=
belle_generic_uri_get_host
(
uri
);
if
(
cdc
->
auth_info
)
{
belle_sip_auth_event_set_username
(
event
,
linphone_auth_info_get_username
(
cdc
->
auth_info
));
belle_sip_auth_event_set_passwd
(
event
,
linphone_auth_info_get_passwd
(
cdc
->
auth_info
));
belle_sip_auth_event_set_ha1
(
event
,
linphone_auth_info_get_ha1
(
cdc
->
auth_info
));
linphone_auth_info_fill_belle_sip_event
(
cdc
->
auth_info
,
event
);
}
else
{
LinphoneCore
*
lc
=
cdc
->
friend_list
->
lc
;
const
bctbx_list_t
*
auth_infos
=
linphone_core_get_auth_info_list
(
lc
);
...
...
@@ -487,9 +485,7 @@ static void process_auth_requested_from_carddav_request(void *data, belle_sip_au
LinphoneAuthInfo
*
auth_info
=
(
LinphoneAuthInfo
*
)
auth_infos
->
data
;
if
(
linphone_auth_info_get_domain
(
auth_info
)
&&
strcmp
(
domain
,
linphone_auth_info_get_domain
(
auth_info
))
==
0
)
{
if
(
!
linphone_auth_info_get_realm
(
auth_info
)
||
strcmp
(
realm
,
linphone_auth_info_get_realm
(
auth_info
))
==
0
)
{
belle_sip_auth_event_set_username
(
event
,
linphone_auth_info_get_username
(
auth_info
));
belle_sip_auth_event_set_passwd
(
event
,
linphone_auth_info_get_passwd
(
auth_info
));
belle_sip_auth_event_set_ha1
(
event
,
linphone_auth_info_get_ha1
(
auth_info
));
linphone_auth_info_fill_belle_sip_event
(
auth_info
,
event
);
cdc
->
auth_info
=
linphone_auth_info_clone
(
auth_info
);
break
;
}
...
...
coreapi/private_functions.h
View file @
aa2a7a0f
...
...
@@ -127,6 +127,7 @@ void _linphone_core_uninit(LinphoneCore *lc);
void
linphone_core_write_auth_info
(
LinphoneCore
*
lc
,
LinphoneAuthInfo
*
ai
);
const
LinphoneAuthInfo
*
_linphone_core_find_tls_auth_info
(
LinphoneCore
*
lc
);
const
LinphoneAuthInfo
*
_linphone_core_find_auth_info
(
LinphoneCore
*
lc
,
const
char
*
realm
,
const
char
*
username
,
const
char
*
domain
,
bool_t
ignore_realm
);
void
linphone_auth_info_fill_belle_sip_event
(
const
LinphoneAuthInfo
*
auth_info
,
belle_sip_auth_event
*
event
);
void
linphone_core_update_proxy_register
(
LinphoneCore
*
lc
);
const
char
*
linphone_core_get_nat_address_resolved
(
LinphoneCore
*
lc
);
...
...
coreapi/remote_provisioning.c
View file @
aa2a7a0f
...
...
@@ -79,12 +79,7 @@ static void belle_request_process_auth_requested(void *ctx, belle_sip_auth_event
const
LinphoneAuthInfo
*
auth_info
=
linphone_core_find_auth_info
(
lc
,
realm
,
username
,
domain
);
if
(
auth_info
)
{
const
char
*
auth_username
=
linphone_auth_info_get_username
(
auth_info
);
const
char
*
auth_password
=
linphone_auth_info_get_password
(
auth_info
);
const
char
*
auth_ha1
=
linphone_auth_info_get_ha1
(
auth_info
);
belle_sip_auth_event_set_username
(
event
,
auth_username
);
belle_sip_auth_event_set_passwd
(
event
,
auth_password
);
belle_sip_auth_event_set_ha1
(
event
,
auth_ha1
);
linphone_auth_info_fill_belle_sip_event
(
auth_info
,
event
);
}
else
{
linphone_configuring_terminated
(
lc
,
LinphoneConfiguringFailed
,
"http auth requested"
);
}
...
...
coreapi/xmlrpc.c
View file @
aa2a7a0f
...
...
@@ -204,10 +204,7 @@ static void process_auth_requested_from_post_xml_rpc_request(void *data, belle_s
const
LinphoneAuthInfo
*
auth_info
=
linphone_core_find_auth_info
(
creator
->
core
,
realm
,
username
,
domain
);
if
(
auth_info
)
{
const
char
*
auth_username
=
linphone_auth_info_get_username
(
auth_info
);
const
char
*
auth_password
=
linphone_auth_info_get_password
(
auth_info
);
belle_sip_auth_event_set_username
(
event
,
auth_username
);
belle_sip_auth_event_set_passwd
(
event
,
auth_password
);
linphone_auth_info_fill_belle_sip_event
(
auth_info
,
event
);
}
else
{
ms_error
(
"Authentication error during XML-RPC request sending"
);
if
(
!
linphone_xml_rpc_request_aborted
(
request
)){
...
...
src/chat/encryption/lime-x3dh-encryption-engine.cpp
View file @
aa2a7a0f
...
...
@@ -76,15 +76,7 @@ void LimeManager::processAuthRequested (void *data, belle_sip_auth_event_t *even
const
char
*
domain
=
belle_sip_auth_event_get_domain
(
event
);
const
LinphoneAuthInfo
*
auth_info
=
linphone_core_find_auth_info
(
core
->
getCCore
(),
realm
,
username
,
domain
);
if
(
auth_info
)
{
const
char
*
auth_username
=
linphone_auth_info_get_username
(
auth_info
);
const
char
*
auth_password
=
linphone_auth_info_get_password
(
auth_info
);
const
char
*
auth_ha1
=
linphone_auth_info_get_ha1
(
auth_info
);
belle_sip_auth_event_set_username
(
event
,
auth_username
);
belle_sip_auth_event_set_passwd
(
event
,
auth_password
);
belle_sip_auth_event_set_ha1
(
event
,
auth_ha1
);
}
linphone_auth_info_fill_belle_sip_event
(
auth_info
,
event
);
}
LimeManager
::
LimeManager
(
...
...
@@ -841,7 +833,7 @@ void LimeX3dhEncryptionEngine::onRegistrationStateChanged (
if
(
!
limeManager
->
is_user
(
localDeviceId
))
{
// create user if not exist
lime
::
limeCallback
callback
=
setLimeCallback
(
"creating user"
+
localDeviceId
);
lime
::
limeCallback
callback
=
setLimeCallback
(
"creating user
"
+
localDeviceId
);
limeManager
->
create_user
(
localDeviceId
,
x3dhServerUrl
,
curve
,
callback
);
}
else
{
...
...
tester/accountmanager.c
View file @
aa2a7a0f
...
...
@@ -287,6 +287,8 @@ void account_create_in_db(Account *account, LinphoneProxyConfig *cfg, const char
char
*
email
=
bctbx_strdup_printf
(
"%s@%s"
,
username
,
domain
);
const
char
*
algorithm
=
linphone_config_get_string
(
linphone_core_get_config
(
linphone_proxy_config_get_core
(
cfg
)),
"assistant"
,
"algorithm"
,
NULL
);
AccountCreatorState
state
=
{
0
};
// create account
...
...
@@ -296,6 +298,7 @@ void account_create_in_db(Account *account, LinphoneProxyConfig *cfg, const char
linphone_account_creator_set_domain
(
creator
,
domain
);
linphone_account_creator_set_email
(
creator
,
email
);
linphone_account_creator_set_user_data
(
creator
,
&
state
);
linphone_account_creator_set_algorithm
(
creator
,
algorithm
);
if
(
account
->
phone_alias
)
{
LinphoneAccountCreatorPhoneNumberStatusMask
err
=
0
;
...
...
@@ -319,7 +322,7 @@ void account_create_in_db(Account *account, LinphoneProxyConfig *cfg, const char
if
(
wait_for_until
(
lc
,
NULL
,
&
state
.
account_created
,
TRUE
,
15000
)
==
FALSE
)
ms_fatal
(
"Could not create account %s on db"
,
linphone_proxy_config_get_identity
(
cfg
));
LinphoneAuthInfo
*
ai
=
linphone_auth_info_new
(
username
,
NULL
,
password
,
NULL
,
domain
,
domain
);
LinphoneAuthInfo
*
ai
=
linphone_auth_info_new
_for_algorithm
(
username
,
NULL
,
password
,
NULL
,
domain
,
domain
,
algorithm
);
linphone_core_add_auth_info
(
lc
,
ai
);
linphone_auth_info_unref
(
ai
);
...
...
@@ -407,13 +410,15 @@ static LinphoneAddress *account_manager_check_account(AccountManager *m, Linphon
if
(
original_ai
)
linphone_core_remove_auth_info
(
lc
,
original_ai
);
ai
=
linphone_auth_info_new
(
const
char
*
algorithm
=
linphone_config_get_string
(
linphone_core_get_config
(
lc
),
"assistant"
,
"algorithm"
,
NULL
);
ai
=
linphone_auth_info_new_for_algorithm
(
linphone_address_get_username
(
account
->
modified_identity
),
NULL
,
account
->
password
,
NULL
,
linphone_address_get_domain
(
account
->
modified_identity
),
linphone_address_get_domain
(
account
->
modified_identity
)
// realm = domain
linphone_address_get_domain
(
account
->
modified_identity
),
// realm = domain
algorithm
);
linphone_core_add_auth_info
(
lc
,
ai
);
linphone_auth_info_unref
(
ai
);
...
...
tester/rcfiles/marie_lime_x3dh_no_server_rc
View file @
aa2a7a0f
...
...
@@ -20,6 +20,9 @@ userid=marie
passwd=secret
realm=sip.example.org
[assistant]
algorithm=SHA-256
[proxy_0]
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp;lr
...
...
tester/rcfiles/marie_lime_x3dh_rc
View file @
aa2a7a0f
...
...
@@ -18,6 +18,9 @@ userid=marie
passwd=secret
realm=sip.example.org
[assistant]
algorithm=SHA-256
[proxy_0]
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp;lr
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment