summaryrefslogtreecommitdiff
path: root/firmware/2lib/2secdata_firmware.c
Commit message (Collapse)AuthorAgeFilesLines
* treewide: Fix license headers to conform with linterJakub Czapiga2022-10-041-1/+1
| | | | | | | | | | | | | BRANCH=none BUG=none TEST=cros lint Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Change-Id: I7710c43c8c70cf257a898f22c42ecbf350e125a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3925702 Commit-Queue: Jakub Czapiga <czapiga@google.com> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Tested-by: Jakub Czapiga <czapiga@google.com>
* firmware: Add VB2_TRY() helper macroYu-Ping Wu2020-03-311-4/+1
| | | | | | | | | | | | | | | | | | | | | | | Add variadic macro VB2_TRY() to vboot2 APIs, which supports the following usage: - VB2_TRY(func_call()) - VB2_TRY(func_call(), ctx, recovery_reason) and will return the error code if func_call() failed. Also utilize the macro whenever possible throughout vboot. BRANCH=none BUG=chromium:1049032 TEST=make runtests TEST=emerge-nami coreboot coreboot-utils depthcharge -j Cq-Depend: chromium:2115423, chromium:2125616, chrome-internal:2817320 Change-Id: Ie5532a8beaa9372fa6fde0a68bda5ecb640087c4 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2084062 Reviewed-by: Julius Werner <jwerner@chromium.org>
* firmware: Add VB2_REC_OR_DIE() helper macroJulius Werner2020-02-111-6/+2
| | | | | | | | | | | | | | | | | After introducing VB2_DIE() recently, practical use has shown that we pretty much always want to check for recovery mode first, and avoid a hard abort in that case. This patch introduces a very similar macro that includes that extra check so we don't have to open-code it all over the place. BRANCH=None BUG=None TEST=make runtests Change-Id: I16e744859ba7a5c68269e06c7e7d071f3bfae67e Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2038244 Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot: format hex numbers with %#x instead of 0x%xJoel Kitching2019-10-231-2/+2
| | | | | | | | | | | | | | | | Also standardize on using hex for printing ASCII key values across vboot_ui.c and vboot_ui_menu.c. BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: Ib10288d95e29c248ebe807d99108aea75775b155 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1840191 Reviewed-by: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot: update secdata accessors to match those of FWMPJoel Kitching2019-10-211-28/+42
| | | | | | | | | | | | | | | Instead of returning vb2_error_t, use VB2_DIE to exit on error. BUG=b:124141368, chromium:972956, chromium:1006689, TEST=make clean && make runtests BRANCH=none Change-Id: I9497eebb0b8815734fdf875ba4f9ef5eda5e82fd Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1833365 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: fix up some more includesJoel Kitching2019-09-231-1/+1
| | | | | | | | | | | | | | | | Should have no extra line breaks in between local includes, and should be sorted alphabetically. BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: I83c25d30d7376712857314965a7d93f57190aa3f Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1776281 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot/secdata: move struct definitions into 2secdata_struct.hJoel Kitching2019-09-231-0/+1
| | | | | | | | | | | | | | | | Makes it easier to prevent different parts of vboot from reading secdata structs without using accessor functions. BUG=b:124141368, chromium:972956 TEST=make clean && make runtests BRANCH=none Change-Id: I407e1409409c6aab0c1f311f7715ce159497961b Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1776280 Reviewed-by: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot/secdata: implement vboot2 FWMP supportJoel Kitching2019-09-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | Implement FWMP support in vboot2. Currently, the data structure is just accessed directly, checking to see whether its `flags` member contains particular flags. We'd like to change this to follow the same scheme as secdata_firmware and secdata_kernel. This CL also updates some functions, comments, and tests related to secdata_firmware and secdata_kernel to ensure consistency between code for the secdata spaces. BUG=b:124141368, chromium:972956 TEST=make clean && make runtests BRANCH=none Change-Id: Ia0d67532cc6e077e170ffb25d0bc587b1d53edf3 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1773088 Reviewed-by: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot/secdata: rename secdata and secdatakJoel Kitching2019-08-311-0/+143
For clarity's sake, rename: secdata -> secdata_firmware secdatak -> secdata_kernel secdata is now the general term to refer to any secure data spaces: firmware, kernel, and FWMP. Once coreboot code has been updated, the sections in 2api.h and 2constants.h may be removed. BUG=b:124141368, chromium:972956 TEST=make clean && make runtests BRANCH=none Change-Id: I376acee552e8be37c75c340626a95462f81e198b Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1773079 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>