summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/pc/webrtc_session_description_factory.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /third_party/libwebrtc/pc/webrtc_session_description_factory.cc
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/pc/webrtc_session_description_factory.cc')
-rw-r--r--third_party/libwebrtc/pc/webrtc_session_description_factory.cc65
1 files changed, 27 insertions, 38 deletions
diff --git a/third_party/libwebrtc/pc/webrtc_session_description_factory.cc b/third_party/libwebrtc/pc/webrtc_session_description_factory.cc
index 42a8da3e70..9919260aa3 100644
--- a/third_party/libwebrtc/pc/webrtc_session_description_factory.cc
+++ b/third_party/libwebrtc/pc/webrtc_session_description_factory.cc
@@ -128,13 +128,10 @@ WebRtcSessionDescriptionFactory::WebRtcSessionDescriptionFactory(
RTC_DCHECK(signaling_thread_);
if (!dtls_enabled) {
- SetSdesPolicy(cricket::SEC_REQUIRED);
- RTC_LOG(LS_VERBOSE) << "DTLS-SRTP disabled.";
+ RTC_LOG(LS_INFO) << "DTLS-SRTP disabled";
+ transport_desc_factory_.SetInsecureForTesting();
return;
}
-
- // SRTP-SDES is disabled if DTLS is on.
- SetSdesPolicy(cricket::SEC_DISABLED);
if (certificate) {
// Use `certificate`.
certificate_request_state_ = CERTIFICATE_WAITING;
@@ -142,31 +139,32 @@ WebRtcSessionDescriptionFactory::WebRtcSessionDescriptionFactory(
RTC_LOG(LS_VERBOSE) << "DTLS-SRTP enabled; has certificate parameter.";
RTC_LOG(LS_INFO) << "Using certificate supplied to the constructor.";
SetCertificate(certificate);
- } else {
- // Generate certificate.
- certificate_request_state_ = CERTIFICATE_WAITING;
-
- auto callback = [weak_ptr = weak_factory_.GetWeakPtr()](
- rtc::scoped_refptr<rtc::RTCCertificate> certificate) {
- if (!weak_ptr) {
- return;
- }
- if (certificate) {
- weak_ptr->SetCertificate(std::move(certificate));
- } else {
- weak_ptr->OnCertificateRequestFailed();
- }
- };
+ return;
+ }
+ // Generate certificate.
+ RTC_DCHECK(cert_generator_);
+ certificate_request_state_ = CERTIFICATE_WAITING;
+
+ auto callback = [weak_ptr = weak_factory_.GetWeakPtr()](
+ rtc::scoped_refptr<rtc::RTCCertificate> certificate) {
+ if (!weak_ptr) {
+ return;
+ }
+ if (certificate) {
+ weak_ptr->SetCertificate(std::move(certificate));
+ } else {
+ weak_ptr->OnCertificateRequestFailed();
+ }
+ };
- rtc::KeyParams key_params = rtc::KeyParams();
- RTC_LOG(LS_VERBOSE)
- << "DTLS-SRTP enabled; sending DTLS identity request (key type: "
- << key_params.type() << ").";
+ rtc::KeyParams key_params = rtc::KeyParams();
+ RTC_LOG(LS_VERBOSE)
+ << "DTLS-SRTP enabled; sending DTLS identity request (key type: "
+ << key_params.type() << ").";
- // Request certificate. This happens asynchronously on a different thread.
- cert_generator_->GenerateCertificateAsync(key_params, absl::nullopt,
- std::move(callback));
- }
+ // Request certificate. This happens asynchronously on a different thread.
+ cert_generator_->GenerateCertificateAsync(key_params, absl::nullopt,
+ std::move(callback));
}
WebRtcSessionDescriptionFactory::~WebRtcSessionDescriptionFactory() {
@@ -258,15 +256,6 @@ void WebRtcSessionDescriptionFactory::CreateAnswer(
}
}
-void WebRtcSessionDescriptionFactory::SetSdesPolicy(
- cricket::SecurePolicy secure_policy) {
- session_desc_factory_.set_secure(secure_policy);
-}
-
-cricket::SecurePolicy WebRtcSessionDescriptionFactory::SdesPolicy() const {
- return session_desc_factory_.secure();
-}
-
void WebRtcSessionDescriptionFactory::InternalCreateOffer(
CreateSessionDescriptionRequest request) {
if (sdp_info_->local_description()) {
@@ -450,7 +439,6 @@ void WebRtcSessionDescriptionFactory::SetCertificate(
on_certificate_ready_(certificate);
transport_desc_factory_.set_certificate(std::move(certificate));
- transport_desc_factory_.set_secure(cricket::SEC_ENABLED);
while (!create_session_description_requests_.empty()) {
if (create_session_description_requests_.front().type ==
@@ -462,4 +450,5 @@ void WebRtcSessionDescriptionFactory::SetCertificate(
create_session_description_requests_.pop();
}
}
+
} // namespace webrtc