Bug 1535868: don't send SRTP when not negotiated. r=bwc
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Fri, 22 Mar 2019 23:31:44 +0000
changeset 527773 74d361ea2fe6e4d18b41c464f4d060c00a89df35
parent 527772 113d8feeb0a07e0b726f248df4b64340d3ea9efd
child 527774 20f26343fafef69fc9f6f3f37cf984432da290bd
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1535868
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1535868: don't send SRTP when not negotiated. r=bwc Differential Revision: https://phabricator.services.mozilla.com/D23805
media/mtransport/transportlayersrtp.cpp
--- a/media/mtransport/transportlayersrtp.cpp
+++ b/media/mtransport/transportlayersrtp.cpp
@@ -48,16 +48,20 @@ bool TransportLayerSrtp::Setup() {
   // downward_ is the TransportLayerIce
   downward_->SignalPacketReceived.connect(this,
                                           &TransportLayerSrtp::PacketReceived);
 
   return true;
 }
 
 TransportResult TransportLayerSrtp::SendPacket(MediaPacket& packet) {
+  if (state() != TS_OPEN) {
+    return TE_ERROR;
+  }
+
   if (packet.len() < 4) {
     MOZ_ASSERT(false);
     return TE_ERROR;
   }
 
   MOZ_ASSERT(packet.capacity() - packet.len() >= SRTP_MAX_EXPANSION);
 
   int out_len;