Skip to content
Snippets Groups Projects
Commit cb6f01e9 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #9832: AudioSRTPSession: fix logging

parent cf6c05e3
No related branches found
No related tags found
No related merge requests found
...@@ -97,7 +97,7 @@ namespace { ...@@ -97,7 +97,7 @@ namespace {
// Fills the array dest with length random bytes // Fills the array dest with length random bytes
void buffer_fill(unsigned char dest [], size_t length) void buffer_fill(unsigned char dest [], size_t length)
{ {
DEBUG("AudioSrtp: Init local master key"); DEBUG("Init local master key");
// @TODO key may have different length depending on cipher suite // @TODO key may have different length depending on cipher suite
// Allocate memory for key // Allocate memory for key
...@@ -133,7 +133,7 @@ AudioSrtpSession::AudioSrtpSession(SIPCall &call) : ...@@ -133,7 +133,7 @@ AudioSrtpSession::AudioSrtpSession(SIPCall &call) :
ost::CryptoContext* AudioSrtpSession::initLocalCryptoInfo() ost::CryptoContext* AudioSrtpSession::initLocalCryptoInfo()
{ {
DEBUG("AudioSrtp: Set cryptographic info for this rtp session"); DEBUG("Set cryptographic info for this rtp session");
// Initialize local Crypto context // Initialize local Crypto context
initializeLocalMasterKey(); initializeLocalMasterKey();
...@@ -150,7 +150,7 @@ ost::CryptoContext* AudioSrtpSession::initLocalCryptoInfo() ...@@ -150,7 +150,7 @@ ost::CryptoContext* AudioSrtpSession::initLocalCryptoInfo()
std::vector<std::string> AudioSrtpSession::getLocalCryptoInfo() std::vector<std::string> AudioSrtpSession::getLocalCryptoInfo()
{ {
DEBUG("AudioSrtp: Get Cryptographic info from this rtp session"); DEBUG("Get Cryptographic info from this rtp session");
std::vector<std::string> crypto_vector; std::vector<std::string> crypto_vector;
...@@ -206,11 +206,11 @@ AudioSrtpSession::setRemoteCryptoInfo(sfl::SdesNegotiator& nego) ...@@ -206,11 +206,11 @@ AudioSrtpSession::setRemoteCryptoInfo(sfl::SdesNegotiator& nego)
void AudioSrtpSession::initializeLocalMasterKey() void AudioSrtpSession::initializeLocalMasterKey()
{ {
DEBUG("AudioSrtp: Init local master key"); DEBUG("Init local master key");
// @TODO key may have different length depending on cipher suite // @TODO key may have different length depending on cipher suite
localMasterKeyLength_ = sfl::CryptoSuites[localCryptoSuite_].masterKeyLength / 8; localMasterKeyLength_ = sfl::CryptoSuites[localCryptoSuite_].masterKeyLength / 8;
assert(ARRAYSIZE(localMasterKey_) >= localMasterKeyLength_); assert(ARRAYSIZE(localMasterKey_) >= localMasterKeyLength_);
DEBUG("AudioSrtp: Local master key length %d", localMasterKeyLength_); DEBUG("Local master key length %d", localMasterKeyLength_);
buffer_fill(localMasterKey_, localMasterKeyLength_); buffer_fill(localMasterKey_, localMasterKeyLength_);
} }
...@@ -219,20 +219,20 @@ void AudioSrtpSession::initializeLocalMasterSalt() ...@@ -219,20 +219,20 @@ void AudioSrtpSession::initializeLocalMasterSalt()
// @TODO key may have different length depending on cipher suite // @TODO key may have different length depending on cipher suite
localMasterSaltLength_ = sfl::CryptoSuites[localCryptoSuite_].masterSaltLength / 8; localMasterSaltLength_ = sfl::CryptoSuites[localCryptoSuite_].masterSaltLength / 8;
assert(ARRAYSIZE(localMasterSalt_) >= localMasterSaltLength_); assert(ARRAYSIZE(localMasterSalt_) >= localMasterSaltLength_);
DEBUG("AudioSrtp: Local master salt length %d", localMasterSaltLength_); DEBUG("Local master salt length %d", localMasterSaltLength_);
buffer_fill(localMasterSalt_, localMasterSaltLength_); buffer_fill(localMasterSalt_, localMasterSaltLength_);
} }
std::string AudioSrtpSession::getBase64ConcatenatedKeys() std::string AudioSrtpSession::getBase64ConcatenatedKeys()
{ {
DEBUG("AudioSrtp: Get base64 concatenated keys"); DEBUG("Get base64 concatenated keys");
// compute concatenated master and salt length // compute concatenated master and salt length
int concatLength = localMasterKeyLength_ + localMasterSaltLength_; int concatLength = localMasterKeyLength_ + localMasterSaltLength_;
uint8 concatKeys[concatLength]; uint8 concatKeys[concatLength];
DEBUG("AudioSrtp: Concatenated length %d", concatLength); DEBUG("Concatenated length %d", concatLength);
// concatenate keys // concatenate keys
memcpy((void*) concatKeys, (void*) localMasterKey_, localMasterKeyLength_); memcpy((void*) concatKeys, (void*) localMasterKey_, localMasterKeyLength_);
...@@ -260,7 +260,7 @@ void AudioSrtpSession::unBase64ConcatenatedKeys(std::string base64keys) ...@@ -260,7 +260,7 @@ void AudioSrtpSession::unBase64ConcatenatedKeys(std::string base64keys)
void AudioSrtpSession::initializeRemoteCryptoContext() void AudioSrtpSession::initializeRemoteCryptoContext()
{ {
DEBUG("AudioSrtp: Initialize remote crypto context"); DEBUG("Initialize remote crypto context");
const CryptoSuiteDefinition &crypto = sfl::CryptoSuites[remoteCryptoSuite_]; const CryptoSuiteDefinition &crypto = sfl::CryptoSuites[remoteCryptoSuite_];
...@@ -284,7 +284,7 @@ void AudioSrtpSession::initializeRemoteCryptoContext() ...@@ -284,7 +284,7 @@ void AudioSrtpSession::initializeRemoteCryptoContext()
void AudioSrtpSession::initializeLocalCryptoContext() void AudioSrtpSession::initializeLocalCryptoContext()
{ {
DEBUG("AudioSrtp: Initialize local crypto context"); DEBUG("Initialize local crypto context");
const CryptoSuiteDefinition &crypto = sfl::CryptoSuites[localCryptoSuite_]; const CryptoSuiteDefinition &crypto = sfl::CryptoSuites[localCryptoSuite_];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment