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

Issue 1340523002: Fix WebSocketServer extension parser. (Closed)

Created:
5 years, 3 months ago by yhirano
Modified:
5 years, 2 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, cbentzel+watch_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@ws-constructor-fix
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix WebSocketServer extension parser. This CL makes the WebSocket server in net/server use the net/websockets parser for parsing Sec-WebSocket-Extensions in the extension negotiation. The new implementation validates the extension negotiation offer more strictly than before. Specifically, - Malformed Sec-WebSocket-Extensions header value causes connection failure. - Previously it was just ignored. - Malformed permessage-deflate parameters are declined. - Previously part of such params were accepted partially. BUG=523228 Committed: https://crrev.com/a10dd4ef5e42a54bea6ce71ef3f3d9f974dbb37e Cr-Commit-Position: refs/heads/master@{#351040}

Patch Set 1 : #

Total comments: 4

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Total comments: 2

Patch Set 4 : #

Patch Set 5 : #

Total comments: 15

Patch Set 6 : #

Total comments: 2

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Patch Set 11 : #

Total comments: 8

Patch Set 12 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+371 lines, -241 lines) Patch
M net/net.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M net/server/http_server.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -5 lines 0 comments Download
M net/server/web_socket.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -8 lines 0 comments Download
M net/server/web_socket.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +78 lines, -46 lines 0 comments Download
M net/server/web_socket_encoder.h View 1 2 3 1 chunk +25 lines, -36 lines 0 comments Download
M net/server/web_socket_encoder.cc View 1 2 3 4 5 2 chunks +86 lines, -122 lines 0 comments Download
M net/server/web_socket_encoder_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +81 lines, -23 lines 0 comments Download
M net/websockets/websocket_deflate_parameters.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +11 lines, -0 lines 0 comments Download
M net/websockets/websocket_extension.h View 1 chunk +1 line, -0 lines 0 comments Download
M net/websockets/websocket_extension.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +21 lines, -0 lines 0 comments Download
A net/websockets/websocket_extension_test.cc View 1 2 3 4 5 1 chunk +60 lines, -0 lines 0 comments Download
M net/websockets/websocket_handshake_constants.h View 1 2 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 38 (19 generated)
yhirano
This CL depends on https://codereview.chromium.org/1324113002/ and https://codereview.chromium.org/1334113003/.
5 years, 3 months ago (2015-09-11 11:57:16 UTC) #7
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1340523002/diff/20002/net/server/web_socket.cc File net/server/web_socket.cc (right): https://codereview.chromium.org/1340523002/diff/20002/net/server/web_socket.cc#newcode26 net/server/web_socket.cc:26: const char kWebSocketGuid[] = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; common to net/websockets/websocket_handshake_constants.cc. let's ...
5 years, 3 months ago (2015-09-11 12:18:40 UTC) #8
dgozman
Could you please elaborate on what does this fix? Changes in web_socket{_encoder} do not look ...
5 years, 3 months ago (2015-09-11 17:49:36 UTC) #9
yhirano
PS3 declines invalid permessage-deflate extensions and rejects malformed extensions headers (PS1 and PS2 rejected both). ...
5 years, 3 months ago (2015-09-15 06:25:57 UTC) #16
dgozman
net/server lgtm https://codereview.chromium.org/1340523002/diff/220001/net/server/web_socket_encoder.cc File net/server/web_socket_encoder.cc (right): https://codereview.chromium.org/1340523002/diff/220001/net/server/web_socket_encoder.cc#newcode278 net/server/web_socket_encoder.cc:278: : is_server_(type == FOR_SERVER), Let's go ahead ...
5 years, 3 months ago (2015-09-15 17:26:19 UTC) #17
yhirano
https://codereview.chromium.org/1340523002/diff/220001/net/server/web_socket_encoder.cc File net/server/web_socket_encoder.cc (right): https://codereview.chromium.org/1340523002/diff/220001/net/server/web_socket_encoder.cc#newcode278 net/server/web_socket_encoder.cc:278: : is_server_(type == FOR_SERVER), On 2015/09/15 17:26:19, dgozman wrote: ...
5 years, 3 months ago (2015-09-16 05:28:17 UTC) #18
tyoshino (SeeGerritForStatus)
lgtm https://codereview.chromium.org/1340523002/diff/270001/net/server/web_socket_encoder.cc File net/server/web_socket_encoder.cc (right): https://codereview.chromium.org/1340523002/diff/270001/net/server/web_socket_encoder.cc#newcode202 net/server/web_socket_encoder.cc:202: WebSocketDeflateParameters offered, response; offered -> accepted_offered_params or accepted_params ...
5 years, 3 months ago (2015-09-16 09:33:10 UTC) #20
yhirano
https://codereview.chromium.org/1340523002/diff/270001/net/server/web_socket_encoder.cc File net/server/web_socket_encoder.cc (right): https://codereview.chromium.org/1340523002/diff/270001/net/server/web_socket_encoder.cc#newcode202 net/server/web_socket_encoder.cc:202: WebSocketDeflateParameters offered, response; On 2015/09/16 09:33:10, tyoshino wrote: > ...
5 years, 3 months ago (2015-09-16 10:47:47 UTC) #22
tyoshino (SeeGerritForStatus)
lgtm https://codereview.chromium.org/1340523002/diff/270001/net/server/web_socket_encoder.cc File net/server/web_socket_encoder.cc (right): https://codereview.chromium.org/1340523002/diff/270001/net/server/web_socket_encoder.cc#newcode254 net/server/web_socket_encoder.cc:254: } On 2015/09/16 10:47:46, yhirano wrote: > On ...
5 years, 3 months ago (2015-09-17 02:24:37 UTC) #23
yhirano
https://codereview.chromium.org/1340523002/diff/310001/net/websockets/websocket_extension.cc File net/websockets/websocket_extension.cc (right): https://codereview.chromium.org/1340523002/diff/310001/net/websockets/websocket_extension.cc#newcode62 net/websockets/websocket_extension.cc:62: DCHECK(HttpUtil::IsToken(param.value())); On 2015/09/17 02:24:37, tyoshino wrote: > the parser ...
5 years, 3 months ago (2015-09-17 03:32:15 UTC) #24
yhirano
+davidben for OWNER review.
5 years, 3 months ago (2015-09-17 04:00:42 UTC) #26
davidben
Sorry about the delay? lgtm with some nits. https://codereview.chromium.org/1340523002/diff/410001/net/server/web_socket.cc File net/server/web_socket.cc (right): https://codereview.chromium.org/1340523002/diff/410001/net/server/web_socket.cc#newcode130 net/server/web_socket.cc:130: server_->Send500(connection_->id(), ...
5 years, 3 months ago (2015-09-22 19:44:02 UTC) #27
davidben
On 2015/09/22 19:44:02, David Benjamin wrote: > Sorry about the delay? lgtm with some nits. ...
5 years, 3 months ago (2015-09-22 20:13:57 UTC) #28
yhirano
Thanks! https://codereview.chromium.org/1340523002/diff/410001/net/server/web_socket.cc File net/server/web_socket.cc (right): https://codereview.chromium.org/1340523002/diff/410001/net/server/web_socket.cc#newcode130 net/server/web_socket.cc:130: server_->Send500(connection_->id(), message); On 2015/09/22 19:44:01, David Benjamin wrote: ...
5 years, 2 months ago (2015-09-28 03:17:06 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1340523002/430001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1340523002/430001
5 years, 2 months ago (2015-09-28 03:17:27 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_android_rel_ng/builds/74330)
5 years, 2 months ago (2015-09-28 07:27:44 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1340523002/430001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1340523002/430001
5 years, 2 months ago (2015-09-28 07:31:03 UTC) #36
commit-bot: I haz the power
Committed patchset #12 (id:430001)
5 years, 2 months ago (2015-09-28 09:06:42 UTC) #37
commit-bot: I haz the power
5 years, 2 months ago (2015-09-28 09:07:52 UTC) #38
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/a10dd4ef5e42a54bea6ce71ef3f3d9f974dbb37e
Cr-Commit-Position: refs/heads/master@{#351040}

Powered by Google App Engine
This is Rietveld 408576698