Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
7770c624
Commit
7770c624
authored
14 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#3931] Fix SDES ZRTP key protocol selection
parent
ef7069df
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp
+28
-11
28 additions, 11 deletions
sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp
with
28 additions
and
11 deletions
sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp
+
28
−
11
View file @
7770c624
...
...
@@ -36,6 +36,7 @@
#include
"manager.h"
#include
"account.h"
#include
"sip/sipcall.h"
#include
"sip/sipaccount.h"
#include
"sip/SdesNegotiator.h"
#include
<assert.h>
...
...
@@ -76,25 +77,41 @@ void AudioRtpFactory::initAudioRtpConfig (SIPCall *ca)
AccountID
accountId
=
Manager
::
instance
().
getAccountFromCall
(
ca
->
getCallId
());
// Check if it is an IP-to-IP call
if
(
accountId
==
AccountNULL
)
{
_srtpEnabled
=
Manager
::
instance
().
getConfigBool
(
IP2IP_PROFILE
,
SRTP_ENABLE
);
_keyExchangeProtocol
=
Manager
::
instance
().
getConfigInt
(
IP2IP_PROFILE
,
SRTP_KEY_EXCHANGE
);
_debug
(
"Ip-to-ip profile selected with key exchange protocol number %d"
,
_keyExchangeProtocol
);
_helloHashEnabled
=
Manager
::
instance
().
getConfigBool
(
IP2IP_PROFILE
,
ZRTP_HELLO_HASH
);
}
else
{
_srtpEnabled
=
Manager
::
instance
().
getConfigBool
(
accountId
,
SRTP_ENABLE
);
_keyExchangeProtocol
=
Manager
::
instance
().
getConfigInt
(
accountId
,
SRTP_KEY_EXCHANGE
);
_debug
(
"AudioRtpFactory: Init rtp session for account %s"
,
accountId
.
c_str
());
// Manager::instance().getAccountLink (accountId);
Account
*
account
=
Manager
::
instance
().
getAccount
(
accountId
);
if
(
!
account
)
_error
(
"AudioRtpFactory: Error no account found"
);
if
(
account
->
getType
()
==
"SIP"
)
{
SIPAccount
*
sipaccount
=
static_cast
<
SIPAccount
*>
(
account
);
_srtpEnabled
=
sipaccount
->
getSrtpEnable
();
std
::
string
tempkey
=
sipaccount
->
getSrtpKeyExchange
();
if
(
tempkey
==
"sdes"
)
_keyExchangeProtocol
=
Sdes
;
else
if
(
tempkey
==
"zrtp"
)
_keyExchangeProtocol
=
Zrtp
;
else
_keyExchangeProtocol
=
Symmetric
;
_debug
(
"Registered account %s profile selected with key exchange protocol number %d"
,
accountId
.
c_str
(),
_keyExchangeProtocol
);
_helloHashEnabled
=
Manager
::
instance
().
getConfigBool
(
accountId
,
ZRTP_HELLO_HASH
);
_helloHashEnabled
=
sipaccount
->
getZrtpHelloHash
();
}
else
{
_srtpEnabled
=
false
;
_keyExchangeProtocol
=
Symmetric
;
_helloHashEnabled
=
false
;
}
}
void
AudioRtpFactory
::
initAudioRtpSession
(
SIPCall
*
ca
)
{
ost
::
MutexLock
m
(
_audioRtpThreadMutex
);
_debug
(
"Srtp enable: %d "
,
_srtpEnabled
);
_debug
(
"
AudioRtpFactory:
Srtp enable: %d "
,
_srtpEnabled
);
if
(
_srtpEnabled
)
{
std
::
string
zidFilename
(
Manager
::
instance
().
getConfigString
(
SIGNALISATION
,
ZRTP_ZIDFILE
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment