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
ec3f598f
Commit
ec3f598f
authored
Oct 30, 2019
by
Sylvain Berfini
🐮
Browse files
Fixed security level for local device returning Safe instead of Encrypted
parent
245e8a78
Changes
3
Hide whitespace changes
Inline
Side-by-side
coreapi/account_creator.c
View file @
ec3f598f
...
...
@@ -329,9 +329,7 @@ static void _linphone_account_creator_destroy(LinphoneAccountCreator *creator) {
linphone_account_creator_cbs_unref
(
creator
->
cbs
);
bctbx_list_free_with_data
(
creator
->
callbacks
,
(
bctbx_list_free_func
)
linphone_account_creator_cbs_unref
);
creator
->
callbacks
=
nullptr
;
if
(
creator
->
proxy_cfg
)
{
linphone_proxy_config_unref
(
creator
->
proxy_cfg
);
}
linphone_account_creator_reset
(
creator
);
}
...
...
@@ -390,6 +388,11 @@ void linphone_account_creator_reset(LinphoneAccountCreator *creator) {
resetField
(
&
creator
->
activation_code
);
resetField
(
&
creator
->
domain
);
resetField
(
&
creator
->
route
);
if
(
creator
->
proxy_cfg
)
{
linphone_proxy_config_unref
(
creator
->
proxy_cfg
);
creator
->
proxy_cfg
=
nullptr
;
}
}
LinphoneAccountCreator
*
linphone_core_create_account_creator
(
LinphoneCore
*
core
,
const
char
*
xmlrpc_url
)
{
...
...
coreapi/linphonecore.c
View file @
ec3f598f
...
...
@@ -3675,15 +3675,17 @@ static bctbx_list_t *make_routes_for_proxy(LinphoneProxyConfig *proxy, const Lin
proxy_routes_iterator
=
bctbx_list_next
(
proxy_routes_iterator
);
}
if
(
srv_route
){
ret
=
bctbx_list_append
(
ret
,
sal_address_clone
(
L_GET_PRIVATE_FROM_C_OBJECT
(
srv_route
)
->
getInternalAddress
()));
ret
=
bctbx_list_append
(
ret
,
sal_address_clone
(
L_GET_PRIVATE_FROM_C_OBJECT
(
srv_route
)
->
getInternalAddress
()));
}
if
(
ret
==
NULL
){
if
(
ret
==
NULL
)
{
/*if the proxy address matches the domain part of the destination, then use the same transport
* as the one used for registration. This is done by forcing a route to this proxy.*/
SalAddress
*
proxy_addr
=
sal_address_new
(
linphone_proxy_config_get_addr
(
proxy
));
if
(
strcmp
(
sal_address_get_domain
(
proxy_addr
),
linphone_address_get_domain
(
dest
))
==
0
){
ret
=
bctbx_list_append
(
ret
,
proxy_addr
);
}
else
sal_address_unref
(
proxy_addr
);
SalAddress
*
proxy_addr
=
sal_address_new
(
linphone_proxy_config_get_addr
(
proxy
));
const
char
*
proxy_addr_domain
=
sal_address_get_domain
(
proxy_addr
);
const
char
*
linphone_addr_domain
=
linphone_address_get_domain
(
dest
);
if
(
proxy_addr_domain
&&
linphone_addr_domain
&&
strcmp
(
proxy_addr_domain
,
linphone_addr_domain
)
==
0
)
{
ret
=
bctbx_list_append
(
ret
,
proxy_addr
);
}
else
sal_address_unref
(
proxy_addr
);
}
return
ret
;
}
...
...
src/chat/encryption/lime-x3dh-encryption-engine.cpp
View file @
ec3f598f
...
...
@@ -550,12 +550,15 @@ AbstractChatRoom::SecurityLevel LimeX3dhEncryptionEngine::getSecurityLevel (cons
lime
::
PeerDeviceStatus
status
=
limeManager
->
get_peerDeviceStatus
(
deviceId
);
switch
(
status
)
{
case
lime
::
PeerDeviceStatus
::
unknown
:
if
(
limeManager
->
is_localUser
(
deviceId
))
{
return
AbstractChatRoom
::
SecurityLevel
::
Safe
;
}
return
AbstractChatRoom
::
SecurityLevel
::
Encrypted
;
case
lime
::
PeerDeviceStatus
::
untrusted
:
return
AbstractChatRoom
::
SecurityLevel
::
Encrypted
;
case
lime
::
PeerDeviceStatus
::
trusted
:
return
AbstractChatRoom
::
SecurityLevel
::
Safe
;
case
lime
::
PeerDeviceStatus
::
unsafe
:
return
AbstractChatRoom
::
SecurityLevel
::
Unsafe
;
default:
return
AbstractChatRoom
::
SecurityLevel
::
Unsafe
;
}
...
...
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