Fix bug where RTCTransportStats.dtlsCipher was missing when using OpenSSL
A bug in the id being searched for inside OpenSSLStreamAdapter::SslCipherSuiteToName prevented the lookup from ever succeeding. This resulted in this stat being unavailable when calling PeerConnection::GetStats(). To fix the problem, look for (0x03000000L | cipher_suite) which matches what the BoringSSL codepath is doing. Bug: webrtc:14596 Change-Id: Ic36d77dbc4c2378fbde1e2f21a9f5bd735b36741 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280100 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38460}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
ea59abe44e
commit
e457e43836
1
AUTHORS
1
AUTHORS
@ -146,6 +146,7 @@ HyperConnect Inc. <*@hpcnt.com>
|
|||||||
Intel Corporation <*@intel.com>
|
Intel Corporation <*@intel.com>
|
||||||
LG Electronics, Inc. <*@lge.com>
|
LG Electronics, Inc. <*@lge.com>
|
||||||
Life On Air Inc. <*@lifeonair.com>
|
Life On Air Inc. <*@lifeonair.com>
|
||||||
|
Meta Platforms, Inc. <*@meta.com>
|
||||||
Microsoft Corporation <*@microsoft.com>
|
Microsoft Corporation <*@microsoft.com>
|
||||||
MIPS Technologies <*@mips.com>
|
MIPS Technologies <*@mips.com>
|
||||||
Mozilla Foundation <*@mozilla.com>
|
Mozilla Foundation <*@mozilla.com>
|
||||||
|
|||||||
@ -390,9 +390,10 @@ std::string OpenSSLStreamAdapter::SslCipherSuiteToName(int cipher_suite) {
|
|||||||
}
|
}
|
||||||
return SSL_CIPHER_standard_name(ssl_cipher);
|
return SSL_CIPHER_standard_name(ssl_cipher);
|
||||||
#else
|
#else
|
||||||
|
const int openssl_cipher_id = 0x03000000L | cipher_suite;
|
||||||
for (const SslCipherMapEntry* entry = kSslCipherMap; entry->rfc_name;
|
for (const SslCipherMapEntry* entry = kSslCipherMap; entry->rfc_name;
|
||||||
++entry) {
|
++entry) {
|
||||||
if (cipher_suite == static_cast<int>(entry->openssl_id)) {
|
if (openssl_cipher_id == static_cast<int>(entry->openssl_id)) {
|
||||||
return entry->rfc_name;
|
return entry->rfc_name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user