summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/pc/sdp_offer_answer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libwebrtc/pc/sdp_offer_answer.cc')
-rw-r--r--third_party/libwebrtc/pc/sdp_offer_answer.cc25
1 files changed, 11 insertions, 14 deletions
diff --git a/third_party/libwebrtc/pc/sdp_offer_answer.cc b/third_party/libwebrtc/pc/sdp_offer_answer.cc
index 67c8d10241..95d54978c7 100644
--- a/third_party/libwebrtc/pc/sdp_offer_answer.cc
+++ b/third_party/libwebrtc/pc/sdp_offer_answer.cc
@@ -99,7 +99,7 @@ const char kSdpWithoutIceUfragPwd[] =
"Called with SDP without ice-ufrag and ice-pwd.";
const char kSdpWithoutDtlsFingerprint[] =
"Called with SDP without DTLS fingerprint.";
-const char kSdpWithoutSdesCrypto[] = "Called with SDP without SDES crypto.";
+const char kSdpWithoutCrypto[] = "Called with SDP without crypto setup.";
const char kSessionError[] = "Session error code: ";
const char kSessionErrorDesc[] = "Session error description: ";
@@ -271,7 +271,7 @@ bool MediaSectionsHaveSameCount(const SessionDescription& desc1,
const SessionDescription& desc2) {
return desc1.contents().size() == desc2.contents().size();
}
-// Checks that each non-rejected content has SDES crypto keys or a DTLS
+// Checks that each non-rejected content has a DTLS
// fingerprint, unless it's in a BUNDLE group, in which case only the
// BUNDLE-tag section (first media section/description in the BUNDLE group)
// needs a ufrag and pwd. Mismatches, such as replying with a DTLS fingerprint
@@ -285,9 +285,6 @@ RTCError VerifyCrypto(const SessionDescription* desc,
if (content_info.rejected) {
continue;
}
-#if !defined(WEBRTC_FUCHSIA)
- RTC_CHECK(dtls_enabled) << "SDES protocol is only allowed in Fuchsia";
-#endif
const std::string& mid = content_info.name;
auto it = bundle_groups_by_mid.find(mid);
const cricket::ContentGroup* bundle =
@@ -313,10 +310,7 @@ RTCError VerifyCrypto(const SessionDescription* desc,
kSdpWithoutDtlsFingerprint);
}
} else {
- if (media->cryptos().empty()) {
- LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER,
- kSdpWithoutSdesCrypto);
- }
+ LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER, kSdpWithoutCrypto);
}
}
return RTCError::OK();
@@ -1396,7 +1390,9 @@ void SdpOfferAnswerHandler::Initialize(
pc_->trials());
if (pc_->options()->disable_encryption) {
- webrtc_session_desc_factory_->SetSdesPolicy(cricket::SEC_DISABLED);
+ RTC_LOG(LS_INFO)
+ << "Disabling encryption. This should only be done in tests.";
+ webrtc_session_desc_factory_->SetInsecureForTesting();
}
webrtc_session_desc_factory_->set_enable_encrypted_rtp_header_extensions(
@@ -3554,8 +3550,7 @@ RTCError SdpOfferAnswerHandler::ValidateSessionDescription(
// Verify crypto settings.
std::string crypto_error;
- if (webrtc_session_desc_factory_->SdesPolicy() == cricket::SEC_REQUIRED ||
- pc_->dtls_enabled()) {
+ if (pc_->dtls_enabled()) {
RTCError crypto_error = VerifyCrypto(
sdesc->description(), pc_->dtls_enabled(), bundle_groups_by_mid);
if (!crypto_error.ok()) {
@@ -4302,11 +4297,13 @@ void SdpOfferAnswerHandler::GetOptionsForUnifiedPlanOffer(
GetMediaDescriptionOptionsForRejectedData(mid));
} else {
const auto data_mid = pc_->sctp_mid();
- RTC_CHECK(data_mid);
- if (mid == data_mid.value()) {
+ if (data_mid.has_value() && mid == data_mid.value()) {
session_options->media_description_options.push_back(
GetMediaDescriptionOptionsForActiveData(mid));
} else {
+ if (!data_mid.has_value()) {
+ RTC_LOG(LS_ERROR) << "Datachannel transport not available: " << mid;
+ }
session_options->media_description_options.push_back(
GetMediaDescriptionOptionsForRejectedData(mid));
}