Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
e5eaf412
Commit
e5eaf412
authored
Aug 14, 2018
by
Matthieu Tanon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve security alerts to avoid duplicates
parent
6edf43c3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
8 deletions
+22
-8
src/chat/chat-room/client-group-chat-room.cpp
src/chat/chat-room/client-group-chat-room.cpp
+1
-1
src/chat/encryption/lime-v2.cpp
src/chat/encryption/lime-v2.cpp
+17
-4
src/conference/session/media-session.cpp
src/conference/session/media-session.cpp
+4
-3
No files found.
src/chat/chat-room/client-group-chat-room.cpp
View file @
e5eaf412
...
...
@@ -725,7 +725,7 @@ void ClientGroupChatRoom::onSecurityAlert (const shared_ptr<ConferenceSecurityEv
_linphone_chat_room_notify_security_alert
(
cr
,
L_GET_C_BACK_PTR
(
event
));
// Try to set the faulty device PeerDeviceStatus to unsafe
if
(
getCore
()
->
limeV2Enabled
())
{
if
(
getCore
()
->
limeV2Enabled
()
&&
event
->
getFaultyDevice
().
isValid
()
)
{
LimeV2
*
limeV2Engine
=
static_cast
<
LimeV2
*>
(
getCore
()
->
getEncryptionEngine
());
// TODO has no effect if faulty device is unkown to LIMEv2
...
...
src/chat/encryption/lime-v2.cpp
View file @
e5eaf412
...
...
@@ -169,15 +169,28 @@ ChatMessageModifier::Result LimeV2::processOutgoingMessage (const shared_ptr<Cha
}
}
// If too many devices for a participant, throw a local security alert event
if
(
tooManyDevices
)
{
// If too many devices for a participant, throw a local security alert event
lWarning
()
<<
"Sending encrypted message to multidevice participant, message rejected"
;
ConferenceSecurityEvent
::
SecurityAlertType
security
A
lert
Type
=
ConferenceSecurityEvent
::
SecurityAlertType
::
MultideviceParticipa
nt
;
shared_ptr
<
Confe
re
n
ceSecurity
Event
>
securityEvent
=
make_shared
<
ConferenceSecurityEvent
>
(
time
(
nullptr
),
chatRoom
->
getConferenceId
(),
securityAlertType
)
;
// Check the last 2 events for
security
a
lert
s before sending a new security eve
nt
bool
rece
nt
Security
Alert
=
false
;
shared_ptr
<
ClientGroupChatRoom
>
confListener
=
static_pointer_cast
<
ClientGroupChatRoom
>
(
chatRoom
);
confListener
->
onSecurityAlert
(
securityEvent
);
list
<
shared_ptr
<
EventLog
>>
eventList
=
chatRoom
->
getHistory
(
2
);
// If there is at least one security alert don't send a new one
for
(
const
auto
&
event
:
eventList
)
{
if
(
event
->
getType
()
==
ConferenceEvent
::
Type
::
ConferenceSecurityAlert
)
{
recentSecurityAlert
=
true
;
}
}
// If there is no recent security alert send a new one
if
(
!
recentSecurityAlert
)
{
ConferenceSecurityEvent
::
SecurityAlertType
securityAlertType
=
ConferenceSecurityEvent
::
SecurityAlertType
::
MultideviceParticipant
;
shared_ptr
<
ConferenceSecurityEvent
>
securityEvent
=
make_shared
<
ConferenceSecurityEvent
>
(
time
(
nullptr
),
chatRoom
->
getConferenceId
(),
securityAlertType
);
confListener
->
onSecurityAlert
(
securityEvent
);
}
return
ChatMessageModifier
::
Result
::
Error
;
}
...
...
src/conference/session/media-session.cpp
View file @
e5eaf412
...
...
@@ -3523,7 +3523,7 @@ void MediaSessionPrivate::propagateEncryptionChanged () {
char
*
peerDeviceId
=
sal_address_as_string_uri_only
(
remoteAddress
);
// TODO If mismatch = 0 set this peer as trusted with this Ik
// TODO If mismatch = 1
it means that the stored Ik was corrupted (
identity theft)
// TODO If mismatch = 1
the Ik exchange went wrong (possible
identity theft)
if
(
ms_zrtp_getAuxiliarySharedSecretMismatch
(
audioStream
->
ms
.
sessions
.
zrtp_context
)
==
0
)
{
if
(
limeV2Engine
)
{
try
{
...
...
@@ -3532,15 +3532,16 @@ void MediaSessionPrivate::propagateEncryptionChanged () {
limeV2Engine
->
getLimeManager
()
->
set_peerDeviceStatus
(
peerDeviceId
,
remoteIk_vector
,
peerDeviceStatus
);
lInfo
()
<<
"LIMEv2 peer device "
<<
peerDeviceId
<<
" is now trusted"
;
}
catch
(
const
exception
&
e
)
{
// The stored IK doesn't correspond to the Ik we are trying to use here
// TODO Report the security issue to application level (chatroom event)
lError
()
<<
"LIMEv2 identity theft detected from "
<<
peerDeviceId
<<
" ("
<<
e
.
what
()
<<
")"
;
}
}
else
{
lError
()
<<
"Unable to get LIMEv2 context, unable to set peer
i
de
ntity verified
status"
;
lError
()
<<
"Unable to get LIMEv2 context, unable to set peer de
vice
status"
;
}
}
else
{
// TODO Report the security issue to application level (chatroom event)
lError
()
<<
"LIMEv2 identity theft detected from "
<<
peerDeviceId
;
lError
()
<<
"LIMEv2
auxiliary secret mismatch: possible
identity theft detected from "
<<
peerDeviceId
;
}
ms_free
(
peerDeviceId
);
}
...
...
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