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

Issue 564020: Data structure and interface for manipulating and handing firmware images for verified boot. (Closed)

Created:
10 years, 10 months ago by gauravsh
Modified:
9 years, 6 months ago
Reviewers:
Will Drewry
CC:
chromium-os-reviews_googlegroups.com
Visibility:
Public.

Description

Data structure and interface for manipulating and handing firmware images for verified boot.

Patch Set 1 : Basic reference working code. #

Patch Set 2 : Working Tests. #

Total comments: 6

Patch Set 3 : Makes the verification test act like tests. #

Total comments: 8

Patch Set 4 : Fix spaces etc. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+880 lines, -42 lines) Patch
A src/platform/vboot_reference/include/file_keys.h View 1 chunk +28 lines, -0 lines 0 comments Download
A src/platform/vboot_reference/include/firmware_image.h View 1 chunk +133 lines, -0 lines 0 comments Download
M src/platform/vboot_reference/tests/Makefile View 2 1 chunk +8 lines, -4 lines 0 comments Download
A src/platform/vboot_reference/tests/firmware_image_tests.c View 2 3 1 chunk +178 lines, -0 lines 0 comments Download
M src/platform/vboot_reference/tests/run_tests.sh View 2 3 chunks +28 lines, -2 lines 0 comments Download
M src/platform/vboot_reference/utils/Makefile View 1 2 1 chunk +19 lines, -4 lines 0 comments Download
A src/platform/vboot_reference/utils/file_keys.c View 1 chunk +57 lines, -0 lines 0 comments Download
A src/platform/vboot_reference/utils/firmware_image.c View 1 2 3 1 chunk +404 lines, -0 lines 0 comments Download
A src/platform/vboot_reference/utils/firmware_utility.c View 1 1 chunk +23 lines, -0 lines 0 comments Download
M src/platform/vboot_reference/utils/verify_data.c View 2 chunks +2 lines, -32 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
gauravsh
I am getting started on the interface for dealing with and testing firmware images for ...
10 years, 10 months ago (2010-02-02 23:42:23 UTC) #1
gauravsh
This is now ready for a look. I have verified(!) that the firmware image verification ...
10 years, 10 months ago (2010-02-10 01:53:12 UTC) #2
Randall Spangler
LGTM with one question for now and one todo for later. http://codereview.chromium.org/564020/diff/17001/17009 File src/platform/vboot_reference/utils/firmware_image.c (right): ...
10 years, 10 months ago (2010-02-10 21:25:26 UTC) #3
gauravsh
http://codereview.chromium.org/564020/diff/17001/17009 File src/platform/vboot_reference/utils/firmware_image.c (right): http://codereview.chromium.org/564020/diff/17001/17009#newcode129 src/platform/vboot_reference/utils/firmware_image.c:129: image->firmware_data = (uint8_t*) Malloc(image->firmware_len); On 2010/02/10 21:25:26, Randall Spangler ...
10 years, 10 months ago (2010-02-10 21:40:20 UTC) #4
gauravsh
Fixed the firmware image tests to act like real tests.
10 years, 10 months ago (2010-02-10 23:39:47 UTC) #5
gauravsh
ping
10 years, 10 months ago (2010-02-12 19:06:10 UTC) #6
Will Drewry
LGTM In general, it'd be nice to do more validation on images before signature just ...
10 years, 10 months ago (2010-02-12 23:06:28 UTC) #7
gauravsh
10 years, 10 months ago (2010-02-12 23:25:41 UTC) #8
I agree there should be more sanity checks in the verification code. The fixed
length headers and (signatures on the length field) somewhat ameliorate
potential problems. And I do some checks - like verifying the signature
algorithm. Is there any particular check in the code that is missing from the
VerifyFirmware code?

http://codereview.chromium.org/564020/diff/17001/17010
File src/platform/vboot_reference/utils/firmware_utility.c (right):

http://codereview.chromium.org/564020/diff/17001/17010#newcode21
src/platform/vboot_reference/utils/firmware_utility.c:21: /* TODO(gauravsh): TO
BE IMPLEMENTED. */
On 2010/02/12 23:06:29, Will Drewry wrote:
> Any reason this can't be done in C++ like our other userspace code?
I think this particular utility can be written in C++ since this will be a part
of the tool used by Google to generate signed firmware images.

http://codereview.chromium.org/564020/diff/17012/21002
File src/platform/vboot_reference/include/firmware_image.h (right):

http://codereview.chromium.org/564020/diff/17012/21002#newcode23
src/platform/vboot_reference/include/firmware_image.h:23: typedef struct
FirmwareImage {
On 2010/02/12 23:06:29, Will Drewry wrote:
> Do you expect these to be __attribute__((packed)) ? (packed, align(...)) ?
The way the firmware image binary is written automatically packs them (but
doesn't align them). So, the code doesn't assumes it, no. I was a bit vary of
using this __attribute__ since different compilers may do it differently.

http://codereview.chromium.org/564020/diff/17012/21004
File src/platform/vboot_reference/tests/firmware_image_tests.c (right):

http://codereview.chromium.org/564020/diff/17012/21004#newcode39
src/platform/vboot_reference/tests/firmware_image_tests.c:39: image->sign_key =
(uint8_t*) Malloc(RSAProcessedKeySize(image->sign_algorithm));
On 2010/02/12 23:06:29, Will Drewry wrote:
> Line too long

Fixed.

http://codereview.chromium.org/564020/diff/17012/21007
File src/platform/vboot_reference/utils/file_keys.c (right):

http://codereview.chromium.org/564020/diff/17012/21007#newcode35
src/platform/vboot_reference/utils/file_keys.c:35: *len = stat_fd.st_size;
On 2010/02/12 23:06:29, Will Drewry wrote:
> I'm pretty sure st_size is off_t which can be int or int64 depending on the
host
> architecture.  Unlikely to be a problem, but I'd expect -Wall to give you some
> complaints?
Surprisingly, it didn't. I think that's because C being more weakly-typed than
C++ doesn't complain about such implicit type conversions.

http://codereview.chromium.org/564020/diff/17012/21008
File src/platform/vboot_reference/utils/firmware_image.c (right):

http://codereview.chromium.org/564020/diff/17012/21008#newcode38
src/platform/vboot_reference/utils/firmware_image.c:38: FirmwareImage* image) {
On 2010/02/12 23:06:29, Will Drewry wrote:
> - space :)
Done.

Powered by Google App Engine
This is Rietveld 408576698