From ea06be268244f6bd4bdcf875bca64ac6bfe077d5 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Tue, 25 Jul 2023 16:37:18 +0200 Subject: [PATCH] candidate: do not log full IP addresses for related address MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit since this may contain sensitive data, just like the address. BUG=None Change-Id: I3faa1512a15467cd5cc4bcbcaebadb736f1bae07 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/313040 Reviewed-by: Harald Alvestrand Commit-Queue: Philipp Hancke Reviewed-by: Henrik Boström Cr-Commit-Position: refs/heads/main@{#40473} --- api/candidate.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/candidate.cc b/api/candidate.cc index 53a48269a0..90cb326823 100644 --- a/api/candidate.cc +++ b/api/candidate.cc @@ -78,11 +78,12 @@ std::string Candidate::ToStringInternal(bool sensitive) const { rtc::StringBuilder ost; std::string address = sensitive ? address_.ToSensitiveString() : address_.ToString(); + std::string related_address = sensitive ? related_address_.ToSensitiveString() + : related_address_.ToString(); ost << "Cand[" << transport_name_ << ":" << foundation_ << ":" << component_ << ":" << protocol_ << ":" << priority_ << ":" << address << ":" << type_ - << ":" << related_address_.ToString() << ":" << username_ << ":" - << password_ << ":" << network_id_ << ":" << network_cost_ << ":" - << generation_ << "]"; + << ":" << related_address << ":" << username_ << ":" << password_ << ":" + << network_id_ << ":" << network_cost_ << ":" << generation_ << "]"; return ost.Release(); }