Commit b264aa7b authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee Committed by Emmanuel Lepage Vallée

account: Add allow incoming call from trusted certificate setting

It currently does nothing

Refs #77697

Change-Id: I2ce39b8cab18bf8adeceb62e55ff8159a3828d25
parent 44c221e7
......@@ -120,6 +120,7 @@ constexpr static const char UPNP_ENABLED [] = "Account.upnpEnabled";
constexpr static const char HAS_CUSTOM_USER_AGENT [] = "Account.hasCustomUserAgent";
constexpr static const char ALLOW_CERT_FROM_HISTORY [] = "Account.allowCertFromHistory";
constexpr static const char ALLOW_CERT_FROM_CONTACT [] = "Account.allowCertFromContact";
constexpr static const char ALLOW_CERT_FROM_TRUSTED [] = "Account.allowCertFromTrusted";
namespace Audio {
......@@ -214,6 +215,7 @@ namespace DHT {
constexpr static const char PORT [] = "DHT.port";
constexpr static const char PUBLIC_IN_CALLS [] = "DHT.PublicInCalls";
constexpr static const char ALLOW_FROM_TRUSTED [] = "DHT.AllowFromTrusted";
} //namespace DRing::Account::DHT
......
......@@ -381,6 +381,7 @@ void RingAccount::serialize(YAML::Emitter &out)
out << YAML::Key << Conf::DHT_PUBLIC_IN_CALLS << YAML::Value << dhtPublicInCalls_;
out << YAML::Key << Conf::DHT_ALLOW_PEERS_FROM_HISTORY << YAML::Value << allowPeersFromHistory_;
out << YAML::Key << Conf::DHT_ALLOW_PEERS_FROM_CONTACT << YAML::Value << allowPeersFromContact_;
out << YAML::Key << Conf::DHT_ALLOW_PEERS_FROM_TRUSTED << YAML::Value << allowPeersFromTrusted_;
// tls submap
out << YAML::Key << Conf::TLS_KEY << YAML::Value << YAML::BeginMap;
......@@ -398,6 +399,7 @@ void RingAccount::unserialize(const YAML::Node &node)
parseValue(node, Conf::DHT_PORT_KEY, dhtPort_);
parseValue(node, Conf::DHT_ALLOW_PEERS_FROM_HISTORY, allowPeersFromHistory_);
parseValue(node, Conf::DHT_ALLOW_PEERS_FROM_CONTACT, allowPeersFromContact_);
parseValue(node, Conf::DHT_ALLOW_PEERS_FROM_TRUSTED, allowPeersFromTrusted_);
if (not dhtPort_)
dhtPort_ = getRandomEvenPort(DHT_PORT_RANGE);
dhtPortUsed_ = dhtPort_;
......@@ -480,6 +482,7 @@ void RingAccount::setAccountDetails(const std::map<std::string, std::string> &de
parseBool(details, Conf::CONFIG_DHT_PUBLIC_IN_CALLS, dhtPublicInCalls_);
parseBool(details, DRing::Account::ConfProperties::ALLOW_CERT_FROM_HISTORY, allowPeersFromHistory_);
parseBool(details, DRing::Account::ConfProperties::ALLOW_CERT_FROM_CONTACT, allowPeersFromContact_);
parseBool(details, DRing::Account::ConfProperties::ALLOW_CERT_FROM_TRUSTED, allowPeersFromTrusted_);
if (not dhtPort_)
dhtPort_ = getRandomEvenPort(DHT_PORT_RANGE);
dhtPortUsed_ = dhtPort_;
......@@ -506,6 +509,7 @@ std::map<std::string, std::string> RingAccount::getAccountDetails() const
a.emplace(Conf::CONFIG_TLS_REQUIRE_CLIENT_CERTIFICATE, TRUE_STR);
a.emplace(DRing::Account::ConfProperties::ALLOW_CERT_FROM_HISTORY, allowPeersFromHistory_?TRUE_STR:FALSE_STR);
a.emplace(DRing::Account::ConfProperties::ALLOW_CERT_FROM_CONTACT, allowPeersFromContact_?TRUE_STR:FALSE_STR);
a.emplace(DRing::Account::ConfProperties::ALLOW_CERT_FROM_TRUSTED, allowPeersFromTrusted_?TRUE_STR:FALSE_STR);
/* GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT is defined as -1 */
a.emplace(Conf::CONFIG_TLS_NEGOTIATION_TIMEOUT_SEC, "-1");
......
......@@ -73,6 +73,7 @@ const char *const DHT_PUBLIC_PROFILE = "dhtPublicProfile";
const char *const DHT_PUBLIC_IN_CALLS = "dhtPublicInCalls";
const char *const DHT_ALLOW_PEERS_FROM_HISTORY = "allowPeersFromHistory";
const char *const DHT_ALLOW_PEERS_FROM_CONTACT = "allowPeersFromContact";
const char *const DHT_ALLOW_PEERS_FROM_TRUSTED = "allowPeersFromTrusted";
}
class IceTransport;
......@@ -384,6 +385,7 @@ class RingAccount : public SIPAccountBase {
std::condition_variable dhParamsCv_;
bool allowPeersFromHistory_;
bool allowPeersFromContact_;
bool allowPeersFromTrusted_;
/**
* Optional: "received" parameter from VIA header
......
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