| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
No longer relevant with GBB refactor.
BUG=b:124141368, chromium:954774
TEST=make clean && make runtests
BRANCH=none
Change-Id: I84479ae3bd8a936728d83d7937f4981ef6a37247
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1763972
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In case we want to keep it around. See b:139839429.
BUG=b:124141368, b:139839429
TEST=None
BRANCH=none
Change-Id: Ib49a8c7a1acf2e643fcda0a68bf39d756506e3a2
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1763971
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need to disable some warnings that only exist for clang, but we don't
want GCC to choke on them with "unrecognized command line option"
either. We still want external users to be able to build vboot (even
host utilities) with GCC if they prefer. Therefore, add
-Wno-unknown-warning to prevent GCC from choking.
BRANCH=None
BUG=chromium:991812
TEST=make runtests
Change-Id: I753bd4c1240d5064a815e3f1d019ad3b67d686a2
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1772177
Reviewed-by: Mike Frysinger <vapier@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We deleted the script the oci-container target needs,
so remove some remaining dead references.
BUG=chromium:976916
TEST=signing image w/key deletes it, and signing image w/out key passes
BRANCH=None
Change-Id: I54624a1241a7b7326a746514aa32644fd94ec525
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1762462
Reviewed-by: LaMont Jones <lamontjones@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The way the sed logic was written we allowed invalid sed expressions
to count as "pass". This is because we use "no output" as the signal
that the command line option is OK (since the sed script deleted it),
but it meant that invalid sed scripts produced no output too. Add an
explicit exit status check to make sure invalid scripts fail.
BUG=chromium:991590
TEST=`./image_signing/ensure_secure_kernelparams.sh ./coral-12439.0.0-recovery.bin .../cros-signing/security_test_baselines/ensure_secure_kernelparams.config` produces no errors
BRANCH=None
Change-Id: I1de3ada7e44c49f97ecc40824d98cca9291ab7e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1762459
Reviewed-by: LaMont Jones <lamontjones@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vboot_reference fails to compile with MOCK_TPM=1 due to a lack of
TlclUndefineSpace function in mocked_tlcl.c.
Add the function to fix this issue.
BUG=b:124141368, chromium:997132
TEST=make clean && make runtests
BRANCH=none
Change-Id: If290767a25f1ac6f02e3d8f78373a77da8567c87
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1768378
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implicit fallthroughs are always a source of trouble, so let's get the
compiler to catch them for us. Intentional fallthroughs can be marked
using the /* fall through */ comment to silence this warning.
BUG=none
TEST=make clean && make runtests
BRANCH=none
Change-Id: I66a9edc810674a732c0530cd78b5aa8a2c37f562
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1742640
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The 'incompatible key' error message added the new line in wrong
location, causing the message to be truncated unexpectedly.
We should put the line break after whole message (including URL) is
printed.
BUG=None
TEST=make runfutiltests
BRANCH=None
Change-Id: Ic74da1c2657b9517dce786a72435275e7141348c
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1763968
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sysincludes.h and 2sysincludes.h are almost identical except for
one extra header (ctype.h) in the vboot1 variant. Add this to
2sysincludes.h, and nuke sysincludes.h.
Depends on: https://review.coreboot.org/c/coreboot/+/33525
BUG=b:124141368
TEST=make clean && make runtests
BRANCH=none
Change-Id: Iaba21a9b8bb2ae0c081184019576663898317bd1
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1680325
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1659990
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Auto-Submit: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Relocate permissions and uid check from RollbackKernelRead
to ReadSpaceKernel.
Restructure test code to set default values in ResetMocks.
BUG=b:124141368, chromium:972956
TEST=make clean && make runtests
BRANCH=none
Change-Id: I72c536042b89684c6db5099412344678e3d9d920
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1758146
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes it clear exactly when reads/writes are occurring,
with what values.
BUG=b:124141368, chromium:972956
TEST=make clean && make runtests
BRANCH=none
Change-Id: I614204cc19d2c90d2ac5799f136daf251a45e251
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728299
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Every failure case should output some debug information.
BUG=b:124141368, chromium:972956
TEST=make clean && make runtests
BRANCH=none
Change-Id: I0f178fa72f7e227b3abc22ac1b0d2df5ed4a6dc8
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1738348
Reviewed-by: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code to deal with version < 2 rollback spaces has been around
since 2013. Legacy devices will not be updating to this code,
thus we can remove the legacy silent upgrade.
BUG=b:124141368, chromium:972956
TEST=make clean && make runtests
BRANCH=none
Change-Id: I8ce22c37418ddc56cb74cc792540b54b3ee7bbd7
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1727949
Reviewed-by: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vboot_reference builds most tools as static but
address sanitizer does not support static linking.
Put more tools under NO_BUILD_TOOLS condition (set
only in fuzzer builders) to make fuzzer builders happy.
BUG=chromium:995340
TEST=USE="asan fuzzer" emerge-amd64-generic vboot_reference works.
Change-Id: I76beffb10744c8d9c5b6b4a50e971f1332113491
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1761012
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Commit-Queue: Dhanya Ganesh <dhanyaganesh@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ensure that mock_keypresses_count is in bounds before accessing the
mock_keyflags array.
BUG=none
TEST=make clean && make runtests
BRANCH=none
Change-Id: Ifa8fce5438f2e2547c9e316038466244eee7bfa9
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Found-by: Coverity CID 198899
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1752048
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch enables -ffunction-sections, -fdata-sections and
-Wl,--gc-sections for host builds. These flags already get passed by
firmware builds anyway, so having host builds match that behavior should
be a good idea in general. They may also occasionally help save a bit of
code size (though not much since vboot is a library, but I still get
about half a KB out of futility), and they will prevent clang from
omitting relocations for function calls inside the same file, which
means we don't have to splatter test_mockable all over our codebase
anymore. (We still need it for vb2_get_gbb() since that is so small that
both GCC and clang want to inline it, even if they are outputting a
discrete copy anyway.)
(Also add a comment about why GenerateGuid() has nothing do to with this
even though it is also a weak function, and why it is like that.)
BRANCH=None
BUG=chromium:991812
TEST=make runtests with both GCC and clang
Change-Id: Iede9d29e20b99b75a0c86bc7ecb907d2a0e5e3a1
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1754969
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vb2_shared_data struct has many offsets to other objects in the
workbuf. They are all prefixed with `workbuf_`, e.g.:
uint32_t workbuf_data_key_offset;
uint32_t workbuf_data_key_size;
In order to adhere to a hierarchical structure on the workbuf,
remove the workbuf_ prefix from these symbols to reflect the
relationship between vb2_shared_data and its children more
accurately.
Create a helper function vb2_member_of to safely look up a child
of a particular object in the workbuf by offset. Pointer
arithmetic to find vb2_shared_data children is replaced with
calls to this function.
BUG=b:124141368, chromium:994060
TEST=make clean && make runtests
BRANCH=none
Change-Id: Ia82417a35d2067ee5e4f42fea0396e6325127223
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1753400
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1718264
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
rptr points to an object with rsize number of bytes. If offset + size ==
rsize, then rptr + offset + size will point to one byte past the end of
the object during the memcpy(). Exclude this case by adding it to the
bounds check. We can also remove the offset > rsize check since it is
subsumed in the other one.
BUG=none
TEST=make clean && make runtests
BRANCH=none
Change-Id: Iceda658f420babe61bd1d9807efc8333d2044ccc
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Found-by: Coverity CID 198905
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1752766
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is possible for load_firmware_image() to fail, in which case there
will be a null pointer dereference of image.data in find_gbb(). Prevent
this by returning early if load_firmware_image() fails.
BUG=none
TEST=make clean && make runtests
BRANCH=none
Change-Id: If60fdff2f3a39f07ef0b1e87f0800ac4fb8d5895
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Found-by: Coverity CID 198902
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1752522
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A union is used with a buffer and a pointer to the
RollbackSpaceFwmp object in question. Rename `bf`
to `fwmp` to reduce confusion between the two identifiers
which are presumably both abbreviations for "buffer".
BUG=b:124141368, chromium:972956
TEST=make clean && make runtests
BRANCH=none
Change-Id: I0cdd8fed77087ff36cc4ca74ec847e65398f8a6b
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1751062
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:124141368, chromium:988410
TEST=make clean && make runtests
BRANCH=none
Change-Id: I59b5646a79769cb9fafdecd904021a5df85906b6
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728295
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Check the return value and result of calling
VbExGetLocalizationCount. If something is awry,
fall back to using one language entry.
BUG=b:124141368
TEST=make clean && make runtests
BRANCH=none
Change-Id: Ieeea54bfed303a98d16f15aceab47f1ffdd10d6d
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1729773
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Assume that transport-layer communication to Cr50 is reliable.
No need for retries on reads/writes, or verification after write.
BUG=b:124141368, chromium:972956
TEST=make clean && make runtests
BRANCH=none
Change-Id: Ie57d1eeaa44c338bca289e371c516540aacf9437
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1729713
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace vboot1-style VBERROR_INVALID_PARAMETER with vboot2 equivalent
VB2_ERROR_INVALID_PARAMETER.
BUG=b:124141368, chromium:988410
TEST=make clean && make runtests
BRANCH=none
Change-Id: I46227cd3a7d7ce84654a0093f9d64883c9563381
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1728116
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728294
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace vboot1-style VBERROR_SIMULATED with VB2_ERROR_MOCK.
BUG=b:124141368, chromium:988410
TEST=make clean && make runtests
BRANCH=none
Change-Id: I9f7a21b957097672883a428a5210c14a27852085
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722917
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace vboot1-style VBERROR_UNKNOWN with VB2_ERROR_UNKNOWN.
BUG=b:124141368, chromium:988410
TEST=make clean && make runtests
BRANCH=none
Change-Id: Icd2158e328142cff69ce94b5396ab021a1f7839c
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1728115
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722916
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace vboot1-style VBERROR_SUCCESS with VB2_SUCCESS
(trivial change since both are equal values).
BUG=b:124141368, chromium:988410
TEST=make clean && make runtests
BRANCH=none
Change-Id: I46e02471a031e9f36ec869d11d0b957d1c1b5769
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1728114
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722915
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SetVirtualDevMode returns vboot error codes, and not
TPM error codes. Existing code just so happens to work,
since TPM_SUCCESS == VBERROR_SUCCESS.
BUG=b:124141368, chromium:988410
TEST=Build locally
BRANCH=none
Change-Id: Ifc819fdea4e23824d8e6fcf211d7bf66f33cd069
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728293
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To make explicit when vboot2 error codes should be returned,
use the new vb2_error_t type on all functions which return
VB2_ERROR_* constants.
BUG=b:124141368, chromium:988410
TEST=make clean && make runtests
BRANCH=none
Change-Id: Idd3ee8afe8c78347783ce5fa829cb78f1e5719e2
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1728113, chromium:1728499
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728292
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want to switch over from GCC to clang for userspace utilities. It
comes with a new default warning that we happen to trigger, so silence
that. It also comes with a dumb reachability checker that can't tell
when the use of one variable is guarded by another, so need to
unnecessarily initialize a variable in load_kernel_test.
BRANCH=none
BUG=chromium:991812
TEST=Built for Kevin with clang.
Change-Id: If9fc391ade0243aea1cae8d682e31390dc082f77
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1744667
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We never released this feature and we've dropped the logic from newer
releases. Purge the signing logic of references to the key. We still
need to delete the key in case we're signing an older release branch.
BUG=chromium:976916
TEST=signing image w/key deletes it, and signing image w/out key passes
BRANCH=None
Change-Id: I82b8a4dab5f68e01c54281afd4817eea3dd359ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1742692
Reviewed-by: LaMont Jones <lamontjones@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implicit fall throughs are a source of Coverity Scan issues, so add
comments to mark these instances as intentional.
BUG=none
TEST=make clean && make runtests
BRANCH=none
Change-Id: Ic302dcf8998fb1081e5b8258ba703a7527911eee
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Found-by: Coverity CID 198900
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1740446
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These variables are all uint64_t, and so we need to use PRIu64 to
ensure they are printed with the correct format specifier.
BUG=none
TEST=make clean && make runtests
BRANCH=none
Change-Id: Idb8fee0ef525d224670a9d2b3a7915be1b19fd21
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Found-by: Coverity CID 199873, 199878, 199889
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1737200
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use %zu, which is the format specifier for size_t.
BUG=none
TEST=make clean && make runtests
BRANCH=none
Change-Id: I3317c2f6a7b9d95c22a43ae3d786c7d7380342ad
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Found-by: Coverity CID 199882
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1737706
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As part of the conversion of error codes from vboot1 to vboot2,
replace all instances of VbError_t with vb2_error_t.
vboot2 currently uses the int type for return values, but we
would like to implement the use of vb2_error_t instead, which is
potentially clearer than simply using an int. Existing functions
will be converted to use vb2_error_t in a subsequent CL.
BUG=b:124141368, chromium:988410
TEST=make clean && make runtests
BRANCH=none
Change-Id: Iee90d9a1f46bcf5f088e981ba6ddbcf886ff0f18
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1728112
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722914
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TPM errors and vboot errors were getting mixed up.
Note that this patch changes a function signature in the
vboot1 API. Any callers of the function should be updated
accordingly.
BUG=b:124141368, chromium:988410
TEST=make clean && make runtests
BRANCH=none
Change-Id: Idf332ca9ac61b5771fccf9e2ce75e8689c0aace9
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1730374
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1729712
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's extremely hard to accomplish anything with two different
sets of error codes. Since the two error code sets don't
overlap, merge them into the same enum (vb2_return_code). The
next step is to get rid of VbError_t and have all functions
consistently return vboot2-style int.
BUG=b:124141368, chromium:988410
TEST=make clean && make runtests
BRANCH=none
Change-Id: Ie34ac2c30e5d73fe886628e3150cf63543d520af
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1728117, chromium:1735666
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722913
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We're updating the algorithm for this so the signing scripts have to
support it as well. Since we're running ToT signing scripts on older
images as well, determine the hash algorithm used in the image by
checking its length (40 hex digits for SHA1, 64 for SHA256).
BRANCH=None
BUG=b:137576540
TEST=$(sign_official_build.sh recovery recovery_image.bin
/tmp/scratch/mykeys/ resigned_image.bin) -- used futility to confirm
that new image kern_b_hash matches new image KERN-B and uses the
expected algorithm (tried with both SHA1 and SHA256)
Cq-Depend: chromium:1706624
Change-Id: Ie1a62ad1fd4fbf141cc1c32d592b863f2d43a24e
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1707529
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Convert uses of this function to call VB2_DEBUG and manually
exit if necessary.
BUG=b:124141368
TEST=make clean && make runtests
BRANCH=none
Change-Id: I9006b1a9c66645757d33310d96207233b88eaed5
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1710340
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove unused BDB code, previously created for a cancelled SoC
project.
BUG=b:124141368, chromium:986177
TEST=make clean && make runtests
BRANCH=none
Change-Id: I91faf97d9850f8afb816fa324ad9a4d9f3842888
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1710336
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding --absolute-names to getfattr to let getfattr not to remove
the leading slash, and not to print the warning to stderr.
BUG=chromium:954670
TEST=set_lsb_release.sh xx.bin a b
TEST=`getfattr: Removing leading '/' from absolute path names` not printed
BRANCH=none
Change-Id: I6273151713612746443d5d68a8df530f1146a4a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1712890
Tested-by: Qijiang Fan <fqj@google.com>
Reviewed-by: LaMont Jones <lamontjones@chromium.org>
Commit-Queue: Qijiang Fan <fqj@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, a mix of:
- DIE
- Fatal (customly defined in cmd_vbutil_kernel.c)
- VbExError
... were all used to print an error message and exit.
In the case of futility, standardize on using the FATAL macro
defined in futility.h.
BUG=b:124141368
TEST=Check that FATAL works correctly:
$ build/futility/futility vbutil_key --in a --out a --algorithm 18
FATAL: do_vbutil_key: Unknown option
TEST=make clean && make runtests
BRANCH=none
Change-Id: I97ca1153dc36e7208c69185883518c52d5d75293
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1679799
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Preference for vboot2 data structures when available:
sd->recovery_reason
sd->fw_version_secdata
sd->kernel_version_secdatak
BUG=b:124141368, b:124192753
TEST=make clean && make runtests
BRANCH=none
Change-Id: Ifdd77947cabb75e8ac5a838b75cbcd643c6e481e
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1680190
Reviewed-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=chromium:985940
TEST=None
BRANCH=none
Change-Id: I844074e28a9cf2384bb7dc1593de7d7e01622457
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1710989
Tested-by: LaMont Jones <lamontjones@chromium.org>
Auto-Submit: LaMont Jones <lamontjones@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:124141368
TEST=make clean && make runtests
BRANCH=none
Change-Id: Iff20dcc3aa47bfa29776609e5b352ea464c18241
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1680189
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We migrated away from this in 2012, so drop the alias. Any devices
made around that time won't need new factory images either.
BUG=None
TEST=None
BRANCH=None
Change-Id: I72a155d6c4c241781ec07b2ebb9a2393f8470a08
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1679436
Reviewed-by: LaMont Jones <lamontjones@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update all references to vboot2-style struct vb2_packed_key.
BUG=b:124141368
TEST=make clean && make runtests
BRANCH=none
Change-Id: I55a5f6bf315bdb4b83a998759d3732077283998e
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1675871
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace old vboot1-style Min macro with VB2_MIN,
and relocate tests accordingly.
BUG=b:124141368
TEST=make clean && make runtests
BRANCH=none
Change-Id: I73d630147eaf23f97dd750769fb1e911dae01848
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1675866
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When testing updater behavior with emulation (--emulate), there was no
way to know if EC and PD images were correctly found from archive and
expected to be flashed (for example if we want to test the difference
between modes).
Since we do flash EC/PD in recovery and factory modes, it is better
to still allow loading EC/PD images, and simply not writing them
(and print some messages as indication) in emulation.
BUG=chromium:965092
TEST=make runfutiltests
BRANCH=None
Change-Id: I3bbbd75cb8adf2e238a593d3dee0b2491abe7719
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1626190
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Dana Goyette <dgoyette@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I was following the advice given in these examples and saw:
# flashrom -p bios -w /mnt/stateful_partition/backups/bios_SAMUS_TEST_8028_20190628_100324.fd
flashrom v0.9.9 : cc7cca2 : Jun 15 2019 04:36:54 UTC on Linux 4.14.129 (x86_64)
Error: Unknown programmer bios.
Please run "flashrom --help" for usage info.
As you can see in flashrom_bios() in that same file, the "programmer"
argument in flashrom that you need to flash the BIOS is "host" not
"bios":
# flashrom -p host -w /tmp/bios_SAMUS_TEST_8028_20190628_100324.fd
flashrom v0.9.9 : 2d00129 : Jun 27 2019 15:16:55 UTC on Linux 4.14.129 (x86_64)
flashrom v0.9.9 : 2d00129 : Jun 27 2019 15:16:55 UTC on Linux 4.14.129 (x86_64)
Calibrating delay loop... OK.
coreboot table found at 0x7ce3a000.
...
Erasing and writing flash chip... SUCCESS
BUG=none
TEST=successfully flashed a backup BIOS image using flashrom
BRANCH=none
Change-Id: Ib1e10c1e06ad84714853953702328c4f4dadebe7
Signed-off-by: Ross Zwisler <zwisler@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1685859
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
|