Skip to content

Commit

Permalink
Update ChromiumPacketSocket factory to apply PacketOptions it receives.
Browse files Browse the repository at this point in the history
In Chromium libjingle is compiled with ENABLED_EXTERNAL_AUTH. This means
that the sending PacketSocketFactory is responsible for updating send
time in the outgoing RTP packets and calculating HMAC.
ChromiumPacketSocket previously wasn't doing that, so the receiver could
not validate the RTP packets.

BUG=547158

Review URL: https://codereview.chromium.org/1574353003

Cr-Commit-Position: refs/heads/master@{#369885}
  • Loading branch information
SergeyUlanov authored and Commit bot committed Jan 16, 2016
1 parent 221cf6e commit 8cf7497
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion remoting/protocol/chromium_socket_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
#include "jingle/glue/utils.h"
#include "net/base/io_buffer.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/udp/udp_server_socket.h"
#include "remoting/protocol/socket_util.h"
#include "third_party/libjingle/source/talk/media/base/rtputils.h"
#include "third_party/webrtc/base/asyncpacketsocket.h"
#include "third_party/webrtc/base/nethelpers.h"

Expand Down Expand Up @@ -194,7 +196,12 @@ int UdpPacketSocket::SendTo(const void* data, size_t data_size,
return EWOULDBLOCK;
}

send_queue_.push_back(PendingPacket(data, data_size, endpoint));
PendingPacket packet(data, data_size, endpoint);
cricket::ApplyPacketOptions(
reinterpret_cast<uint8_t*>(packet.data->data()), data_size,
options.packet_time_params,
(base::TimeTicks::Now() - base::TimeTicks()).InMilliseconds());
send_queue_.push_back(packet);
send_queue_size_ += data_size;

DoSend();
Expand Down

0 comments on commit 8cf7497

Please sign in to comment.