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
05ccb471
Commit
05ccb471
authored
14 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#4243] Init audio srtp remote crypto context in call_on_media_update
parent
277655f6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp
+21
-15
21 additions, 15 deletions
sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp
sflphone-common/src/sip/sipvoiplink.cpp
+2
-4
2 additions, 4 deletions
sflphone-common/src/sip/sipvoiplink.cpp
with
23 additions
and
19 deletions
sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp
+
21
−
15
View file @
05ccb471
...
...
@@ -45,6 +45,8 @@
#include
<cerrno>
bool
remoteIsSet
;
namespace
sfl
{
...
...
@@ -59,6 +61,7 @@ AudioSrtpSession::AudioSrtpSession (ManagerImpl * manager, SIPCall * sipcall) :
_remoteMasterSaltLength
(
0
)
{
remoteIsSet
=
false
;
// initLocalCryptoInfo();
}
...
...
@@ -113,28 +116,31 @@ std::vector<std::string> AudioSrtpSession::getLocalCryptoInfo()
void
AudioSrtpSession
::
setRemoteCryptoInfo
(
sfl
::
SdesNegotiator
&
nego
)
{
if
(
!
remoteIsSet
)
{
_debug
(
"----------------------------------------------- AudioSrtp: Set remote Cryptographic info for Srtp"
);
_debug
(
"
----------------------------------------------- AudioSrtp: Set remote Cryptographic info for Srtp"
);
_debug
(
"
%s"
,
nego
.
getKeyInfo
().
c_str
()
);
_debug
(
"%s"
,
nego
.
getKeyInfo
().
c_str
());
// Use second crypto suite if key length is 32 bit, default is 80;
_debug
(
"--------------------------------------------------- auth tag %s"
,
nego
.
getAuthTagLength
().
c_str
());
// Use second crypto suite if key length is 32 bit, default is 80;
_debug
(
"--------------------------------------------------- auth tag %s"
,
nego
.
getAuthTagLength
().
c_str
());
if
(
nego
.
getAuthTagLength
()
==
"32"
)
{
_debug
(
"--------------------------- AudioSrtp: Using %s byte authentication tag length"
,
nego
.
getAuthTagLength
().
c_str
());
_localCryptoSuite
=
1
;
_remoteCryptoSuite
=
1
;
}
if
(
nego
.
getAuthTagLength
()
==
"32"
)
{
_debug
(
"--------------------------- AudioSrtp: Using %s byte authentication tag length"
,
nego
.
getAuthTagLength
().
c_str
());
_localCryptoSuite
=
1
;
_remoteCryptoSuite
=
1
;
}
// decode keys
unBase64ConcatenatedKeys
(
nego
.
getKeyInfo
());
// decode keys
unBase64ConcatenatedKeys
(
nego
.
getKeyInfo
());
// init crypto content in Srtp session
initializeRemoteCryptoContext
();
setInQueueCryptoContext
(
_remoteCryptoCtx
);
// init
crypto content in Srtp session
initializeRemoteCryptoContext
()
;
setInQueueCryptoContext
(
_remoteCryptoCtx
);
// init
LocalCryptoInfo();
remoteIsSet
=
true
;
}
// initLocalCryptoInfo();
}
...
...
This diff is collapsed.
Click to expand it.
sflphone-common/src/sip/sipvoiplink.cpp
+
2
−
4
View file @
05ccb471
...
...
@@ -3337,7 +3337,7 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status)
}
/*
// Get the crypto attribute containing srtp's cryptographic context (keys, cipher)
CryptoOffer
crypto_offer
;
call
->
getLocalSDP
()
->
get_remote_sdp_crypto_from_offer
(
remote_sdp
,
crypto_offer
);
...
...
@@ -3365,7 +3365,7 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status)
try
{
call
->
getAudioRtp
()
->
setRemoteCryptoInfo
(
sdesnego
);
call->getAudioRtp()->initLocalCryptoInfo (call);
//
call->getAudioRtp()->initLocalCryptoInfo (call);
}
catch
(...)
{}
DBusManager
::
instance
().
getCallManager
()
->
secureSdesOn
(
call
->
getCallId
());
...
...
@@ -3399,7 +3399,6 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status)
// enabled for this call, make a try using RTP only...
_debug
(
"UserAgent: SDES not initialized for this call
\n
"
);
}
*/
Sdp
*
sdpSession
=
call
->
getLocalSDP
();
...
...
@@ -3965,7 +3964,6 @@ mod_on_rx_request (pjsip_rx_data *rdata)
call
->
getAudioRtp
()
->
initAudioRtpConfig
(
call
);
call
->
getAudioRtp
()
->
initAudioRtpSession
(
call
);
call
->
getAudioRtp
()
->
setRemoteCryptoInfo
(
sdesnego
);
_debug
(
"------------------------------------------------ init local crypto info"
);
call
->
getAudioRtp
()
->
initLocalCryptoInfo
(
call
);
}
catch
(...)
{
_warn
(
"UserAgent: Error: Failed to create rtp thread from answer"
);
...
...
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