diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index 8afc44eb14..8cb0825336 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -2032,13 +2032,13 @@ void PeerConnection::ReportFirstConnectUsageMetrics() { RTC_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.ProvisionalAnswer", pranswer, kProvisionalAnswerMax); - // Record the number of valid / invalid ice-ufrag. We do allow certain - // non-spec ice-char for backward-compat reasons. At this point we know - // that the ufrag/pwd consists of a valid ice-char or one of the four - // not allowed characters since we have passed the IsIceChar check done - // by the p2p transport description on setRemoteDescription calls. auto transport_infos = remote_description()->description()->transport_infos(); - if (transport_infos.size() > 0) { + if (!transport_infos.empty()) { + // Record the number of valid / invalid ice-ufrag. We do allow certain + // non-spec ice-char for backward-compat reasons. At this point we know + // that the ufrag/pwd consists of a valid ice-char or one of the four + // not allowed characters since we have passed the IsIceChar check done + // by the p2p transport description on setRemoteDescription calls. auto ice_parameters = transport_infos[0].description.GetIceParameters(); auto is_invalid_char = [](char c) { return c == '-' || c == '=' || c == '#' || c == '_'; @@ -2050,6 +2050,16 @@ void PeerConnection::ReportFirstConnectUsageMetrics() { RTC_HISTOGRAM_BOOLEAN( "WebRTC.PeerConnection.ValidIceChars", !(isUsingInvalidIceCharInUfrag || isUsingInvalidIceCharInPwd)); + + // Record whether the hash algorithm of the first transport's + // DTLS fingerprint is still using SHA-1. + if (transport_infos[0].description.identity_fingerprint) { + RTC_HISTOGRAM_BOOLEAN( + "WebRTC.PeerConnection.DtlsFingerprintLegacySha1", + absl::EqualsIgnoreCase( + transport_infos[0].description.identity_fingerprint->algorithm, + "sha-1")); + } } // Record RtcpMuxPolicy setting.