Commit ed58b69e authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Stepan Salenikovich

remove dead code about ZRTP

ZRTP is not longer supported since long now.
Many code and API are deprecated and public API is stubbed.
This patch removes all this dead code.

Change-Id: Id86315ecf461deee7c81b303e19a5d4d9b5c3cc1
Tuleap: #889
parent 0dc32710
......@@ -746,74 +746,12 @@
<arg type="s" name="callID" />
</signal>
<!-- ZRTP Methods and Signals -->
<signal name="secureZrtpOn" tp:name-for-bindings="secureZrtpOn">
<tp:added version="0.9.7"/>
<arg type="s" name="callID" />
<arg type="s" name="cipher" />
</signal>
<signal name="secureZrtpOff" tp:name-for-bindings="secureZrtpOff">
<tp:added version="0.9.7"/>
<arg type="s" name="callID" />
</signal>
<signal name="confirmGoClear" tp:name-for-bindings="confirmGoClear">
<tp:added version="0.9.7"/>
<arg type="s" name="callID" />
</signal>
<signal name="recordingStateChanged" tp:name-for-bindings="recordingStateChange">
<tp:added version="1.3.0"/>
<arg type="s" name="callID" />
<arg type="b" name="recordingState"/>
</signal>
<signal name="zrtpNegotiationFailed" tp:name-for-bindings="zrtpNegotiationFailed">
<tp:added version="0.9.7"/>
<arg type="s" name="callID" />
<arg type="s" name="reason" />
<arg type="s" name="severity" />
</signal>
<signal name="zrtpNotSuppOther" tp:name-for-bindings="zrtpNotSuppOther">
<tp:added version="0.9.7"/>
<arg type="s" name="callID" />
</signal>
<signal name="showSAS" tp:name-for-bindings="showSAS">
<tp:added version="0.9.7"/>
<arg type="s" name="callID" />
<arg type="s" name="sas" />
<arg type="b" name="verified"/>
</signal>
<method name="setSASVerified" tp:name-for-bindings="setSASVerified">
<tp:added version="0.9.7"/>
<arg type="s" name="callID" direction="in"/>
</method>
<method name="resetSASVerified" tp:name-for-bindings="resetSASVerified">
<tp:added version="0.9.7"/>
<arg type="s" name="callID" direction="in"/>
</method>
<method name="setConfirmGoClear" tp:name-for-bindings="setConfirmGoClear">
<tp:added version="0.9.7"/>
<arg type="s" name="callID" direction="in"/>
</method>
<method name="requestGoClear" tp:name-for-bindings="requestGoClear">
<tp:added version="0.9.7"/>
<arg type="s" name="callID" direction="in"/>
</method>
<method name="acceptEnrollment" tp:name-for-bindings="acceptEnrollment">
<tp:added version="0.9.7"/>
<arg type="s" name="callID" direction="in"/>
<arg type="b" name="accepted" direction="in"/>
</method>
<signal name="onRtcpReportReceived" tp:name-for-bindings="onRtcpReportReceived">
<tp:added version="1.3.0"/>
<tp:docstring>
......
......@@ -53,10 +53,6 @@
<li>SRTP_KEY_EXCHANGE</li>
<li>SRTP_ENABLE: Whether or not voice communication are encrypted - True or False (Default: False)</li>
<li>SRTP_RTP_FALLBACK</li>
<li>ZRTP_DISPLAY_SAS</li>
<li>ZRTP_DISPLAY_SAS_ONCE</li>
<li>ZRTP_HELLO_HASH</li>
<li>ZRTP_NOT_SUPP_WARNING</li>
<li>TLS_LISTENER_PORT: TLS listening port (Default: 5061)</li>
<li>TLS_ENABLE: Whether or not signalling is encrypted - True or False (Default: False)</li>
<li>TLS_CA_LIST_FILE</li>
......
......@@ -248,36 +248,6 @@ DBusCallManager::startTone(const int32_t& start, const int32_t& type)
DRing::startTone(start, type);
}
void
DBusCallManager::setSASVerified(const std::string& callID)
{
DRing::setSASVerified(callID);
}
void
DBusCallManager::resetSASVerified(const std::string& callID)
{
DRing::resetSASVerified(callID);
}
void
DBusCallManager::setConfirmGoClear(const std::string& callID)
{
DRing::setConfirmGoClear(callID);
}
void
DBusCallManager::requestGoClear(const std::string& callID)
{
DRing::requestGoClear(callID);
}
void
DBusCallManager::acceptEnrollment(const std::string& callID, const bool& accepted)
{
DRing::acceptEnrollment(callID, accepted);
}
void
DBusCallManager::sendTextMessage(const std::string& callID, const std::map<std::string, std::string>& messages, const bool& isMixed)
{
......
......@@ -91,11 +91,6 @@ class DBusCallManager :
std::string getCurrentAudioCodecName(const std::string& callID);
void playDTMF(const std::string& key);
void startTone(const int32_t& start, const int32_t& type);
void setSASVerified(const std::string& callID);
void resetSASVerified(const std::string& callID);
void setConfirmGoClear(const std::string& callID);
void requestGoClear(const std::string& callID);
void acceptEnrollment(const std::string& callID, const bool& accepted);
void sendTextMessage(const std::string& callID, const std::map<std::string, std::string>& messages, const bool& isMixed);
void startSmartInfo(const uint32_t& refreshTimeMs);
void stopSmartInfo();
......
......@@ -158,11 +158,6 @@ DBusClient::initLibrary(int flags)
exportable_callback<CallSignal::RecordingStateChanged>(bind(&DBusCallManager::recordingStateChanged, callM, _1, _2)),
exportable_callback<CallSignal::SecureSdesOn>(bind(&DBusCallManager::secureSdesOn, callM, _1)),
exportable_callback<CallSignal::SecureSdesOff>(bind(&DBusCallManager::secureSdesOff, callM, _1)),
exportable_callback<CallSignal::SecureZrtpOn>(bind(&DBusCallManager::secureZrtpOn, callM, _1, _2)),
exportable_callback<CallSignal::SecureZrtpOff>(bind(&DBusCallManager::secureZrtpOff, callM, _1)),
exportable_callback<CallSignal::ShowSAS>(bind(&DBusCallManager::showSAS, callM, _1, _2, _3)),
exportable_callback<CallSignal::ZrtpNotSuppOther>(bind(&DBusCallManager::zrtpNotSuppOther, callM, _1)),
exportable_callback<CallSignal::ZrtpNegotiationFailed>(bind(&DBusCallManager::zrtpNegotiationFailed, callM, _1, _2, _3)),
exportable_callback<CallSignal::RtcpReportReceived>(bind(&DBusCallManager::onRtcpReportReceived, callM, _1, _2)),
exportable_callback<CallSignal::PeerHold>(bind(&DBusCallManager::peerHold, callM, _1, _2)),
exportable_callback<CallSignal::AudioMuted>(bind(&DBusCallManager::audioMuted, callM, _1, _2)),
......
......@@ -80,10 +80,6 @@ static const char *const CONFIG_TURN_SERVER_REALM = "TURN.realm";
static const char *const CONFIG_SRTP_ENABLE = "SRTP.enable";
static const char *const CONFIG_SRTP_KEY_EXCHANGE = "SRTP.keyExchange";
static const char *const CONFIG_SRTP_RTP_FALLBACK = "SRTP.rtpFallback";
static const char *const CONFIG_ZRTP_HELLO_HASH = "ZRTP.helloHashEnable";
static const char *const CONFIG_ZRTP_DISPLAY_SAS = "ZRTP.displaySAS";
static const char *const CONFIG_ZRTP_NOT_SUPP_WARNING = "ZRTP.notSuppWarning";
static const char *const CONFIG_ZRTP_DISPLAY_SAS_ONCE = "ZRTP.displaySasOnce";
static const char *const CONFIG_TLS_LISTENER_PORT = "TLS.listenerPort";
static const char *const CONFIG_TLS_ENABLE = "TLS.enable";
......
......@@ -305,36 +305,6 @@ switchInput(const std::string& callID, const std::string& resource)
return ring::Manager::instance().switchInput(callID, resource);
}
void
setSASVerified(const std::string& /*callID*/)
{
RING_ERR("ZRTP not supported");
}
void
resetSASVerified(const std::string& /*callID*/)
{
RING_ERR("ZRTP not supported");
}
void
setConfirmGoClear(const std::string& /*callID*/)
{
RING_ERR("ZRTP not supported");
}
void
requestGoClear(const std::string& /*callID*/)
{
RING_ERR("ZRTP not supported");
}
void
acceptEnrollment(const std::string& /*callID*/, bool /*accepted*/)
{
RING_ERR("ZRTP not supported");
}
void
sendTextMessage(const std::string& callID, const std::map<std::string, std::string>& messages, const std::string& from, bool isMixed)
{
......
......@@ -44,11 +44,6 @@ getSignalHandlers()
exported_callback<DRing::CallSignal::RecordingStateChanged>(),
exported_callback<DRing::CallSignal::SecureSdesOn>(),
exported_callback<DRing::CallSignal::SecureSdesOff>(),
exported_callback<DRing::CallSignal::SecureZrtpOn>(),
exported_callback<DRing::CallSignal::SecureZrtpOff>(),
exported_callback<DRing::CallSignal::ShowSAS>(),
exported_callback<DRing::CallSignal::ZrtpNotSuppOther>(),
exported_callback<DRing::CallSignal::ZrtpNegotiationFailed>(),
exported_callback<DRing::CallSignal::RtcpReportReceived>(),
exported_callback<DRing::CallSignal::PeerHold>(),
exported_callback<DRing::CallSignal::VideoMuted>(),
......
......@@ -189,16 +189,6 @@ constexpr static const char RTP_FALLBACK [] = "SRTP.rtpFallback";
} //namespace DRing::Account::ConfProperties::SRTP
namespace ZRTP {
constexpr static const char DISPLAY_SAS [] = "ZRTP.displaySAS";
constexpr static const char NOT_SUPP_WARNING [] = "ZRTP.notSuppWarning";
constexpr static const char HELLO_HASH [] = "ZRTP.helloHashEnable";
constexpr static const char DISPLAY_SAS_ONCE [] = "ZRTP.displaySasOnce";
} //namespace DRing::Account::ConfProperties::ZRTP
namespace TLS {
constexpr static const char LISTENER_PORT [] = "TLS.listenerPort";
......
......@@ -168,26 +168,6 @@ struct CallSignal {
constexpr static const char* name = "SecureSdesOff";
using cb_type = void(const std::string&);
};
struct SecureZrtpOn {
constexpr static const char* name = "SecureZrtpOn";
using cb_type = void(const std::string&, const std::string&);
};
struct SecureZrtpOff {
constexpr static const char* name = "SecureZrtpOff";
using cb_type = void(const std::string&);
};
struct ShowSAS {
constexpr static const char* name = "ShowSAS";
using cb_type = void(const std::string&, const std::string&, int);
};
struct ZrtpNotSuppOther {
constexpr static const char* name = "ZrtpNotSuppOther";
using cb_type = void(const std::string&);
};
struct ZrtpNegotiationFailed {
constexpr static const char* name = "ZrtpNegotiationFailed";
using cb_type = void(const std::string&, const std::string&, const std::string&);
};
struct RtcpReportReceived {
constexpr static const char* name = "RtcpReportReceived";
using cb_type = void(const std::string&, const std::map<std::string, int>&);
......
......@@ -123,7 +123,6 @@ static const char * const TOGGLE_HOLD_SHORT_KEY = "toggleHold";
static const char * const TOGGLE_PICKUP_HANGUP_SHORT_KEY = "togglePickupHangup";
static const char * const DFT_PULSE_LENGTH_STR = "250"; /** Default DTMF lenght */
static const char * const ZRTP_ZIDFILE = "zidFile"; /** The filename used for storing ZIDs */
static const char * const ALSA_DFT_CARD = "0"; /** Default sound card index */
Preferences::Preferences() :
......@@ -215,7 +214,6 @@ VoipPreference::VoipPreference() :
, playTones_(true)
, pulseLength_(atoi(DFT_PULSE_LENGTH_STR))
, symmetricRtp_(true)
, zidFile_(ZRTP_ZIDFILE)
{}
void VoipPreference::serialize(YAML::Emitter &out)
......
......@@ -62,7 +62,6 @@ Sdp::Sdp(const std::string& id)
, publishedIpAddr_()
, publishedIpAddrType_()
, sdesNego_ {CryptoSuites}
, zrtpHelloHash_()
, telephoneEventPayload_(101) // same as asterisk
{
memPool_.reset(pj_pool_create(&getSIPVoIPLink()->getCachingPool()->factory,
......@@ -255,10 +254,7 @@ Sdp::setMediaDescriptorLines(bool audio, bool holding, sip_utils::KeyExchangePro
if (kx == sip_utils::KeyExchangeProtocol::SDES) {
if (pjmedia_sdp_media_add_attr(med, generateSdesAttribute()) != PJ_SUCCESS)
SdpException("Could not add sdes attribute to media");
} /* else if (kx == sip_utils::KeyExchangeProtocol::ZRTP) {
if (!zrtpHelloHash_.empty())
addZrtpAttribute(med, zrtpHelloHash_);
} */
}
return med;
}
......@@ -648,16 +644,6 @@ Sdp::getMediaSlots() const
return s;
}
void Sdp::addZrtpAttribute(pjmedia_sdp_media* media, std::string hash)
{
/* Format: ":version value" */
std::string val = "1.10 " + hash;
pj_str_t value = { (char*)val.c_str(), static_cast<pj_ssize_t>(val.size()) };
pjmedia_sdp_attr *attr = pjmedia_sdp_attr_create(memPool_.get(), "zrtp-hash", &value);
if (pjmedia_sdp_media_add_attr(media, attr) != PJ_SUCCESS)
throw SdpException("Could not add zrtp attribute to media");
}
void
Sdp::addIceCandidates(unsigned media_index, const std::vector<std::string>& cands)
{
......
......@@ -202,16 +202,6 @@ class Sdp {
using MediaSlot = std::pair<MediaDescription, MediaDescription>;
std::vector<MediaSlot> getMediaSlots() const;
/**
* Set the zrtp hash that was previously calculated from the hello message in the zrtp layer.
* This hash value is unique at the media level. Therefore, if video support is added, one would
* have to set the correct zrtp-hash value in the corresponding media section.
* @param hash The hello hash of a rtp session. (Only audio at the moment)
*/
void setZrtpHash(const std::string& hash) {
zrtpHelloHash_ = hash;
}
unsigned int getTelephoneEventType() const {
return telephoneEventPayload_;
}
......@@ -290,7 +280,6 @@ class Sdp {
int localVideoControlPort_ {0};
SdesNegotiator sdesNego_;
std::string zrtpHelloHash_;
unsigned int telephoneEventPayload_;
......@@ -326,18 +315,6 @@ class Sdp {
*/
void addSdesAttribute(const std::vector<std::string>& crypto);
/*
* Adds a zrtp-hash attribute to
* the given media section. The hello hash is
* available only after is has been computed
* in the AudioZrtpSession constructor.
*
* @param media The media to add the zrtp-hash attribute to
* @param hash The hash to which the attribute should be set to
* @throw SdpException
*/
void addZrtpAttribute(pjmedia_sdp_media* media, std::string hash);
void addRTCPAttribute(pjmedia_sdp_media *med);
std::shared_ptr<AccountCodecInfo> findCodecByPayload(const unsigned payloadType);
......
......@@ -43,11 +43,10 @@ namespace ring { namespace sip_utils {
static constexpr int DEFAULT_SIP_PORT {5060};
static constexpr int DEFAULT_SIP_TLS_PORT {5061};
enum class KeyExchangeProtocol { NONE, SDES, ZRTP };
enum class KeyExchangeProtocol { NONE, SDES };
constexpr const char* getKeyExchangeName(KeyExchangeProtocol kx) {
return kx == KeyExchangeProtocol::SDES ? "sdes" : (
kx == KeyExchangeProtocol::ZRTP ? "zrtp" : "");
static constexpr const char* getKeyExchangeName(KeyExchangeProtocol kx) {
return kx == KeyExchangeProtocol::SDES ? "sdes" : "";
}
static inline KeyExchangeProtocol getKeyExchangeProtocol(const char* name) {
......
......@@ -125,10 +125,6 @@ SIPAccount::SIPAccount(const std::string& accountID, bool presenceEnabled)
, tlsVerifyClient_(true)
, tlsRequireClientCertificate_(true)
, tlsNegotiationTimeoutSec_("2")
, zrtpDisplaySas_(true)
, zrtpDisplaySasOnce_(false)
, zrtpHelloHash_(true)
, zrtpNotSuppWarning_(true)
, registrationStateDetailed_()
, keepAliveEnabled_(false)
, keepAliveTimer_()
......@@ -442,14 +438,6 @@ void SIPAccount::serialize(YAML::Emitter &out)
out << YAML::Key << Conf::RTP_FALLBACK_KEY << YAML::Value << srtpFallback_;
out << YAML::EndMap;
// zrtp submap
out << YAML::Key << Conf::ZRTP_KEY << YAML::Value << YAML::BeginMap;
out << YAML::Key << Conf::DISPLAY_SAS_KEY << YAML::Value << zrtpDisplaySas_;
out << YAML::Key << Conf::DISPLAY_SAS_ONCE_KEY << YAML::Value << zrtpDisplaySasOnce_;
out << YAML::Key << Conf::HELLO_HASH_ENABLED_KEY << YAML::Value << zrtpHelloHash_;
out << YAML::Key << Conf::NOT_SUPP_WARNING_KEY << YAML::Value << zrtpNotSuppWarning_;
out << YAML::EndMap;
out << YAML::EndMap;
}
......@@ -518,14 +506,6 @@ void SIPAccount::unserialize(const YAML::Node &node)
Conf::CONFIG_ACCOUNT_PASSWORD
}));
// get zrtp submap
const auto &zrtpMap = node[Conf::ZRTP_KEY];
parseValue(zrtpMap, Conf::DISPLAY_SAS_KEY, zrtpDisplaySas_);
parseValue(zrtpMap, Conf::DISPLAY_SAS_ONCE_KEY, zrtpDisplaySasOnce_);
parseValue(zrtpMap, Conf::HELLO_HASH_ENABLED_KEY, zrtpHelloHash_);
parseValue(zrtpMap, Conf::NOT_SUPP_WARNING_KEY, zrtpNotSuppWarning_);
// get tls submap
const auto &tlsMap = node[Conf::TLS_KEY];
......@@ -574,12 +554,6 @@ void SIPAccount::setAccountDetails(const std::map<std::string, std::string> &det
parseBool(details, Conf::CONFIG_PRESENCE_ENABLED, presenceEnabled);
enablePresence(presenceEnabled);
// srtp settings
parseBool(details, Conf::CONFIG_ZRTP_DISPLAY_SAS, zrtpDisplaySas_);
parseBool(details, Conf::CONFIG_ZRTP_DISPLAY_SAS_ONCE, zrtpDisplaySasOnce_);
parseBool(details, Conf::CONFIG_ZRTP_NOT_SUPP_WARNING, zrtpNotSuppWarning_);
parseBool(details, Conf::CONFIG_ZRTP_HELLO_HASH, zrtpHelloHash_);
// TLS settings
parseBool(details, Conf::CONFIG_TLS_ENABLE, tlsEnable_);
parseInt(details, Conf::CONFIG_TLS_LISTENER_PORT, tlsListenerPort_);
......@@ -645,10 +619,7 @@ SIPAccount::getAccountDetails() const
a.emplace(Conf::CONFIG_SRTP_KEY_EXCHANGE, sip_utils::getKeyExchangeName(srtpKeyExchange_));
a.emplace(Conf::CONFIG_SRTP_ENABLE, isSrtpEnabled() ? TRUE_STR : FALSE_STR);
a.emplace(Conf::CONFIG_SRTP_RTP_FALLBACK, srtpFallback_ ? TRUE_STR : FALSE_STR);
a.emplace(Conf::CONFIG_ZRTP_DISPLAY_SAS, zrtpDisplaySas_ ? TRUE_STR : FALSE_STR);
a.emplace(Conf::CONFIG_ZRTP_DISPLAY_SAS_ONCE, zrtpDisplaySasOnce_ ? TRUE_STR : FALSE_STR);
a.emplace(Conf::CONFIG_ZRTP_HELLO_HASH, zrtpHelloHash_ ? TRUE_STR : FALSE_STR);
a.emplace(Conf::CONFIG_ZRTP_NOT_SUPP_WARNING, zrtpNotSuppWarning_ ? TRUE_STR : FALSE_STR);
return a;
}
......
......@@ -55,13 +55,6 @@ namespace Conf {
const char *const SRTP_ENABLE_KEY = "enable";
const char *const KEY_EXCHANGE_KEY = "keyExchange";
const char *const RTP_FALLBACK_KEY = "rtpFallback";
// TODO: wirte an object to store zrtp params wich implement serializable
const char *const ZRTP_KEY = "zrtp";
const char *const DISPLAY_SAS_KEY = "displaySas";
const char *const DISPLAY_SAS_ONCE_KEY = "displaySasOnce";
const char *const HELLO_HASH_ENABLED_KEY = "helloHashEnabled";
const char *const NOT_SUPP_WARNING_KEY = "notSuppWarning";
}
typedef std::vector<pj_ssl_cipher> CipherArray;
......@@ -386,10 +379,6 @@ class SIPAccount : public SIPAccountBase {
return srtpFallback_;
}
bool getZrtpHelloHash() const {
return zrtpHelloHash_;
}
void setReceivedParameter(const std::string &received) {
receivedParameter_ = received;
via_addr_.host.ptr = (char *) receivedParameter_.c_str();
......@@ -683,7 +672,7 @@ class SIPAccount : public SIPAccountBase {
std::string tlsNegotiationTimeoutSec_;
/**
* Specifies the type of key exchange used for SRTP (sdes/zrtp), if any.
* Specifies the type of key exchange used for SRTP, if any.
* This only determine if the media channel is secured.
*/
sip_utils::KeyExchangeProtocol srtpKeyExchange_ {sip_utils::KeyExchangeProtocol::NONE};
......@@ -695,21 +684,6 @@ class SIPAccount : public SIPAccountBase {
*/
bool srtpFallback_ {};
/**
* Determine if the SAS sould be displayed on client side. SAS is a 4-charcter string
* that end users should verbaly validate to ensure the channel is secured. Used especially
* to prevent man-in-the-middle attack.
*/
bool zrtpDisplaySas_;
/**
* Only display SAS 4-character string once at the begining of the call.
*/
bool zrtpDisplaySasOnce_;
bool zrtpHelloHash_;
bool zrtpNotSuppWarning_;
/**
* Details about the registration state.
* This is a protocol Code:Description pair.
......
......@@ -139,7 +139,7 @@ public:
/**
* Determine if TLS is enabled for this account. TLS provides a secured channel for
* SIP signalization. It is independant than the media encription provided by SRTP or ZRTP.
* SIP signalization. It is independant of the media encription (as provided by SRTP).
*/
virtual bool isTlsEnabled() const {
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment