From a7c86c840b5a23392a23f1d3f194713ba1121633 Mon Sep 17 00:00:00 2001 From: "mgsloan@gmail.com" Date: Thu, 28 Nov 2024 17:05:55 -0700 Subject: [PATCH] All patches applied by livekit/rust-sdks --- BUILD.gn | 11 +++++++++++ rtc_base/boringssl_certificate.cc | 6 ++++++ rtc_base/boringssl_certificate.h | 6 ++++++ rtc_base/openssl_adapter.cc | 4 ++-- rtc_base/openssl_stream_adapter.cc | 2 +- tools_webrtc/libs/generate_licenses.py | 12 ++++++++++++ 6 files changed, 38 insertions(+), 3 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index d5289b85d7..76823f6cff 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -24,6 +24,9 @@ import("//build/config/linux/pkg_config.gni") import("//build/config/sanitizers/sanitizers.gni") import("webrtc.gni") +import("//third_party/libaom/options.gni") + + if (rtc_enable_protobuf) { import("//third_party/protobuf/proto_library.gni") } @@ -292,6 +295,10 @@ config("common_config") { defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ] } + if (enable_libaom) { + defines += [ "RTC_USE_LIBAOM_AV1_ENCODER" ] + } + if (rtc_libvpx_build_vp9) { defines += [ "RTC_ENABLE_VP9" ] } @@ -517,6 +524,10 @@ if (!build_with_chromium) { "pc:rtc_pc", "sdk", "video", + "//third_party/zlib", + "rtc_base:log_sinks", + "media:rtc_simulcast_encoder_adapter", + "api/crypto:frame_crypto_transformer", ] if (rtc_include_builtin_audio_codecs) { diff --git a/rtc_base/boringssl_certificate.cc b/rtc_base/boringssl_certificate.cc index a866224496..f902d8f019 100644 --- a/rtc_base/boringssl_certificate.cc +++ b/rtc_base/boringssl_certificate.cc @@ -255,6 +255,12 @@ BoringSSLCertificate::BoringSSLCertificate( RTC_DCHECK(cert_buffer_ != nullptr); } +BoringSSLCertificate::BoringSSLCertificate( + bssl::UniquePtr cert_buffer, SSL* ssl) + : cert_buffer_(std::move(cert_buffer)), ssl_(ssl) { + RTC_DCHECK(cert_buffer_ != nullptr); +} + std::unique_ptr BoringSSLCertificate::Generate( OpenSSLKeyPair* key_pair, const SSLIdentityParams& params) { diff --git a/rtc_base/boringssl_certificate.h b/rtc_base/boringssl_certificate.h index bd331686b7..36135888a9 100644 --- a/rtc_base/boringssl_certificate.h +++ b/rtc_base/boringssl_certificate.h @@ -34,6 +34,7 @@ class OpenSSLKeyPair; class BoringSSLCertificate final : public SSLCertificate { public: explicit BoringSSLCertificate(bssl::UniquePtr cert_buffer); + BoringSSLCertificate(bssl::UniquePtr cert_buffer, SSL* ssl); static std::unique_ptr Generate( OpenSSLKeyPair* key_pair, @@ -75,6 +76,11 @@ class BoringSSLCertificate final : public SSLCertificate { private: // A handle to the DER encoded certificate data. bssl::UniquePtr cert_buffer_; + + private: + SSL* ssl_ = nullptr; + public: + SSL* ssl() const { return ssl_; } }; } // namespace rtc diff --git a/rtc_base/openssl_adapter.cc b/rtc_base/openssl_adapter.cc index 7ac922041d..a8ff78cb98 100644 --- a/rtc_base/openssl_adapter.cc +++ b/rtc_base/openssl_adapter.cc @@ -841,7 +841,7 @@ enum ssl_verify_result_t OpenSSLAdapter::SSLVerifyInternal(SSL* ssl, return ssl_verify_invalid; } - BoringSSLCertificate cert(bssl::UpRef(sk_CRYPTO_BUFFER_value(chain, 0))); + BoringSSLCertificate cert(bssl::UpRef(sk_CRYPTO_BUFFER_value(chain, 0)), ssl); if (!ssl_cert_verifier_->Verify(cert)) { RTC_LOG(LS_WARNING) << "Failed to verify certificate using custom callback"; return ssl_verify_invalid; @@ -913,7 +913,7 @@ int OpenSSLAdapter::SSLVerifyInternal(int previous_status, RTC_LOG(LS_ERROR) << "Failed to allocate CRYPTO_BUFFER."; return previous_status; } - const BoringSSLCertificate cert(std::move(crypto_buffer)); + const BoringSSLCertificate cert(std::move(crypto_buffer), ssl); #else const OpenSSLCertificate cert(X509_STORE_CTX_get_current_cert(store)); #endif diff --git a/rtc_base/openssl_stream_adapter.cc b/rtc_base/openssl_stream_adapter.cc index 9fd8c8f395..5ce8a66c40 100644 --- a/rtc_base/openssl_stream_adapter.cc +++ b/rtc_base/openssl_stream_adapter.cc @@ -1148,7 +1148,7 @@ enum ssl_verify_result_t OpenSSLStreamAdapter::SSLVerifyCallback( // Creates certificate chain. std::vector> cert_chain; for (CRYPTO_BUFFER* cert : chain) { - cert_chain.emplace_back(new BoringSSLCertificate(bssl::UpRef(cert))); + cert_chain.emplace_back(new BoringSSLCertificate(bssl::UpRef(cert), ssl)); } stream->peer_cert_chain_.reset(new SSLCertChain(std::move(cert_chain))); diff --git a/tools_webrtc/libs/generate_licenses.py b/tools_webrtc/libs/generate_licenses.py index d945b43cca..5f3e457d8a 100755 --- a/tools_webrtc/libs/generate_licenses.py +++ b/tools_webrtc/libs/generate_licenses.py @@ -86,6 +86,18 @@ # Compile time dependencies, no license needed: 'ow2_asm': [], 'jdk': [], + + 'ffmpeg':[ + 'third_party/ffmpeg/COPYING.GPLv2', + 'third_party/ffmpeg/COPYING.GPLv3', + 'third_party/ffmpeg/COPYING.LGPLv2.1', + 'third_party/ffmpeg/COPYING.LGPLv3' + ], + 'openh264': ['third_party/openh264/src/LICENSE'], + 'catapult': [], + 'google_benchmark': [], + 'googletest': [], + 'vinn': [], } # Third_party library _regex_ to licences mapping. Keys are regular expression