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}
This commit is contained in:
Philipp Hancke
2021-03-15 08:50:53 +01:00
committed by Commit Bot
parent 6097b0fac0
commit b6bc357a1e

View File

@ -66,6 +66,8 @@ class TurnPort : public Port {
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 @@ class TurnPort : public Port {
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.