Skip to content

Commit

Permalink
All patches applied by livekit/rust-sdks
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Nov 29, 2024
1 parent 08f7a70 commit a7c86c8
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 3 deletions.
11 changes: 11 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -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" ]
}
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions rtc_base/boringssl_certificate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ BoringSSLCertificate::BoringSSLCertificate(
RTC_DCHECK(cert_buffer_ != nullptr);
}

BoringSSLCertificate::BoringSSLCertificate(
bssl::UniquePtr<CRYPTO_BUFFER> cert_buffer, SSL* ssl)
: cert_buffer_(std::move(cert_buffer)), ssl_(ssl) {
RTC_DCHECK(cert_buffer_ != nullptr);
}

std::unique_ptr<BoringSSLCertificate> BoringSSLCertificate::Generate(
OpenSSLKeyPair* key_pair,
const SSLIdentityParams& params) {
Expand Down
6 changes: 6 additions & 0 deletions rtc_base/boringssl_certificate.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class OpenSSLKeyPair;
class BoringSSLCertificate final : public SSLCertificate {
public:
explicit BoringSSLCertificate(bssl::UniquePtr<CRYPTO_BUFFER> cert_buffer);
BoringSSLCertificate(bssl::UniquePtr<CRYPTO_BUFFER> cert_buffer, SSL* ssl);

static std::unique_ptr<BoringSSLCertificate> Generate(
OpenSSLKeyPair* key_pair,
Expand Down Expand Up @@ -75,6 +76,11 @@ class BoringSSLCertificate final : public SSLCertificate {
private:
// A handle to the DER encoded certificate data.
bssl::UniquePtr<CRYPTO_BUFFER> cert_buffer_;

private:
SSL* ssl_ = nullptr;
public:
SSL* ssl() const { return ssl_; }
};

} // namespace rtc
Expand Down
4 changes: 2 additions & 2 deletions rtc_base/openssl_adapter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rtc_base/openssl_stream_adapter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ enum ssl_verify_result_t OpenSSLStreamAdapter::SSLVerifyCallback(
// Creates certificate chain.
std::vector<std::unique_ptr<SSLCertificate>> 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)));

Expand Down
12 changes: 12 additions & 0 deletions tools_webrtc/libs/generate_licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a7c86c8

Please sign in to comment.