Unify TLS cipher suite name handling Move it away from the "proprietary" SSL_CIPHER_get_id and looking up the cipher based on that towards SSL_CIPHER_standard_name. SSL_CIPHER_get_id and the associated GetSslCipherSuite API is kept around for WebRTC.PeerConnection.SslCipherSuite.* UMA metrics and metrics compability (despite not yielding the IANA ids it promises). BUG=None Change-Id: Iaa357e3e31dc90abea688cf6ca10c0b40582ef38 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363202 Reviewed-by: David Benjamin <davidben@webrtc.org> Commit-Queue: Philipp Hancke <phancke@meta.com> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43097}
diff --git a/rtc_base/ssl_stream_adapter.h b/rtc_base/ssl_stream_adapter.h index 758d0e2..e16db4a 100644 --- a/rtc_base/ssl_stream_adapter.h +++ b/rtc_base/ssl_stream_adapter.h
@@ -185,6 +185,9 @@ // Retrieves the IANA registration id of the cipher suite used for the // connection (e.g. 0x2F for "TLS_RSA_WITH_AES_128_CBC_SHA"). virtual bool GetSslCipherSuite(int* cipher_suite); + // Returns the name of the cipher suite used for the DTLS transport, + // as defined in the "Description" column of the IANA cipher suite registry. + virtual std::optional<absl::string_view> GetTlsCipherSuiteName() const = 0; // Retrieves the enum value for SSL version. // Will return -1 until the version has been negotiated. @@ -236,11 +239,6 @@ static bool IsAcceptableCipher(int cipher, KeyType key_type); static bool IsAcceptableCipher(absl::string_view cipher, KeyType key_type); - // TODO(guoweis): Move this away from a static class method. Currently this is - // introduced such that any caller could depend on sslstreamadapter.h without - // depending on specific SSL implementation. - static std::string SslCipherSuiteToName(int cipher_suite); - //////////////////////////////////////////////////////////////////////////// // Testing only member functions ////////////////////////////////////////////////////////////////////////////