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

Issue 3327005: Add a "verify" option to sign_official_build.sh. (Closed)

Created:
10 years, 3 months ago by gauravsh
Modified:
9 years, 6 months ago
CC:
chromium-os-reviews_chromium.org, Randall Spangler, gauravsh, Luigi Semenzato, Bill Richardson
Visibility:
Public.

Description

Add a "verify" option to sign_official_build.sh. This option will perform verification operations on an image. 1) Check if the RootFS hash is correct. 2) Check if the image will verify using recovery keys (in recovery mode) 3) Check if the image will verify using SSD keys (in non-recovery mode) 2) and 3) are both tested with and without dev mode. Also re-factor existing code for rootfs calculation and update. BUG=5830, 3496 TEST=manual Example usage and output follows: # Verifying an image meant for factory install. sudo ./sign_official_build.sh verify factory_install_image.sh ../../tests/devkeys/ Verifying RootFS hash... PASS: RootFS hash is correct Testing key verification... With Recovery Key (Recovery Mode ON, Dev Mode OFF): NO With Recovery Key (Recovery Mode ON, Dev Mode ON): YES With SSD Key (Recovery Mode OFF, Dev Mode OFF): NO With SSD Key (Recovery Mode OFF, Dev Mode ON): YES # Verifying an image meant for recovery mode. sudo ./sign_official_build.sh verify recovery_image.bin ../../tests/devkeys/ Verifying RootFS hash... PASS: RootFS hash is correct Testing key verification... With Recovery Key (Recovery Mode ON, Dev Mode OFF): YES With Recovery Key (Recovery Mode ON, Dev Mode ON): YES With SSD Key (Recovery Mode OFF, Dev Mode OFF): NO With SSD Key (Recovery Mode OFF, Dev Mode ON): YES # Verifying an image meant for the SSD drive. sudo ./sign_official_build.sh verify ssd_image.bin ../../tests/devkeys/ Verifying RootFS hash... PASS: RootFS hash is correct Testing key verification... With Recovery Key (Recovery Mode ON, Dev Mode OFF): NO With Recovery Key (Recovery Mode ON, Dev Mode ON): NO With SSD Key (Recovery Mode OFF, Dev Mode OFF): YES With SSD Key (Recovery Mode OFF, Dev Mode ON): YES # Image with an incorrect rootfs hash but otherwise validly signed sudo ./sign_official_build.sh verify ssd_image.bin ../../tests/devkeys/ Verifying RootFS hash... FAILED: RootFS hash is incorrect. Expected: ebce345727ca05ea9368d3b8d5ce1c81471d7d3b Got: 9b092985996bb2422b11487a66929a1a004df4fc Testing key verification... With Recovery Key (Recovery Mode ON, Dev Mode OFF): NO With Recovery Key (Recovery Mode ON, Dev Mode ON): NO With SSD Key (Recovery Mode OFF, Dev Mode OFF): YES With SSD Key (Recovery Mode OFF, Dev Mode ON): YES # Image signed using a different set of keys (but validly signed). sudo ./sign_official_build.sh verify invalid_image.bin ../../tests/devkeys/ Verifying RootFS hash... PASS: RootFS hash is correct (70e6f2de0220991fd503a6fcc7edac131b4a48ca) Testing key verification... With Recovery Key (Recovery Mode ON, Dev Mode OFF): NO With Recovery Key (Recovery Mode ON, Dev Mode ON): NO With SSD Key (Recovery Mode OFF, Dev Mode OFF): NO With SSD Key (Recovery Mode OFF, Dev Mode ON): YES Change-Id: I4960cdbbbe93e685346417b882739f9cfd5f6b75

Patch Set 1 : ws fixes #

Total comments: 4

Patch Set 2 : nosudo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+148 lines, -43 lines) Patch
M scripts/image_signing/common.sh View 1 chunk +2 lines, -2 lines 0 comments Download
M scripts/image_signing/sign_official_build.sh View 1 12 chunks +146 lines, -41 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
gauravsh
10 years, 3 months ago (2010-09-02 00:44:06 UTC) #1
Nick Sanders
this looks really useful, thanks!
10 years, 3 months ago (2010-09-02 06:02:20 UTC) #2
gauravsh
Since I listed multiple reviewers and to avoid confusion - Randall: You are the primary ...
10 years, 3 months ago (2010-09-02 21:16:38 UTC) #3
Randall Spangler
http://codereview.chromium.org/3327005/diff/4001/5002 File scripts/image_signing/sign_official_build.sh (right): http://codereview.chromium.org/3327005/diff/4001/5002#newcode63 scripts/image_signing/sign_official_build.sh:63: sudo dump_kernel_config ${temp_kimage} why does dump_kernel_config need sudo? http://codereview.chromium.org/3327005/diff/4001/5002#newcode132 ...
10 years, 3 months ago (2010-09-03 00:19:13 UTC) #4
gauravsh
http://codereview.chromium.org/3327005/diff/4001/5002 File scripts/image_signing/sign_official_build.sh (right): http://codereview.chromium.org/3327005/diff/4001/5002#newcode63 scripts/image_signing/sign_official_build.sh:63: sudo dump_kernel_config ${temp_kimage} On 2010/09/03 00:19:13, Randall Spangler wrote: ...
10 years, 3 months ago (2010-09-03 01:18:51 UTC) #5
Nick Sanders
On Thu, Sep 2, 2010 at 2:16 PM, <gauravsh@chromium.org> wrote: > Since I listed multiple ...
10 years, 3 months ago (2010-09-03 08:28:48 UTC) #6
Randall Spangler
10 years, 3 months ago (2010-09-03 15:30:22 UTC) #7
LGTM, thanks

Powered by Google App Engine
This is Rietveld 408576698