Skip to content
Snippets Groups Projects
Commit 2abc0d2c authored by Alexandre Savard's avatar Alexandre Savard
Browse files

Merge branch 'fix_srtp' of git+ssh://git.sflphone.org/var/repos/sflphone/git/sflphone into fix_srtp

parents aadc235d 5bfe2bac
No related branches found
No related tags found
No related merge requests found
...@@ -51,8 +51,6 @@ AudioRtpFactory::AudioRtpFactory(SIPCall *ca) : rtpSession_(NULL), ...@@ -51,8 +51,6 @@ AudioRtpFactory::AudioRtpFactory(SIPCall *ca) : rtpSession_(NULL),
AudioRtpFactory::~AudioRtpFactory() AudioRtpFactory::~AudioRtpFactory()
{ {
delete rtpSession_; delete rtpSession_;
delete cachedLocalContext_;
delete cachedRemoteContext_;
} }
void AudioRtpFactory::initConfig() void AudioRtpFactory::initConfig()
......
...@@ -262,7 +262,7 @@ void AudioSrtpSession::initializeRemoteCryptoContext() ...@@ -262,7 +262,7 @@ void AudioSrtpSession::initializeRemoteCryptoContext()
{ {
DEBUG("AudioSrtp: Initialize remote crypto context"); DEBUG("AudioSrtp: Initialize remote crypto context");
CryptoSuiteDefinition crypto = sfl::CryptoSuites[remoteCryptoSuite_]; const CryptoSuiteDefinition &crypto = sfl::CryptoSuites[remoteCryptoSuite_];
delete remoteCryptoCtx_; delete remoteCryptoCtx_;
remoteCryptoCtx_ = new ost::CryptoContext(0x0, remoteCryptoCtx_ = new ost::CryptoContext(0x0,
...@@ -285,7 +285,7 @@ void AudioSrtpSession::initializeLocalCryptoContext() ...@@ -285,7 +285,7 @@ void AudioSrtpSession::initializeLocalCryptoContext()
{ {
DEBUG("AudioSrtp: Initialize local crypto context"); DEBUG("AudioSrtp: Initialize local crypto context");
CryptoSuiteDefinition crypto = sfl::CryptoSuites[localCryptoSuite_]; const CryptoSuiteDefinition &crypto = sfl::CryptoSuites[localCryptoSuite_];
delete localCryptoCtx_; delete localCryptoCtx_;
localCryptoCtx_ = new ost::CryptoContext(OutgoingDataQueue::getLocalSSRC(), localCryptoCtx_ = new ost::CryptoContext(OutgoingDataQueue::getLocalSSRC(),
...@@ -306,10 +306,14 @@ void AudioSrtpSession::initializeLocalCryptoContext() ...@@ -306,10 +306,14 @@ void AudioSrtpSession::initializeLocalCryptoContext()
void AudioSrtpSession::restoreCryptoContext(ost::CryptoContext *localContext, void AudioSrtpSession::restoreCryptoContext(ost::CryptoContext *localContext,
ost::CryptoContext *remoteContext) ost::CryptoContext *remoteContext)
{ {
delete remoteCryptoCtx_; if (remoteCryptoCtx_ != remoteContext) {
remoteCryptoCtx_ = remoteContext; delete remoteCryptoCtx_;
delete localCryptoCtx_; remoteCryptoCtx_ = remoteContext;
localCryptoCtx_ = localContext; }
if (localCryptoCtx_ != localContext) {
delete localCryptoCtx_;
localCryptoCtx_ = localContext;
}
setInQueueCryptoContext(remoteCryptoCtx_); setInQueueCryptoContext(remoteCryptoCtx_);
setOutQueueCryptoContext(localCryptoCtx_); setOutQueueCryptoContext(localCryptoCtx_);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment