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

[#3929] Shield ZRTP related method in callmanager against wrong call ids

parent a85ad72d
No related branches found
No related tags found
No related merge requests found
...@@ -333,18 +333,23 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal ...@@ -333,18 +333,23 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal
SIPVoIPLink * link = NULL; SIPVoIPLink * link = NULL;
link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (AccountNULL)); link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (AccountNULL));
if (link == NULL) { if (!link) {
_debug ("Failed to get sip link"); _debug ("CallManager: Failed to get sip link");
throw CallManagerException(); throw CallManagerException();
} }
SIPCall *call = link->getSIPCall (callID); SIPCall *call = link->getSIPCall (callID);
if (!call) {
_debug ("CallManager: Call id %d is not valid", callID.c_str());
throw CallManagerException();
}
sfl::AudioRtpFactory * audioRtp = NULL; sfl::AudioRtpFactory * audioRtp = NULL;
audioRtp = call->getAudioRtp(); audioRtp = call->getAudioRtp();
if (audioRtp == NULL) { if (!audioRtp) {
_debug ("Failed to get AudioRtpFactory"); _debug ("CallManager: Failed to get AudioRtpFactory");
throw CallManagerException(); throw CallManagerException();
} }
...@@ -352,8 +357,8 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal ...@@ -352,8 +357,8 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal
zSession = audioRtp->getAudioZrtpSession(); zSession = audioRtp->getAudioZrtpSession();
if (zSession == NULL) { if (!zSession) {
_debug ("Failed to get AudioZrtpSession"); _debug ("CallManager: Failed to get AudioZrtpSession");
throw CallManagerException(); throw CallManagerException();
} }
...@@ -369,7 +374,8 @@ CallManager::setSASVerified (const std::string& callID) ...@@ -369,7 +374,8 @@ CallManager::setSASVerified (const std::string& callID)
zSession = getAudioZrtpSession (callID); zSession = getAudioZrtpSession (callID);
zSession->SASVerified(); zSession->SASVerified();
} catch (...) { } catch (...) {
throw; return;
// throw;
} }
} }
...@@ -383,7 +389,8 @@ CallManager::resetSASVerified (const std::string& callID) ...@@ -383,7 +389,8 @@ CallManager::resetSASVerified (const std::string& callID)
zSession = getAudioZrtpSession (callID); zSession = getAudioZrtpSession (callID);
zSession->resetSASVerified(); zSession->resetSASVerified();
} catch (...) { } catch (...) {
throw; return;
// throw;
} }
} }
...@@ -398,7 +405,8 @@ CallManager::setConfirmGoClear (const std::string& callID) ...@@ -398,7 +405,8 @@ CallManager::setConfirmGoClear (const std::string& callID)
zSession = getAudioZrtpSession (callID); zSession = getAudioZrtpSession (callID);
zSession->goClearOk(); zSession->goClearOk();
} catch (...) { } catch (...) {
throw; return;
// throw;
} }
} }
...@@ -413,7 +421,8 @@ CallManager::requestGoClear (const std::string& callID) ...@@ -413,7 +421,8 @@ CallManager::requestGoClear (const std::string& callID)
zSession = getAudioZrtpSession (callID); zSession = getAudioZrtpSession (callID);
zSession->requestGoClear(); zSession->requestGoClear();
} catch (...) { } catch (...) {
throw; return;
/// throw;
} }
} }
...@@ -429,7 +438,8 @@ CallManager::acceptEnrollment (const std::string& callID, const bool& accepted) ...@@ -429,7 +438,8 @@ CallManager::acceptEnrollment (const std::string& callID, const bool& accepted)
zSession = getAudioZrtpSession (callID); zSession = getAudioZrtpSession (callID);
zSession->acceptEnrollment (accepted); zSession->acceptEnrollment (accepted);
} catch (...) { } catch (...) {
throw; return;
// throw;
} }
} }
...@@ -445,7 +455,8 @@ CallManager::setPBXEnrollment (const std::string& callID, const bool& yesNo) ...@@ -445,7 +455,8 @@ CallManager::setPBXEnrollment (const std::string& callID, const bool& yesNo)
zSession = getAudioZrtpSession (callID); zSession = getAudioZrtpSession (callID);
zSession->setPBXEnrollment (yesNo); zSession->setPBXEnrollment (yesNo);
} catch (...) { } catch (...) {
throw; return;
// throw;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment