diff --git a/sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp b/sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp index 28fe6764fff441d1a95d2a49604890d569f56284..d86251ca1d755958e17c69d04629c02db9a327a1 100644 --- a/sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp +++ b/sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp @@ -43,6 +43,7 @@ AudioSrtpSession::AudioSrtpSession (ManagerImpl * manager, SIPCall * sipcall) : initializeMasterSalt(); initializeInputCryptoContext(); initializeOutputCryptoContext(); + outputCryptoCtx->deriveSrtpKeys(0); setInQueueCryptoContext(inputCryptoCtx); @@ -71,36 +72,36 @@ void AudioSrtpSession::initializeMasterSalt(void) void AudioSrtpSession::initializeInputCryptoContext(void) { - inputCryptoCtx = new ost::CryptoContext(0x12345678, - 0, // roc, - 0L, // keydr, - SrtpEncryptionAESCM, // encryption algo - SrtpAuthenticationSha1Hmac, // authtication algo - _masterKey, // Master Key - 128 / 8, // Master Key length - _masterSalt, // Master Salt - 112 / 8, // Master Salt length - 128 / 8, // encryption keyl - 160 / 8, // authentication key len - 112 / 8, // session salt len - 80 / 8); // authentication tag len + inputCryptoCtx = new ost::CryptoContext(getLocalSSRCNetwork(), + 0, // roc, + 0L, // keydr, + SrtpEncryptionAESCM, // encryption algo + SrtpAuthenticationSha1Hmac, // authtication algo + _masterKey, // Master Key + 128 / 8, // Master Key length + _masterSalt, // Master Salt + 112 / 8, // Master Salt length + 128 / 8, // encryption keyl + 160 / 8, // authentication key len + 112 / 8, // session salt len + 80 / 8); // authentication tag len } void AudioSrtpSession::initializeOutputCryptoContext(void) { - outputCryptoCtx = new ost::CryptoContext(0x12345678, - 0, // roc, - 0L, // keydr, - SrtpEncryptionAESCM, // encryption algo - SrtpAuthenticationSha1Hmac, // authtication algo - _masterKey, // Master Key - 128 / 8, // Master Key length - _masterSalt, // Master Salt - 112 / 8, // Master Salt length - 128 / 8, // encryption keyl - 160 / 8, // authentication key len - 112 / 8, // session salt len - 80 / 8); // authentication tag len + outputCryptoCtx = new ost::CryptoContext(getLocalSSRCNetwork(), + 0, // roc, + 0L, // keydr, + SrtpEncryptionAESCM, // encryption algo + SrtpAuthenticationSha1Hmac, // authtication algo + _masterKey, // Master Key + 128 / 8, // Master Key length + _masterSalt, // Master Salt + 112 / 8, // Master Salt length + 128 / 8, // encryption keyl + 160 / 8, // authentication key len + 112 / 8, // session salt len + 80 / 8); // authentication tag len } }