From 9091c20f9fee11023bd794bc0b1628909caef5d2 Mon Sep 17 00:00:00 2001
From: Alexandre Savard <alexandresavard@alexandresavard-desktop.(none)>
Date: Fri, 8 Jan 2010 11:15:42 -0500
Subject: [PATCH] [#1722] Crypto context for incoming data must be init with
 SSRC 0x0

---
 .../src/audio/audiortp/AudioSrtpSession.cpp   | 34 +++++++++++--------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp b/sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp
index e233870821..d3d1d83cdb 100644
--- a/sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp
+++ b/sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp
@@ -72,26 +72,30 @@ void AudioSrtpSession::initializeMasterSalt(void)
 void AudioSrtpSession::initializeInputCryptoContext(void)
 {
 
-    inputCryptoCtx = new ost::CryptoContext(IncomingDataQueue::getLocalSSRC(),
-					    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
-
-    _debug("********************* Crypto Context IN with SSRC %i ******************", IncomingDataQueue::getLocalSSRC());
+  // this one does not works
+  // inputCryptoCtx = new ost::CryptoContext(IncomingDataQueue::getLocalSSRCNetwork(),
+  inputCryptoCtx = new ost::CryptoContext(0x0,
+					  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
+
+    _debug("********************* Crypto Context IN with SSRC %i ******************", IncomingDataQueue::getLocalSSRCNetwork());
 }
 
 void AudioSrtpSession::initializeOutputCryptoContext(void)
 {
 
+  // this one works
+  // outputCryptoCtx = new ost::CryptoContext(OutgoingDataQueue::getLocalSSRC(),
     outputCryptoCtx = new ost::CryptoContext(OutgoingDataQueue::getLocalSSRC(),
 					     0,                           // roc,
 					     0L,                          // keydr,
-- 
GitLab