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
724a0e6b
Commit
724a0e6b
authored
15 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#1722] Remove application from crypto attribute
parent
11814fe4
No related branches found
No related tags found
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
+29
-11
29 additions, 11 deletions
sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp
sflphone-common/src/sip/sipvoiplink.cpp
+1
-0
1 addition, 0 deletions
sflphone-common/src/sip/sipvoiplink.cpp
with
30 additions
and
11 deletions
sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp
+
29
−
11
View file @
724a0e6b
...
@@ -46,7 +46,7 @@ AudioSrtpSession::AudioSrtpSession (ManagerImpl * manager, SIPCall * sipcall) :
...
@@ -46,7 +46,7 @@ AudioSrtpSession::AudioSrtpSession (ManagerImpl * manager, SIPCall * sipcall) :
ost
::
SymmetricRTPSession
(
ost
::
InetHostAddress
(
sipcall
->
getLocalIp
().
c_str
()),
sipcall
->
getLocalAudioPort
()),
ost
::
SymmetricRTPSession
(
ost
::
InetHostAddress
(
sipcall
->
getLocalIp
().
c_str
()),
sipcall
->
getLocalAudioPort
()),
AudioRtpSession
<
AudioSrtpSession
>
(
manager
,
sipcall
)
AudioRtpSession
<
AudioSrtpSession
>
(
manager
,
sipcall
)
{
{
_debug
(
"***************** AudioSrtpSession
initialized
*********************"
);
_debug
(
"*****************
Initialize
AudioSrtpSession *********************"
);
initializeLocalMasterKey
();
initializeLocalMasterKey
();
initializeLocalMasterSalt
();
initializeLocalMasterSalt
();
// initializeRemoteCryptoContext();
// initializeRemoteCryptoContext();
...
@@ -77,7 +77,7 @@ std::string AudioSrtpSession::getLocalCryptoInfo() {
...
@@ -77,7 +77,7 @@ std::string AudioSrtpSession::getLocalCryptoInfo() {
std
::
string
crypto
=
tag
.
append
(
" "
);
std
::
string
crypto
=
tag
.
append
(
" "
);
crypto
+=
crypto_suite
.
append
(
" "
);
crypto
+=
crypto_suite
.
append
(
" "
);
crypto
+=
application
.
append
(
" "
);
//
crypto += application.append(" ");
crypto
+=
srtp_keys
;
crypto
+=
srtp_keys
;
_debug
(
"%s"
,
crypto
.
c_str
());
_debug
(
"%s"
,
crypto
.
c_str
());
...
@@ -90,18 +90,28 @@ void AudioSrtpSession::setRemoteCryptoInfo(sfl::SdesNegotiator& nego) {
...
@@ -90,18 +90,28 @@ void AudioSrtpSession::setRemoteCryptoInfo(sfl::SdesNegotiator& nego) {
_debug
(
"Set remote Cryptographic info for this rtp session"
);
_debug
(
"Set remote Cryptographic info for this rtp session"
);
_debug
(
"nego.getKeyInfo() : %s"
,
nego
.
getKeyInfo
().
c_str
());
unBase64ConcatenatedKeys
(
nego
.
getKeyInfo
());
unBase64ConcatenatedKeys
(
nego
.
getKeyInfo
());
initializeRemoteCryptoContext
();
initializeRemoteCryptoContext
();
setInQueueCryptoContext
(
_remoteCryptoCtx
);
}
}
void
AudioSrtpSession
::
initializeLocalMasterKey
(
void
)
void
AudioSrtpSession
::
initializeLocalMasterKey
(
void
)
{
{
_debug
(
"initializeLocalMasterKey"
);
_localMasterKeyLength
=
16
;
_localMasterKeyLength
=
16
;
for
(
int
i
=
0
;
i
<
16
;
i
++
)
printf
(
"Local Master: "
);
for
(
int
i
=
0
;
i
<
16
;
i
++
)
{
_localMasterKey
[
i
]
=
mk
[
i
];
_localMasterKey
[
i
]
=
mk
[
i
];
printf
(
"%i"
,
_localMasterKey
[
i
]);
}
printf
(
"
\n
"
);
return
;
return
;
}
}
...
@@ -111,8 +121,12 @@ void AudioSrtpSession::initializeLocalMasterSalt(void)
...
@@ -111,8 +121,12 @@ void AudioSrtpSession::initializeLocalMasterSalt(void)
{
{
_localMasterSaltLength
=
14
;
_localMasterSaltLength
=
14
;
for
(
int
i
=
0
;
i
<
14
;
i
++
)
printf
(
"Remote Salt: "
);
for
(
int
i
=
0
;
i
<
14
;
i
++
)
{
_localMasterSalt
[
i
]
=
ms
[
i
];
_localMasterSalt
[
i
]
=
ms
[
i
];
printf
(
"%i"
,
_localMasterSalt
[
i
]);
}
printf
(
"
\n
"
);
return
;
return
;
...
@@ -141,19 +155,23 @@ std::string AudioSrtpSession::getBase64ConcatenatedKeys()
...
@@ -141,19 +155,23 @@ std::string AudioSrtpSession::getBase64ConcatenatedKeys()
void
AudioSrtpSession
::
unBase64ConcatenatedKeys
(
std
::
string
base64keys
)
void
AudioSrtpSession
::
unBase64ConcatenatedKeys
(
std
::
string
base64keys
)
{
{
printf
(
"unBase64ConcatenatedKeys : base64keys %s
\n
"
,
base64keys
.
c_str
());
printf
(
"unBase64ConcatenatedKeys : size %i
\n
"
,
(
int
)
base64keys
.
size
());
char
*
output
=
decodeBase64
((
unsigned
char
*
)
base64keys
.
c_str
(),
base64keys
.
size
());
char
*
output
=
decodeBase64
((
unsigned
char
*
)
base64keys
.
c_str
(),
base64keys
.
size
());
uint8
finally
[
30
];
uint8
concatenated
[
30
];
memcpy
((
void
*
)
finally
,
(
void
*
)
output
,
30
);
memcpy
((
void
*
)
concatenated
,
(
void
*
)
output
,
30
);
printf
(
"Master: "
);
printf
(
"
Remote
Master: "
);
for
(
int
i
=
0
;
i
<
16
;
i
++
)
{
for
(
int
i
=
0
;
i
<
16
;
i
++
)
{
printf
(
"%i"
,
finally
[
i
]);
_remoteMasterKey
[
i
]
=
concatenated
[
i
];
printf
(
"%i"
,
concatenated
[
i
]);
}
}
printf
(
"
\n
"
);
printf
(
"
\n
"
);
printf
(
"Salt: "
);
printf
(
"Remote Salt: "
);
for
(
int
i
=
16
;
i
<
30
;
i
++
)
{
for
(
int
i
=
14
;
i
<
30
;
i
++
)
{
printf
(
"%i"
,
finally
[
i
]);
_remoteMasterSalt
[
i
-
14
]
=
concatenated
[
i
];
printf
(
"%i"
,
concatenated
[
i
]);
}
}
printf
(
"
\n
"
);
printf
(
"
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
sflphone-common/src/sip/sipvoiplink.cpp
+
1
−
0
View file @
724a0e6b
...
@@ -3241,6 +3241,7 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status)
...
@@ -3241,6 +3241,7 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status)
if
(
sdesnego
.
negotiate
())
{
if
(
sdesnego
.
negotiate
())
{
_debug
(
"******************** Negociation Is Successfull *********************
\n
"
);
_debug
(
"******************** Negociation Is Successfull *********************
\n
"
);
_debug
(
"keys : %s"
,
sdesnego
.
getKeyInfo
().
c_str
());
call
->
getAudioRtp
()
->
setRemoteCryptoInfo
(
sdesnego
);
call
->
getAudioRtp
()
->
setRemoteCryptoInfo
(
sdesnego
);
}
}
...
...
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