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
a012e378
"git@git.jami.net:savoirfairelinux/jami-daemon.git" did not exist on "c0da142e56b93e572f8a1c468e8af7d740761c22"
Commit
a012e378
authored
15 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#1722] Encode concatenated srtp keys
parent
acdb04e5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp
+19
-10
19 additions, 10 deletions
sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp
with
19 additions
and
10 deletions
sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp
+
19
−
10
View file @
a012e378
...
...
@@ -61,19 +61,26 @@ AudioSrtpSession::AudioSrtpSession (ManagerImpl * manager, SIPCall * sipcall) :
std
::
string
AudioSrtpSession
::
getCryptoSdpInfo
()
{
_debug
(
"Get Cryptographic info from this rtp session"
);
std
::
string
tag
=
"1"
;
std
::
string
crypto_suite
=
"AES_CM_128_HMAC_SHA1_32"
;
std
::
string
application
=
"srtp"
;
std
::
string
srtp_key
=
"inline:16/14/NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj/2^20/1:32"
;
// std::string srtp_keys = "inline:16/14/NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj/2^20/1:32";
// format srtp keys as the following
// inline:16/14/NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj/2^20/1:32
std
::
string
srtp_keys
=
"inline:"
;
srtp_keys
.
append
(
"16/14/"
);
srtp_keys
+=
getBase64ConcatenatedKeys
();
srtp_keys
.
append
(
"/2^20/1:32"
);
std
::
string
crypto
=
tag
;
std
::
string
crypto
=
tag
.
append
(
" "
);
crypto
+=
crypto_suite
.
append
(
" "
);
crypto
+=
application
.
append
(
" "
);
crypto
+=
srtp_keys
;
crypto
.
append
(
" "
);
crypto
.
append
(
crypto_suite
);
crypto
.
append
(
" "
);
crypto
.
append
(
application
);
crypto
.
append
(
" "
);
crypto
.
append
(
srtp_key
);
_debug
(
"%s"
,
crypto
.
c_str
());
return
crypto
;
}
...
...
@@ -105,10 +112,12 @@ void AudioSrtpSession::initializeMasterSalt(void)
std
::
string
AudioSrtpSession
::
getBase64ConcatenatedKeys
()
{
// concatenate master and salt
uint8
concatenated
[
30
];
memcpy
((
void
*
)
concatenated
,
(
void
*
)
_masterKey
,
16
);
memcpy
((
void
*
)(
concatenated
+
16
),
(
void
*
)
_masterSalt
,
14
);
// encode concatenated keys in base64
char
*
output
=
encodeBase64
((
unsigned
char
*
)
concatenated
,
30
);
std
::
string
keys
(
output
);
...
...
@@ -185,8 +194,8 @@ char* AudioSrtpSession::encodeBase64(unsigned char *input, int length)
// get pointer to data
BIO_get_mem_ptr
(
b64
,
&
bptr
);
// copy result in output buffer
strncpy
(
buffer
,
(
char
*
)(
bptr
->
data
),
bptr
->
length
);
// copy result in output buffer
(-1 since we do not want the EOF character)
strncpy
(
buffer
,
(
char
*
)(
bptr
->
data
),
bptr
->
length
-
1
);
BIO_free_all
(
bmem
);
...
...
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