tls: replace call to deprecated SSL_library_init with OPENSSL_init_ssl

SSL_library_init
https://www.openssl.org/docs/manmaster/man3/SSL_library_init.html
has been deprecated by OPENSSL_init_ssl
https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_init_ssl.html
which no longer needs to be called as of OpenSSL 1.1.0 (2017).
It is still required for boringssl for the time being:
  https://bugs.chromium.org/p/boringssl/issues/detail?id=35
  https://bugs.chromium.org/p/boringssl/issues/detail?id=673
so a TODO is added.

BUG=webrtc:339300437

Change-Id: If4c7a9f4935521b33fc19b5fff72d293c0e17b81
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350145
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@{#42291}
This commit is contained in:
Philipp Hancke 2024-05-08 11:52:05 -07:00 committed by WebRTC LUCI CQ
parent 16fb7903e5
commit 2cb3c54273

View File

@ -170,16 +170,12 @@ namespace rtc {
using ::webrtc::TimeDelta;
bool OpenSSLAdapter::InitializeSSL() {
if (!SSL_library_init())
return false;
#if !defined(ADDRESS_SANITIZER) || !defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
// Loading the error strings crashes mac_asan. Omit this debugging aid there.
SSL_load_error_strings();
#endif
ERR_load_BIO_strings();
OpenSSL_add_all_algorithms();
RAND_poll();
return true;
// TODO: https://issues.webrtc.org/issues/339300437 - remove once
// BoringSSL no longer requires this after
// https://bugs.chromium.org/p/boringssl/issues/detail?id=35
// In OpenSSL it is supposed to be a no-op as of 1.1:
// https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_init_ssl.html
return OPENSSL_init_ssl(0, nullptr);
}
bool OpenSSLAdapter::CleanupSSL() {