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

Issue 7529039: Properly handle STUN requests and responses from relay servers. (Closed)

Created:
9 years, 4 months ago by Sergey Ulanov
Modified:
9 years, 4 months ago
Reviewers:
Wez
CC:
chromium-reviews, joi+watch-content_chromium.org, jam
Visibility:
Public.

Description

Properly handle STUN requests and responses from relay servers. BUG=83242 TEST=Chromoting can connect using relay servers. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=96072

Patch Set 1 #

Patch Set 2 : - #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -4 lines) Patch
M content/browser/renderer_host/p2p/socket_host.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/p2p/socket_host.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M content/browser/renderer_host/p2p/socket_host_tcp.cc View 1 chunk +1 line, -2 lines 6 comments Download
M content/browser/renderer_host/p2p/socket_host_udp.cc View 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Sergey Ulanov
9 years, 4 months ago (2011-08-09 01:53:27 UTC) #1
Wez
http://codereview.chromium.org/7529039/diff/3001/content/browser/renderer_host/p2p/socket_host_tcp.cc File content/browser/renderer_host/p2p/socket_host_tcp.cc (right): http://codereview.chromium.org/7529039/diff/3001/content/browser/renderer_host/p2p/socket_host_tcp.cc#newcode141 content/browser/renderer_host/p2p/socket_host_tcp.cc:141: if (stun && IsRequestOrResponse(type)) { How does receipt of ...
9 years, 4 months ago (2011-08-09 18:09:23 UTC) #2
Sergey Ulanov
http://codereview.chromium.org/7529039/diff/3001/content/browser/renderer_host/p2p/socket_host_tcp.cc File content/browser/renderer_host/p2p/socket_host_tcp.cc (right): http://codereview.chromium.org/7529039/diff/3001/content/browser/renderer_host/p2p/socket_host_tcp.cc#newcode141 content/browser/renderer_host/p2p/socket_host_tcp.cc:141: if (stun && IsRequestOrResponse(type)) { On 2011/08/09 18:09:23, Wez ...
9 years, 4 months ago (2011-08-09 18:15:40 UTC) #3
Wez
http://codereview.chromium.org/7529039/diff/3001/content/browser/renderer_host/p2p/socket_host_tcp.cc File content/browser/renderer_host/p2p/socket_host_tcp.cc (right): http://codereview.chromium.org/7529039/diff/3001/content/browser/renderer_host/p2p/socket_host_tcp.cc#newcode141 content/browser/renderer_host/p2p/socket_host_tcp.cc:141: if (stun && IsRequestOrResponse(type)) { On 2011/08/09 18:15:41, sergeyu ...
9 years, 4 months ago (2011-08-09 18:30:57 UTC) #4
Sergey Ulanov
http://codereview.chromium.org/7529039/diff/3001/content/browser/renderer_host/p2p/socket_host_tcp.cc File content/browser/renderer_host/p2p/socket_host_tcp.cc (right): http://codereview.chromium.org/7529039/diff/3001/content/browser/renderer_host/p2p/socket_host_tcp.cc#newcode141 content/browser/renderer_host/p2p/socket_host_tcp.cc:141: if (stun && IsRequestOrResponse(type)) { On 2011/08/09 18:30:57, Wez ...
9 years, 4 months ago (2011-08-09 19:18:26 UTC) #5
Wez
LGTM with a couple of remaining comments. http://codereview.chromium.org/7529039/diff/3001/content/browser/renderer_host/p2p/socket_host_tcp.cc File content/browser/renderer_host/p2p/socket_host_tcp.cc (right): http://codereview.chromium.org/7529039/diff/3001/content/browser/renderer_host/p2p/socket_host_tcp.cc#newcode141 content/browser/renderer_host/p2p/socket_host_tcp.cc:141: if (stun ...
9 years, 4 months ago (2011-08-09 19:54:50 UTC) #6
Sergey Ulanov
9 years, 4 months ago (2011-08-09 21:06:56 UTC) #7
http://codereview.chromium.org/7529039/diff/3001/content/browser/renderer_hos...
File content/browser/renderer_host/p2p/socket_host_tcp.cc (right):

http://codereview.chromium.org/7529039/diff/3001/content/browser/renderer_hos...
content/browser/renderer_host/p2p/socket_host_tcp.cc:141: if (stun &&
IsRequestOrResponse(type)) {
On 2011/08/09 19:54:50, Wez wrote:
> On 2011/08/09 19:18:26, sergeyu wrote:
> > We do block incoming data packets before stun request or response is
received
> -
> > see lines 143-149.
> 
> Sorry; forgot about the |!authorized_| surrounding this block.
> 
> > |authorized_| means that we've received STUN request or response from the
> remote
> > end, which means it is safe to relay data from/to web app. 'Authorization'
may
> > not be the best term for this, your suggestions on what would be a better
name
> > here are welcome.
> 
> The flag indicates whether the channel is bound to a peer, ready for data
> transfer, so "ready", "bound" or "connected" would seem appropriate.

Ok, connected sounds good. I will rename it in a separate CL.

> 
> > Yes, authorized_ is usually set when the connection is bound, but we don't
> > inspect internals of STUN packets, e.g. don't verify that transaction id in
> > request and response match, so it will not be correct to call it |bound_|.
> 
> Should we be doing that verification here?

I don't think so. It will make this code more complicated, increasing
probability of security vulnerabilities, but will not provide much additional
protection.

Powered by Google App Engine
This is Rietveld 408576698