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

Issue 3173032: AU: Payload Signer class (Closed)

Created:
10 years, 4 months ago by adlr
Modified:
10 years, 4 months ago
Reviewers:
petkov
CC:
chromium-os-reviews_chromium.org, petkov, adlr
Base URL:
ssh://git@chromiumos-git/update_engine.git
Visibility:
Public.

Description

AU: Payload Signer class This class can take a private key and sign a blob of data. The API is amenable to the upcoming change to delta_diff_generator that will use it. Also, minor change to the protobuf to support signatures. TEST=unittests BUG=5662

Patch Set 1 #

Total comments: 12

Patch Set 2 : fixes for review #

Patch Set 3 : git pull #

Unified diffs Side-by-side diffs Delta from patch set Stats (+215 lines, -2 lines) Patch
M SConstruct View 2 chunks +2 lines, -0 lines 0 comments Download
A payload_signer.h View 1 1 chunk +38 lines, -0 lines 0 comments Download
A payload_signer.cc View 1 1 chunk +79 lines, -0 lines 0 comments Download
A payload_signer_unittest.cc View 1 1 chunk +79 lines, -0 lines 0 comments Download
A unittest_key.pem View 1 chunk +15 lines, -0 lines 0 comments Download
M update_metadata.proto View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
adlr
10 years, 4 months ago (2010-08-20 04:56:10 UTC) #1
petkov
10 years, 4 months ago (2010-08-20 05:28:05 UTC) #2
Looks OK functionally, some nits and suggestions below.

LGTM

http://codereview.chromium.org/3173032/diff/1/3
File payload_signer.cc (right):

http://codereview.chromium.org/3173032/diff/1/3#newcode1
payload_signer.cc:1: // Copyright (c) 2010 The Chromium Authors. All rights
reserved.
Chromium OS Authors

http://codereview.chromium.org/3173032/diff/1/3#newcode6
payload_signer.cc:6: #include "base/logging.h"
insert an empty line before base/logging.h

http://codereview.chromium.org/3173032/diff/1/3#newcode30
payload_signer.cc:30: vector<string> cmd;
It might be better to use base::SplitString (from string_util.h) here to split a
command line string into vector<string>. Then you wouldn't need the comment
above about the actual command line.

http://codereview.chromium.org/3173032/diff/1/4
File payload_signer.h (right):

http://codereview.chromium.org/3173032/diff/1/4#newcode1
payload_signer.h:1: // Copyright (c) 2010 The Chromium Authors. All rights
reserved.
Chromium OS Authors

http://codereview.chromium.org/3173032/diff/1/4#newcode14
payload_signer.h:14: // blob, which should be appended. See
update_metadata.proto for more info.
... and returns the signature blob, which should be appended...

http://codereview.chromium.org/3173032/diff/1/5
File payload_signer_unittest.cc (right):

http://codereview.chromium.org/3173032/diff/1/5#newcode19
payload_signer_unittest.cc:19: const char* kUnittestPrivateKeyPath =
"unittest_key.pem";
const char kUnit...[] = ...

http://codereview.chromium.org/3173032/diff/1/5#newcode25
payload_signer_unittest.cc:25: TEST(PayloadSignerTest, SimpleTest) {
Given that you've defined the fixture class PayloadSignerTest, you should use
TEST_F, I think. Otherwise, you don't need to declare the PayloadSignerTest... I
may be wrong.

http://codereview.chromium.org/3173032/diff/1/5#newcode26
payload_signer_unittest.cc:26: // static bool SignPayload(const std::string&
unsigned_payload_path,
Do you really need these comments here? Remove, I'd say...

http://codereview.chromium.org/3173032/diff/1/5#newcode56
payload_signer_unittest.cc:56: 
Remove blank line.

http://codereview.chromium.org/3173032/diff/1/5#newcode62
payload_signer_unittest.cc:62: kDataToSign.c_str(),
kDataToSign.data()

http://codereview.chromium.org/3173032/diff/1/5#newcode77
payload_signer_unittest.cc:77:
EXPECT_TRUE(signatures.ParseFromArray(&signature_blob[0],
signature_blob.data() maybe?

http://codereview.chromium.org/3173032/diff/1/5#newcode83
payload_signer_unittest.cc:83: EXPECT_EQ(sizeof(kExpectedSignature),
sig_data.size());
Can't you switch to ASSERT_EQ and avoid the if below?

Powered by Google App Engine
This is Rietveld 408576698