Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(454)

Unified Diff: webrtc/pc/webrtcsession.cc

Issue 2647593003: Accept SDP with TRANSPORT attributes missing from bundled m= sections. (Closed)
Patch Set: Fixing tests due to bool's meaning being reversed in patchset 4 Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/pc/peerconnection_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/webrtcsession.cc
diff --git a/webrtc/pc/webrtcsession.cc b/webrtc/pc/webrtcsession.cc
index 763c19cc160296d99311338694634e7e5faa9c1d..22cb611740b3c075c0a689424bf9108db15cf471 100644
--- a/webrtc/pc/webrtcsession.cc
+++ b/webrtc/pc/webrtcsession.cc
@@ -163,20 +163,32 @@ static bool VerifyMediaDescriptions(
}
// Checks that each non-rejected content has SDES crypto keys or a DTLS
-// fingerprint. Mismatches, such as replying with a DTLS fingerprint to SDES
-// keys, will be caught in Transport negotiation, and backstopped by Channel's
-// |srtp_required| check.
+// 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
+// to SDES keys, will be caught in JsepTransport negotiation, and backstopped
+// by Channel's |srtp_required| check.
static bool VerifyCrypto(const SessionDescription* desc,
bool dtls_enabled,
std::string* error) {
+ const cricket::ContentGroup* bundle =
+ desc->GetGroupByName(cricket::GROUP_TYPE_BUNDLE);
const ContentInfos& contents = desc->contents();
for (size_t index = 0; index < contents.size(); ++index) {
const ContentInfo* cinfo = &contents[index];
if (cinfo->rejected) {
continue;
}
+ if (bundle && bundle->HasContentName(cinfo->name) &&
+ cinfo->name != *(bundle->FirstContentName())) {
+ // This isn't the first media section in the BUNDLE group, so it's not
+ // required to have crypto attributes, since only the crypto attributes
+ // from the first section actually get used.
+ continue;
+ }
- // If the content isn't rejected, crypto must be present.
+ // If the content isn't rejected or bundled into another m= section, crypto
+ // must be present.
const MediaContentDescription* media =
static_cast<const MediaContentDescription*>(cinfo->description);
const TransportInfo* tinfo = desc->GetTransportInfoByName(cinfo->name);
@@ -206,16 +218,28 @@ static bool VerifyCrypto(const SessionDescription* desc,
return true;
}
-// Checks that each non-rejected content has ice-ufrag and ice-pwd set.
+// Checks that each non-rejected content has ice-ufrag and ice-pwd set, 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.
static bool VerifyIceUfragPwdPresent(const SessionDescription* desc) {
+ const cricket::ContentGroup* bundle =
+ desc->GetGroupByName(cricket::GROUP_TYPE_BUNDLE);
const ContentInfos& contents = desc->contents();
for (size_t index = 0; index < contents.size(); ++index) {
const ContentInfo* cinfo = &contents[index];
if (cinfo->rejected) {
continue;
}
+ if (bundle && bundle->HasContentName(cinfo->name) &&
+ cinfo->name != *(bundle->FirstContentName())) {
+ // This isn't the first media section in the BUNDLE group, so it's not
+ // required to have ufrag/password, since only the ufrag/password from
+ // the first section actually get used.
+ continue;
+ }
- // If the content isn't rejected, ice-ufrag and ice-pwd must be present.
+ // If the content isn't rejected or bundled into another m= section,
+ // ice-ufrag and ice-pwd must be present.
const TransportInfo* tinfo = desc->GetTransportInfoByName(cinfo->name);
if (!tinfo) {
// Something is not right.
« no previous file with comments | « webrtc/pc/peerconnection_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698