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

Issue 10944009: Implementation of ONC signature, validator and normalizer. (Closed)

Created:
8 years, 3 months ago by pneubeck (no reviews)
Modified:
8 years, 1 month ago
CC:
chromium-reviews, oshima+watch_chromium.org, stevenjb+watch_chromium.org, nkostylev+watch_chromium.org, davemoore+watch_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@gperffix
Visibility:
Public.

Description

This CL provides a general ONC signature which is used for validation and normalization. ONCValidator checks the existence of fields and types and may be extended further checks (e.g. format of IPAddresses or URLs can be checked there too). It supports removing unknown fields. ONCNormalizer removes ignored/unnecessary fields. This new code will not be in use, yet, but prepares for further changes to the network settings. About the code organization: My idea was to put all network settings related stuff into chromeos/network_settings and thus giving up on the monolithic NetworkLibrary. In upcoming CLs, I will provide an ONC merger and a translator between ONC and Shill which will also use this signature (the Shill keys are already part of the signature). BUG=chromium:148905 TBR=ben@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=166222

Patch Set 1 #

Total comments: 33

Patch Set 2 : Removed ONCMerger. Added a ONC signature and implemented validation and normalization on top. #

Total comments: 7

Patch Set 3 : Rebased. #

Patch Set 4 : Addressed comments (formatting, sorting). Minor change in policy.onc. #

Total comments: 30

Patch Set 5 : Rebased. #

Patch Set 6 : Addressed comments. #

Patch Set 7 : Added using declaration. Removed unused include. Added headers to .gypi. #

Patch Set 8 : Added more signatures. Removed redundant namespace qualifier 'onc'. Some minor changes. #

Patch Set 9 : Fixed different mistakes. Added a Normalizer unit test. Changed logging to DVLOG. #

Patch Set 10 : Completed validator for complete ONC. Integrated into OncNetworkParser. #

Total comments: 45

Patch Set 11 : Addressed comments. #

Total comments: 10

Patch Set 12 : Fixed minor issues. #

Total comments: 6

Patch Set 13 : Addressed remaining nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2074 lines, -8 lines) Patch
M base/values.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M base/values.cc View 1 2 3 4 5 6 7 8 9 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/cros/onc_constants.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +65 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/cros/onc_constants.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +62 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/cros/onc_network_parser.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +22 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/network_settings/onc_mapper.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +103 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/network_settings/onc_mapper.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +140 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/network_settings/onc_normalizer.h View 1 2 3 4 5 6 7 8 1 chunk +49 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/network_settings/onc_normalizer.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +104 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/network_settings/onc_normalizer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/network_settings/onc_signature.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +53 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/network_settings/onc_signature.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +310 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/network_settings/onc_test_utils.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +36 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/network_settings/onc_test_utils.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +56 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/network_settings/onc_validator.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +152 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/network_settings/onc_validator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +562 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/network_settings/onc_validator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +143 lines, -0 lines 0 comments Download
M chrome/chrome_browser_chromeos.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
A chrome/test/data/chromeos/network_settings/invalid_settings_with_repairs.json View 1 2 3 4 5 6 7 8 9 10 1 chunk +92 lines, -0 lines 0 comments Download
A chrome/test/data/chromeos/network_settings/policy.onc View 1 2 3 4 5 6 7 8 9 1 chunk +29 lines, -0 lines 0 comments Download
A chrome/test/data/chromeos/network_settings/settings_with_normalization.json View 1 2 3 4 5 6 7 8 9 10 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/test/data/chromeos/network_settings/valid.onc View 1 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
pneubeck (no reviews)
Please have an overview of the CL. Thanks.
8 years, 3 months ago (2012-09-18 12:17:38 UTC) #1
Mattias Nissler (ping if slow)
The last paragraph in the CL description should probably have been on the review comment ...
8 years, 3 months ago (2012-09-18 16:29:08 UTC) #2
pneubeck (no reviews)
The implementations in the patches so far do not cover all of the ONC format. ...
8 years, 2 months ago (2012-10-02 15:03:02 UTC) #3
pneubeck (no reviews)
+stevenjb Could you please review this CL? This is my first CL preparing the discussed ...
8 years, 2 months ago (2012-10-02 15:42:39 UTC) #4
stevenjb
Greg should really be the primary reviewer of this, since it may overlap with what ...
8 years, 2 months ago (2012-10-02 17:46:05 UTC) #5
Greg Spencer (Chromium)
On 2012/10/02 17:46:05, stevenjb (chromium) wrote: > Greg should really be the primary reviewer of ...
8 years, 2 months ago (2012-10-03 21:25:06 UTC) #6
pneubeck (no reviews)
Yes, please review it. As you said protobuf is still a few steps ahead. Just ...
8 years, 2 months ago (2012-10-04 14:55:08 UTC) #7
Greg Spencer (Chromium)
http://codereview.chromium.org/10944009/diff/17001/chrome/browser/chromeos/network_settings/onc_signature.cc File chrome/browser/chromeos/network_settings/onc_signature.cc (right): http://codereview.chromium.org/10944009/diff/17001/chrome/browser/chromeos/network_settings/onc_signature.cc#newcode63 chrome/browser/chromeos/network_settings/onc_signature.cc:63: { NULL } You might want to use arraysize ...
8 years, 2 months ago (2012-10-08 19:21:08 UTC) #8
Mattias Nissler (ping if slow)
On Wed, Oct 3, 2012 at 11:25 PM, <gspencer@chromium.org> wrote: > On 2012/10/02 17:46:05, stevenjb ...
8 years, 2 months ago (2012-10-09 13:06:28 UTC) #9
Greg Spencer (Chromium)
On Tue, Oct 9, 2012 at 6:06 AM, Mattias Nissler <mnissler@chromium.org>wrote: > On Wed, Oct ...
8 years, 2 months ago (2012-10-09 15:34:04 UTC) #10
pneubeck (no reviews)
Addressed or replied to comments. http://codereview.chromium.org/10944009/diff/17001/chrome/browser/chromeos/network_settings/onc_signature.cc File chrome/browser/chromeos/network_settings/onc_signature.cc (right): http://codereview.chromium.org/10944009/diff/17001/chrome/browser/chromeos/network_settings/onc_signature.cc#newcode63 chrome/browser/chromeos/network_settings/onc_signature.cc:63: { NULL } In ...
8 years, 2 months ago (2012-10-09 16:19:18 UTC) #11
Greg Spencer (Chromium)
LGTM http://codereview.chromium.org/10944009/diff/17001/chrome/browser/chromeos/network_settings/onc_signature.cc File chrome/browser/chromeos/network_settings/onc_signature.cc (right): http://codereview.chromium.org/10944009/diff/17001/chrome/browser/chromeos/network_settings/onc_signature.cc#newcode63 chrome/browser/chromeos/network_settings/onc_signature.cc:63: { NULL } On 2012/10/09 16:19:19, pneubeck wrote: ...
8 years, 2 months ago (2012-10-09 16:42:22 UTC) #12
stevenjb
Sorry for the late review. Mostly nits. I haven't thought too hard about how this ...
8 years, 2 months ago (2012-10-11 19:54:00 UTC) #13
pneubeck (no reviews)
Addressed all comments. http://codereview.chromium.org/10944009/diff/20003/chrome/browser/chromeos/network_settings/onc_mapper.cc File chrome/browser/chromeos/network_settings/onc_mapper.cc (right): http://codereview.chromium.org/10944009/diff/20003/chrome/browser/chromeos/network_settings/onc_mapper.cc#newcode54 chrome/browser/chromeos/network_settings/onc_mapper.cc:54: !found_unknown_field) On 2012/10/11 19:54:00, stevenjb (chromium) ...
8 years, 2 months ago (2012-10-15 13:57:43 UTC) #14
stevenjb
LGTM with one change. http://codereview.chromium.org/10944009/diff/20003/chrome/browser/chromeos/network_settings/onc_signature.cc File chrome/browser/chromeos/network_settings/onc_signature.cc (right): http://codereview.chromium.org/10944009/diff/20003/chrome/browser/chromeos/network_settings/onc_signature.cc#newcode14 chrome/browser/chromeos/network_settings/onc_signature.cc:14: const base::Value::Type TYPE_DICTIONARY = base::Value::TYPE_DICTIONARY; ...
8 years, 2 months ago (2012-10-15 17:23:53 UTC) #15
pneubeck (no reviews)
I addressed the last comment of Steven and did several iterations on my own, where ...
8 years, 1 month ago (2012-10-30 08:42:04 UTC) #16
Mattias Nissler (ping if slow)
http://codereview.chromium.org/10944009/diff/81001/chrome/browser/chromeos/cros/onc_constants.h File chrome/browser/chromeos/cros/onc_constants.h (right): http://codereview.chromium.org/10944009/diff/81001/chrome/browser/chromeos/cros/onc_constants.h#newcode14 chrome/browser/chromeos/cros/onc_constants.h:14: extern const char kNetworkConfigurations[]; newline http://codereview.chromium.org/10944009/diff/81001/chrome/browser/chromeos/cros/onc_network_parser.cc File chrome/browser/chromeos/cros/onc_network_parser.cc (left): ...
8 years, 1 month ago (2012-11-02 10:09:59 UTC) #17
Mattias Nissler (ping if slow)
http://codereview.chromium.org/10944009/diff/81001/chrome/browser/chromeos/cros/onc_constants.h File chrome/browser/chromeos/cros/onc_constants.h (right): http://codereview.chromium.org/10944009/diff/81001/chrome/browser/chromeos/cros/onc_constants.h#newcode14 chrome/browser/chromeos/cros/onc_constants.h:14: extern const char kNetworkConfigurations[]; newline http://codereview.chromium.org/10944009/diff/81001/chrome/browser/chromeos/cros/onc_network_parser.cc File chrome/browser/chromeos/cros/onc_network_parser.cc (left): ...
8 years, 1 month ago (2012-11-02 10:09:59 UTC) #18
pneubeck (no reviews)
Addressed Mattias' comments. http://codereview.chromium.org/10944009/diff/81001/chrome/browser/chromeos/cros/onc_constants.h File chrome/browser/chromeos/cros/onc_constants.h (right): http://codereview.chromium.org/10944009/diff/81001/chrome/browser/chromeos/cros/onc_constants.h#newcode14 chrome/browser/chromeos/cros/onc_constants.h:14: extern const char kNetworkConfigurations[]; On 2012/11/02 ...
8 years, 1 month ago (2012-11-05 12:04:48 UTC) #19
pneubeck (no reviews)
Hi William, are you Ok with me adding the convenience function GetBooleanWithoutPathExpansion in base/values.* ? ...
8 years, 1 month ago (2012-11-05 12:12:07 UTC) #20
willchan no longer on Chromium
lgtm
8 years, 1 month ago (2012-11-05 15:45:54 UTC) #21
Mattias Nissler (ping if slow)
Mostly good, just a couple more minor things. http://codereview.chromium.org/10944009/diff/81001/chrome/browser/chromeos/network_settings/onc_validator.cc File chrome/browser/chromeos/network_settings/onc_validator.cc (right): http://codereview.chromium.org/10944009/diff/81001/chrome/browser/chromeos/network_settings/onc_validator.cc#newcode147 chrome/browser/chromeos/network_settings/onc_validator.cc:147: CHECK(recommended_list ...
8 years, 1 month ago (2012-11-06 09:30:56 UTC) #22
pneubeck (no reviews)
http://codereview.chromium.org/10944009/diff/91007/chrome/browser/chromeos/cros/onc_network_parser.cc File chrome/browser/chromeos/cros/onc_network_parser.cc (right): http://codereview.chromium.org/10944009/diff/91007/chrome/browser/chromeos/cros/onc_network_parser.cc#newcode317 chrome/browser/chromeos/cros/onc_network_parser.cc:317: new onc::Validator(error_on_unknown_field, On 2012/11/06 09:30:56, Mattias Nissler wrote: > ...
8 years, 1 month ago (2012-11-06 13:32:22 UTC) #23
Mattias Nissler (ping if slow)
LGTM with nits. http://codereview.chromium.org/10944009/diff/98008/chrome/browser/chromeos/network_settings/onc_validator.cc File chrome/browser/chromeos/network_settings/onc_validator.cc (right): http://codereview.chromium.org/10944009/diff/98008/chrome/browser/chromeos/network_settings/onc_validator.cc#newcode498 chrome/browser/chromeos/network_settings/onc_validator.cc:498: const char* valid_inner_values[] = please convert ...
8 years, 1 month ago (2012-11-06 13:49:18 UTC) #24
pneubeck (no reviews)
http://codereview.chromium.org/10944009/diff/98008/chrome/browser/chromeos/network_settings/onc_validator.cc File chrome/browser/chromeos/network_settings/onc_validator.cc (right): http://codereview.chromium.org/10944009/diff/98008/chrome/browser/chromeos/network_settings/onc_validator.cc#newcode498 chrome/browser/chromeos/network_settings/onc_validator.cc:498: const char* valid_inner_values[] = On 2012/11/06 13:49:19, Mattias Nissler ...
8 years, 1 month ago (2012-11-06 14:45:21 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pneubeck@chromium.org/10944009/88037
8 years, 1 month ago (2012-11-06 14:50:47 UTC) #26
commit-bot: I haz the power
Presubmit check for 10944009-88037 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 1 month ago (2012-11-06 14:50:59 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pneubeck@chromium.org/10944009/88037
8 years, 1 month ago (2012-11-06 14:52:30 UTC) #28
commit-bot: I haz the power
8 years, 1 month ago (2012-11-06 16:46:59 UTC) #29
Change committed as 166222

Powered by Google App Engine
This is Rietveld 408576698