turn: add logging for long usernames
BUG=chromium:1144646,chromium:1186539
Change-Id: Ib84b80f6e32b90c8ce4feebd8a9f5142af589141
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211860
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33457}
diff --git a/p2p/base/turn_port.h b/p2p/base/turn_port.h
index 3a79152..349190b 100644
--- a/p2p/base/turn_port.h
+++ b/p2p/base/turn_port.h
@@ -66,6 +66,8 @@
webrtc::TurnCustomizer* customizer) {
// Do basic parameter validation.
if (credentials.username.size() > kMaxTurnUsernameLength) {
+ RTC_LOG(LS_ERROR) << "Attempt to use TURN with a too long username "
+ << "of length " << credentials.username.size();
return nullptr;
}
// Do not connect to low-numbered ports. The default STUN port is 3478.
@@ -117,6 +119,8 @@
rtc::SSLCertificateVerifier* tls_cert_verifier = nullptr) {
// Do basic parameter validation.
if (credentials.username.size() > kMaxTurnUsernameLength) {
+ RTC_LOG(LS_ERROR) << "Attempt to use TURN with a too long username "
+ << "of length " << credentials.username.size();
return nullptr;
}
// Do not connect to low-numbered ports. The default STUN port is 3478.