diff options
author | Randall Spangler <rspangler@chromium.org> | 2011-02-25 14:57:39 -0800 |
---|---|---|
committer | Randall Spangler <rspangler@chromium.org> | 2011-02-25 14:57:39 -0800 |
commit | c4d21025bb57d78c512c014b694ea148cea18d7e (patch) | |
tree | aef5166c6c82d95ac48304c9a5f987ff49bba187 /firmware/stub | |
parent | 92e378e453c7c7186a06d9021fb64eb7985937f5 (diff) | |
download | vboot-c4d21025bb57d78c512c014b694ea148cea18d7e.tar.gz |
Add LoadFirmware() support for NvStorage API
Change-Id: I19f402904978581eb5ca990ffbdf2f762b48c217
BUG=12282
TEST=make H2C firmware and verify using crossystem utility
(set fwb_tries, reboot, verify that mainfw_act is B)
Review URL: http://codereview.chromium.org/6597018
Diffstat (limited to 'firmware/stub')
-rw-r--r-- | firmware/stub/load_firmware_stub.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/firmware/stub/load_firmware_stub.c b/firmware/stub/load_firmware_stub.c index 99ed657f..94d0bfa8 100644 --- a/firmware/stub/load_firmware_stub.c +++ b/firmware/stub/load_firmware_stub.c @@ -73,6 +73,11 @@ int VerifyFirmwareDriver_stub(uint8_t* root_key_blob, CallerInternal ci; LoadFirmwareParams p; + VbNvContext vnc; + + /* TODO: YOU SHOULD CALL LoadFirmwareSetup() AS SOON AS THE TPM + * INTERFACE IS AVAILABLE */ + LoadFirmwareSetup(); /* Copy the firmware volume pointers to our global variables. */ ci.firmwareA = firmwareA; @@ -82,11 +87,14 @@ int VerifyFirmwareDriver_stub(uint8_t* root_key_blob, ci.firmwareA_size = 0; ci.firmwareB_size = 0; + /* TODO: YOU NEED TO LOAD vnc.raw[] FROM NON-VOLATILE STORAGE */ + /* Set up the params for LoadFirmware() */ p.caller_internal = &ci; p.firmware_root_key_blob = root_key_blob; p.verification_block_0 = verification_headerA; p.verification_block_1 = verification_headerB; + p.nv_context = &vnc; /* Allocate a key blob buffer */ p.kernel_sign_key_blob = Malloc(LOAD_FIRMWARE_KEY_BLOB_REC_SIZE); @@ -97,6 +105,11 @@ int VerifyFirmwareDriver_stub(uint8_t* root_key_blob, /* Call LoadFirmware() */ rv = LoadFirmware(&p); + + if (vnc.raw_changed) { + /* TODO: YOU NEED TO SAVE vnc.raw TO NON-VOLATILE STORAGE */ + } + if (LOAD_FIRMWARE_SUCCESS == rv) { /* TODO: YOU NEED TO KEEP TRACK OF p.kernel_sign_key_blob AND * p.kernel_sign_key_size SO YOU CAN PASS THEM TO LoadKernel(). */ |