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

Issue 220493003: Safebrowsing: change gethash caching to match api 2.3 rules, fix some corner cases. (Closed)

Created:
6 years, 8 months ago by mattm
Modified:
6 years, 3 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Safebrowsing: change gethash caching to match api 2.3 rules, fix some corner cases. Major differences: 1. Even if a fullhash matches one from an addchunk, still do a gethash to verify it. 2. Cached gethash results are cleared every update and on restart. 3. Cached gethash results have independent cache lifetimes. (This CL uses hardcoded cache_lifetime of 45 minutes since it still does v2.2 requests.) BUG=357763

Patch Set 1 #

Patch Set 2 : . #

Total comments: 14

Patch Set 3 : changes for review #2 #

Total comments: 16

Patch Set 4 : rebase #

Patch Set 5 : changes for review #8 #

Patch Set 6 : changes to fullhash / prefix handling #

Total comments: 1

Patch Set 7 : rebase (including 227613008) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1004 lines, -661 lines) Patch
M chrome/browser/safe_browsing/database_manager.h View 1 2 3 4 3 chunks +4 lines, -9 lines 0 comments Download
M chrome/browser/safe_browsing/database_manager.cc View 1 2 3 4 6 chunks +11 lines, -18 lines 0 comments Download
M chrome/browser/safe_browsing/database_manager_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/protocol_manager.h View 1 2 3 4 5 6 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/safe_browsing/protocol_manager.cc View 1 2 3 4 5 6 6 chunks +11 lines, -5 lines 0 comments Download
M chrome/browser/safe_browsing/protocol_parser.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/protocol_parser_unittest.cc View 2 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_database.h View 1 2 7 chunks +26 lines, -28 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_database.cc View 1 2 3 4 5 19 chunks +93 lines, -157 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_database_unittest.cc View 1 2 3 4 5 49 chunks +749 lines, -261 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc View 1 9 chunks +14 lines, -20 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_store.h View 3 chunks +6 lines, -18 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_store_file.h View 1 2 3 4 5 6 3 chunks +4 lines, -7 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_store_file.cc View 1 2 3 4 5 6 5 chunks +3 lines, -10 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_store_file_unittest.cc View 33 chunks +32 lines, -93 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_store_unittest.cc View 6 chunks +22 lines, -26 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_util.h View 3 chunks +14 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_util.cc View 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
mattm
shess for review bryner for fyi This will put us in a state where chrome ...
6 years, 8 months ago (2014-04-01 05:37:26 UTC) #1
Scott Hess - ex-Googler
Overall, I'm still thinking about whether this change maybe changes some rationales for the full-hash ...
6 years, 8 months ago (2014-04-01 22:08:36 UTC) #2
Scott Hess - ex-Googler
BTW - there is a big piece of this which is basically "Drop add_chunk_id from ...
6 years, 8 months ago (2014-04-01 22:46:04 UTC) #3
mattm
On 2014/04/01 22:08:36, shess wrote: > Overall, I'm still thinking about whether this change maybe ...
6 years, 8 months ago (2014-04-03 01:33:48 UTC) #4
mattm
https://codereview.chromium.org/220493003/diff/40001/chrome/browser/safe_browsing/database_manager.cc File chrome/browser/safe_browsing/database_manager.cc (left): https://codereview.chromium.org/220493003/diff/40001/chrome/browser/safe_browsing/database_manager.cc#oldcode345 chrome/browser/safe_browsing/database_manager.cc:345: sb_service_->protocol_manager()->last_update()); On 2014/04/01 22:08:36, shess wrote: > I can't ...
6 years, 8 months ago (2014-04-03 01:38:12 UTC) #5
mattm
On 2014/04/01 22:46:04, shess wrote: > BTW - there is a big piece of this ...
6 years, 8 months ago (2014-04-03 01:44:38 UTC) #6
Scott Hess - ex-Googler
On 2014/04/03 01:33:48, mattm wrote: > On 2014/04/01 22:08:36, shess wrote: > > Overall, I'm ...
6 years, 8 months ago (2014-04-03 18:24:10 UTC) #7
Scott Hess - ex-Googler
My initial thought with the cache was that it might allow the system to get ...
6 years, 8 months ago (2014-04-03 21:44:03 UTC) #8
Scott Hess - ex-Googler
BTW, I apologize for the existence of safe_browsing_database_unittest.cc.
6 years, 8 months ago (2014-04-03 22:42:05 UTC) #9
mattm
updated. Patch set 5 addresses CL review comments. Patch set 6 addresses the comments on ...
6 years, 8 months ago (2014-04-04 23:58:49 UTC) #10
Scott Hess - ex-Googler
On 2014/04/04 23:58:49, mattm wrote: > updated. Just FYI, my brain has reached saturation for ...
6 years, 8 months ago (2014-04-05 00:28:28 UTC) #11
Scott Hess - ex-Googler
6 years, 8 months ago (2014-04-07 17:32:02 UTC) #12
https://codereview.chromium.org/220493003/diff/120001/chrome/browser/safe_bro...
File chrome/browser/safe_browsing/safe_browsing_database.cc (right):

https://codereview.chromium.org/220493003/diff/120001/chrome/browser/safe_bro...
chrome/browser/safe_browsing/safe_browsing_database.cc:683: }
I think we need to iron out the thread we're having with Brian about whether
this is correct.  IMHO if the server sent a prefix with an associated fullhash,
then we definitely need to check the fullhash in this case.  But maybe the
server never ever would send that?  I don't think it's obvious.

Also, this change implies that all existing databases are broken and will need
to be resynced.  Which also is a problem.

Powered by Google App Engine
This is Rietveld 408576698