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

Issue 76403004: An implementation of chrome.socket.secure(). (Closed)

Created:
7 years, 1 month ago by lally
Modified:
6 years, 5 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, jar (doing other things), asvitkine+watch_chromium.org, chromium-apps-reviews_chromium.org, erikwright+watch_chromium.org, Kevin Greer
Visibility:
Public.

Description

An implementation of chrome.socket.secure(). It adds a new TLSSocket type in the extensions:: namespace, that acts similarly to TCP/UDPSocket. Failures to enable TLS will auto-close the socket. API Proposal: https://docs.google.com/a/google.com/document/d/1XSjBtLjyGXQmgB0XE4kxuvM0p2yKI_8T5aOiKDJ9lFg/edit BUG=132896 TESTED=some, mostly with a custom chrome app, and with the included test. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=285804

Patch Set 1 #

Patch Set 2 : Pulled out TLSSocket into a new file, cleaned up a bit. #

Patch Set 3 : Added TLS Options and unit tests. #

Patch Set 4 : Lint fixes, and a gclient-sync to help trybots merge. #

Patch Set 5 : Added a virtual tag to a WriteImpl method, to make clang happy. #

Patch Set 6 : Fixing another cross-platform build issue. #

Patch Set 7 : Fixing another cross-platform build issue (try 2) #

Total comments: 35

Patch Set 8 : Made TLSSocket resumable, responses to sleevi's round-1 comments. #

Total comments: 27

Patch Set 9 : After Renaud's comments. Added a secure() to sockets.tcp. #

Total comments: 20

Patch Set 10 : Another round of responses to Renaud. #

Total comments: 58

Patch Set 11 : Updates for Ryan's comments. #

Patch Set 12 : Save and Restores Persistent/Paused state when securing. #

Total comments: 22

Patch Set 13 : An integration test, and some nits fixed. #

Total comments: 34

Patch Set 14 : Separated socket/TLS tests, more smart pointers for stuff.' #

Patch Set 15 : One more commenting fix. #

Patch Set 16 : Just a git cl format. #

Patch Set 17 : Double. Spaces removed. #

Total comments: 16

Patch Set 18 : Updated documentation and clearer identifiers. #

Patch Set 19 : Added a check on whether the socket to be TLS'd has a pending read. #

Total comments: 12

Patch Set 20 : An un-DCHECK-ification, a new test, a test clarification, and a lot of nit-double-spaces. #

Total comments: 11

Patch Set 21 : Added a large-write test, some spelling/doc fixes, and a stronger check for canonicalized names. #

Total comments: 2

Patch Set 22 : Addressed, @rsleevi's comments, added a new TLS test, further separated TLS and TCP tests, and reba… #

Total comments: 10

Patch Set 23 : Tiny, tiny, tiny changes to clean up the diffs post-rebase. #

Total comments: 2

Patch Set 24 : Updated test for >16k writes, ignore_result() used, dep on URLRequestContextGetter removed. #

Patch Set 25 : Rebase with build fixes only. (2) #

Patch Set 26 : Stop using Profile and move completely to URLRequestContext. #

Total comments: 14

Patch Set 27 : Rebase to LKGR for Jul 14. No other changes. #

Patch Set 28 : Final or near-final patch for submission. Ryan's comments are addressed, and histograms.xml change… #

Patch Set 29 : Updated tls_socket_unittest for a mocked method signature change. (2) #

Total comments: 11

Patch Set 30 : LKGR rebase before reviewer edits. #

Patch Set 31 : Updates after mek@ comments. #

Patch Set 32 : Morning LKGR Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1360 lines, -38 lines) Patch
A chrome/browser/extensions/api/socket/tls_socket_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +320 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/sockets_tcp/sockets_tcp_apitest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 chunk +25 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/sockets_tcp/api/background.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 14 chunks +200 lines, -34 lines 0 comments Download
M extensions/browser/api/api_resource_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 2 chunks +26 lines, -0 lines 0 comments Download
M extensions/browser/api/socket/socket.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 2 chunks +17 lines, -2 lines 0 comments Download
M extensions/browser/api/socket/socket_api.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 5 chunks +36 lines, -1 line 0 comments Download
M extensions/browser/api/socket/socket_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 6 chunks +84 lines, -0 lines 0 comments Download
M extensions/browser/api/socket/tcp_socket.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +13 lines, -0 lines 0 comments Download
M extensions/browser/api/socket/tcp_socket.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 chunks +32 lines, -0 lines 0 comments Download
A extensions/browser/api/socket/tls_socket.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 chunk +119 lines, -0 lines 0 comments Download
A extensions/browser/api/socket/tls_socket.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 chunk +309 lines, -0 lines 0 comments Download
M extensions/browser/api/sockets_tcp/sockets_tcp_api.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +24 lines, -0 lines 0 comments Download
M extensions/browser/api/sockets_tcp/sockets_tcp_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 4 chunks +104 lines, -1 line 0 comments Download
M extensions/browser/extension_function_histogram_value.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/common/api/socket.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 3 chunks +22 lines, -0 lines 0 comments Download
M extensions/common/api/sockets_tcp.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +22 lines, -0 lines 0 comments Download
M extensions/extensions.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 chunk +2 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 52 (0 generated)
rpaquay
This is great work, but, as mentioned on apps-dev@chromium.org, I think it would be better ...
7 years, 1 month ago (2013-11-22 19:04:47 UTC) #1
Lally Singh
Thanks. I'll be working on integrating sockets_tcp in a follow-up CL.
7 years, 1 month ago (2013-11-22 20:55:33 UTC) #2
Ryan Sleevi
Definitely needs review by the extensions team. I've tried to focus on how the net/ ...
7 years ago (2013-11-25 17:30:13 UTC) #3
Lally Singh
Ryan: I did what I could, within what I know how to do with the ...
7 years ago (2013-12-05 17:07:12 UTC) #4
rpaquay
https://codereview.chromium.org/76403004/diff/380001/chrome/browser/extensions/api/socket/socket.h File chrome/browser/extensions/api/socket/socket.h (right): https://codereview.chromium.org/76403004/diff/380001/chrome/browser/extensions/api/socket/socket.h#newcode52 chrome/browser/extensions/api/socket/socket.h:52: } The convention for simple accessors is "set_hostname". https://codereview.chromium.org/76403004/diff/380001/chrome/browser/extensions/api/socket/socket.h#newcode56 ...
7 years ago (2013-12-09 23:02:02 UTC) #5
lally
Gentlemen, please take another look. Ryan: this patch-set, versus the prior, isn't much different. So, ...
7 years ago (2013-12-12 02:31:38 UTC) #6
rpaquay
https://codereview.chromium.org/76403004/diff/400001/chrome/browser/extensions/api/socket/socket_api.cc File chrome/browser/extensions/api/socket/socket_api.cc (right): https://codereview.chromium.org/76403004/diff/400001/chrome/browser/extensions/api/socket/socket_api.cc#newcode927 chrome/browser/extensions/api/socket/socket_api.cc:927: Profile* profile = GetProfile(); nit: move this closer to ...
7 years ago (2013-12-16 20:18:46 UTC) #7
lally
PTAL. Thanks. https://codereview.chromium.org/76403004/diff/400001/chrome/browser/extensions/api/socket/socket_api.cc File chrome/browser/extensions/api/socket/socket_api.cc (right): https://codereview.chromium.org/76403004/diff/400001/chrome/browser/extensions/api/socket/socket_api.cc#newcode927 chrome/browser/extensions/api/socket/socket_api.cc:927: Profile* profile = GetProfile(); On 2013/12/16 20:18:46, ...
7 years ago (2013-12-16 22:20:06 UTC) #8
Ryan Sleevi
Just a ... few... comments. I still have some real issues with the inheritance-that-is-not-inheritance, and ...
7 years ago (2013-12-17 00:37:40 UTC) #9
lally
I think I've gotten everything. https://codereview.chromium.org/76403004/diff/420001/chrome/browser/extensions/api/socket/socket.h File chrome/browser/extensions/api/socket/socket.h (right): https://codereview.chromium.org/76403004/diff/420001/chrome/browser/extensions/api/socket/socket.h#newcode115 chrome/browser/extensions/api/socket/socket.h:115: std::string hostname_; On 2013/12/17 ...
6 years, 11 months ago (2014-01-09 18:47:16 UTC) #10
Ryan Sleevi
Comments just on the diffs from patchset 10. I feel like I should push back ...
6 years, 11 months ago (2014-01-14 01:32:06 UTC) #11
Ryan Sleevi
On 2014/01/14 01:32:06, Ryan Sleevi wrote: > Comments just on the diffs from patchset 10. ...
6 years, 11 months ago (2014-01-27 21:54:21 UTC) #12
lally
I've added an integration test (piggybacking on an existing test that lived in a test ...
6 years, 10 months ago (2014-01-29 23:57:45 UTC) #13
rpaquay
lgtm assuming Ryan has no further comments.
6 years, 10 months ago (2014-02-04 20:53:15 UTC) #14
Ryan Sleevi
Still some pretty serious threading issues, AFAICT, and a few SECURITY-related questions duplicated between both. ...
6 years, 10 months ago (2014-02-04 22:28:13 UTC) #15
lally
Thanks, I've just uploaded changes. The test-case code on the javascript was already split up ...
6 years, 10 months ago (2014-02-11 22:05:35 UTC) #16
Ryan Sleevi
Thanks for your continued patience on this lally. Another round of feedback after approaching this ...
6 years, 10 months ago (2014-02-24 20:06:48 UTC) #17
lally
Thank you for your review. It's important to get this right, so it's worth the ...
6 years, 9 months ago (2014-02-27 17:05:58 UTC) #18
lally
Quick update after talking to Renaud. https://codereview.chromium.org/76403004/diff/850001/chrome/browser/extensions/api/api_resource_manager.h File chrome/browser/extensions/api/api_resource_manager.h (right): https://codereview.chromium.org/76403004/diff/850001/chrome/browser/extensions/api/api_resource_manager.h#newcode221 chrome/browser/extensions/api/api_resource_manager.h:221: bool Set(const std::string& ...
6 years, 9 months ago (2014-02-27 21:43:18 UTC) #19
Ryan Sleevi
On 2014/02/27 21:43:18, lally wrote: > Quick update after talking to Renaud. > > https://codereview.chromium.org/76403004/diff/850001/chrome/browser/extensions/api/api_resource_manager.h ...
6 years, 9 months ago (2014-02-28 00:09:15 UTC) #20
Lally Singh
That's a nice attack! I don't believe we're susceptible to it. Renaud, am I correct ...
6 years, 9 months ago (2014-03-03 22:01:56 UTC) #21
rpaquay
> Renaud, am I correct in my analysis of the code? I think so. I ...
6 years, 9 months ago (2014-03-03 23:25:25 UTC) #22
Ryan Sleevi
Yeah, if you call secure, you shouldn't allow any operations until secure finishes. Simply deferring ...
6 years, 9 months ago (2014-03-03 23:30:41 UTC) #23
Lally Singh
On Mon, Mar 3, 2014 at 6:25 PM, <rpaquay@chromium.org> wrote: > Renaud, am I correct ...
6 years, 9 months ago (2014-03-03 23:50:14 UTC) #24
Lally Singh
Small addendum: at least with NSS, we can't hit this problem (as I've tested this ...
6 years, 9 months ago (2014-03-04 17:02:15 UTC) #25
Lally Singh
The new patch set is up. PTAL, thanks. On Mar 4, 2014 12:01 PM, "Lally ...
6 years, 9 months ago (2014-03-06 16:39:30 UTC) #26
Ryan Sleevi
On 2014/03/03 23:50:14, Lally Singh wrote: > On Mon, Mar 3, 2014 at 6:25 PM, ...
6 years, 9 months ago (2014-03-12 23:26:41 UTC) #27
Ryan Sleevi
On 2014/03/04 17:02:15, Lally Singh wrote: > Small addendum: at least with NSS, we can't ...
6 years, 9 months ago (2014-03-12 23:27:19 UTC) #28
Ryan Sleevi
Can you add a test for attempting to upgrade while a read is pending? https://codereview.chromium.org/76403004/diff/850001/chrome/browser/extensions/api/socket/socket.h ...
6 years, 9 months ago (2014-03-12 23:35:26 UTC) #29
lally
Hi. I've added a test that has a pending read() when calling secure(). Additionally, some ...
6 years, 9 months ago (2014-03-17 01:58:05 UTC) #30
Lally Singh
Also, I forgot to mention: I added IDN canonicalization (via net::CanonicalizeHost) to TLSSocket::UpgradeSocketToTLS. The NSS ...
6 years, 9 months ago (2014-03-17 14:34:46 UTC) #31
Ryan Sleevi
https://codereview.chromium.org/76403004/diff/960001/chrome/browser/extensions/api/socket/tcp_socket.cc File chrome/browser/extensions/api/socket/tcp_socket.cc (right): https://codereview.chromium.org/76403004/diff/960001/chrome/browser/extensions/api/socket/tcp_socket.cc#newcode326 chrome/browser/extensions/api/socket/tcp_socket.cc:326: client_socket = socket_.release(); may get a clang warning here ...
6 years, 9 months ago (2014-03-18 01:05:11 UTC) #32
lally
Hi Ryan and Renaud, I've added the test Ryan asked for, and cleaned up any ...
6 years, 9 months ago (2014-03-26 03:17:51 UTC) #33
Ryan Sleevi
Hi Lally, I've attempted to review your changes from patchset 19 to present. Rebasing and ...
6 years, 9 months ago (2014-03-26 19:57:39 UTC) #34
lally
Hello! Updates on the latest patch-set: - use ignore_result() around socket_.release() (which is WARN_UNUSED_RESULT). - ...
6 years, 9 months ago (2014-03-28 16:22:49 UTC) #35
caffinatedmonkey
lally, How is it going? I can't wait to see this feature in chrome apps.
6 years, 7 months ago (2014-05-08 12:47:52 UTC) #36
chromium-reviews
Hi Martin. I'm injured and in the hospital, but will get back to work on ...
6 years, 7 months ago (2014-05-08 12:49:35 UTC) #37
caffinatedmonkey
Oh, Sorry. Get well soon. Here have a hug. *hugs*
6 years, 7 months ago (2014-05-08 15:30:22 UTC) #38
lally
Hello! It's been a while! There are two new patch sets uploaded, 25 and 26. ...
6 years, 5 months ago (2014-07-05 03:24:59 UTC) #39
Ryan Sleevi
Oof. You're a saint for continuing to push on this CL. I'd be far more ...
6 years, 5 months ago (2014-07-15 00:18:45 UTC) #40
lally
Mark: Hi! You were suggested from git-cl owners for: extensions/browser/extension_function_histogram_value.h tools/metrics/histograms/histograms.xml Please let me know ...
6 years, 5 months ago (2014-07-16 16:19:45 UTC) #41
Mark P
histograms.xml and extension_function_histogram_value.h lgtm
6 years, 5 months ago (2014-07-17 19:06:28 UTC) #42
Marijn Kruisselbrink
Sorry for not having looked at this earlier. Assuming the base::Unretained in calling OnReadComplete is ...
6 years, 5 months ago (2014-07-24 22:44:08 UTC) #43
rpaquay
https://codereview.chromium.org/76403004/diff/1340001/extensions/browser/api/socket/tls_socket.cc File extensions/browser/api/socket/tls_socket.cc (right): https://codereview.chromium.org/76403004/diff/1340001/extensions/browser/api/socket/tls_socket.cc#newcode117 extensions/browser/api/socket/tls_socket.cc:117: &TLSSocket::OnReadComplete, base::Unretained(this), io_buffer)); On 2014/07/24 22:44:08, Marijn Kruisselbrink wrote: ...
6 years, 5 months ago (2014-07-24 23:06:13 UTC) #44
Marijn Kruisselbrink
https://codereview.chromium.org/76403004/diff/1340001/extensions/browser/api/socket/tls_socket.cc File extensions/browser/api/socket/tls_socket.cc (right): https://codereview.chromium.org/76403004/diff/1340001/extensions/browser/api/socket/tls_socket.cc#newcode117 extensions/browser/api/socket/tls_socket.cc:117: &TLSSocket::OnReadComplete, base::Unretained(this), io_buffer)); On 2014/07/24 23:06:13, rpaquay wrote: > ...
6 years, 5 months ago (2014-07-24 23:17:43 UTC) #45
ldixon
On 2014/07/24 23:17:43, Marijn Kruisselbrink wrote: > https://codereview.chromium.org/76403004/diff/1340001/extensions/browser/api/socket/tls_socket.cc > File extensions/browser/api/socket/tls_socket.cc (right): > > https://codereview.chromium.org/76403004/diff/1340001/extensions/browser/api/socket/tls_socket.cc#newcode117 ...
6 years, 5 months ago (2014-07-25 00:21:52 UTC) #46
Ryan Sleevi
https://codereview.chromium.org/76403004/diff/1340001/extensions/browser/api/socket/tls_socket.cc File extensions/browser/api/socket/tls_socket.cc (right): https://codereview.chromium.org/76403004/diff/1340001/extensions/browser/api/socket/tls_socket.cc#newcode117 extensions/browser/api/socket/tls_socket.cc:117: &TLSSocket::OnReadComplete, base::Unretained(this), io_buffer)); On 2014/07/24 23:17:42, Marijn Kruisselbrink wrote: ...
6 years, 5 months ago (2014-07-25 00:31:00 UTC) #47
Ryan Sleevi
Also documented here: https://code.google.com/p/chromium/codesearch#chromium/src/net/socket/socket.h&rcl=1406144298&l=20
6 years, 5 months ago (2014-07-25 00:31:53 UTC) #48
Lally Singh
The CQ bit was checked by lally@google.com
6 years, 5 months ago (2014-07-26 15:23:39 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lally@chromium.org/76403004/1400001
6 years, 5 months ago (2014-07-26 15:24:27 UTC) #50
lally
Thanks everyone. I've put in a comment modeled on TCPClientSocket::Read to explain the use of ...
6 years, 5 months ago (2014-07-26 15:25:18 UTC) #51
commit-bot: I haz the power
6 years, 5 months ago (2014-07-26 20:16:27 UTC) #52
Message was sent while issue was closed.
Change committed as 285804

Powered by Google App Engine
This is Rietveld 408576698