summaryrefslogtreecommitdiff
path: root/tests/vb2_misc_tests.c
Commit message (Collapse)AuthorAgeFilesLines
* vboot2: fix alignment issues on 32-bit architecturesBill Richardson2015-01-281-1/+1
| | | | | | | | | | | | | | | | | | We were assuming 8-byte alignment for buffers. That's not true on 32-bit architectures. We should make the alignment requirements explicit (and correct) for all architectures. BUG=chromium:452179 BRANCH=ToT CQ-DEPEND=CL:243380 TEST=manual USE=vboot2 FEATURES=test emerge-x86-alex vboot_reference Change-Id: I120f23e9c5312d7c21ff9ebb6eea2bac1e430e37 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/243362 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot2: new data structuresRandall Spangler2014-10-241-1/+1
| | | | | | | | | | | | | | | | | These structures allow for simplication and feature expansion in vboot. They are NOT backwards-compatible with old vboot1 structs. This CL simply adds the new structs and unit tests for struct packing; future CLs will add support for them in the firmware library and futility. BUG=chromium:423882 BRANCH=none TEST=VBOOT2=1 make runtests Change-Id: I22532acf985dd74316bd30f17e750f993b6c53d7 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/224820 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* vboot2: Fix broken compatiblity check for gbb header 1.1Randall Spangler2014-10-231-6/+9
| | | | | | | | | | | | | | | | vboot2 supports only GBB header versions 1.1+. When the GBB header was rev'd to 1.2, this broke the compatibility check for 1.1. However, the test was written in such a way that wasn't detected. Fix the check and the test. BUG=chromium:415227 BRANCH=none TEST=VBOOT2=1 make runtests Change-Id: Ifeb1f21bf5cf3cc05d31ac7912693e090eb8fd5e Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/225110 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Add hwid digest field to GBB headerBill Richardson2014-10-211-0/+4
| | | | | | | | | | | | | | | | | | | This adds a field in the GBB header to store the sha256 digest of the HWID string, and updates gbb_utility so that it stores the digest when it modifies the HWID. Because this is a new field, the GBB_MINOR_VER is incremented. BUG=chromium:415227 BRANCH=ToT TEST=make runtests, VBOOT2=1 make runtests Since the GBB is in the RO firmware, there should be no side effects for existing devices (but even without that, they should handle a minor version change without complaint). Change-Id: Icdb2a0b564677b0b65e58df897d2ec5af3964998 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/221360
* vboot2: Add previously tried slot and result to NV storageRandall Spangler2014-10-041-0/+17
| | | | | | | | | | | | | | | | | | | | This gives recovery mode information on two boots back instead of one, which may be handy for debugging. It also allows determining whether a failure of the current boot should try the other slot or go to recovery, using only information stored in NV storage. Added crossystem support for printing the fields, and unit tests. BUG=chrome-os-partner:32585 BRANCH=none TEST=make runtests; VBOOT2=1 make runtests Change-Id: Ia9f4186210d30217b902db7c513ae4ab8851f8f4 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/221230 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* vboot2: Fix saving the slot we tried back to nv storageRandall Spangler2014-10-041-0/+4
| | | | | | | | | | | | | | | | | Previously, we only kept that slot info in RAM. We read it from NV storage, but never wrote it back. Added a test to confirm proper behavior (and made sure it failed before patching 2misc.c with the fix). BUG=chrome-os-partner:32583 BRANCH=none TEST=VBOOT2=1 make runtests Change-Id: Ie12124d9cbe417914fbde14ea5086380d637240f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/221214 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* vboot2: misc higher-level routinesRandall Spangler2014-06-191-11/+418
| | | | | | | | | | | | | | | I'm breaking the last chunk of vboot2 into smaller pieces as I add tests. This has a bunch of misc routines like the dev switch logic and GBB header parsing. BUG=chromium:370082 BRANCH=none TEST=make clean && VBOOT2=1 COV=1 make Change-Id: I0f67400d9b59ec21ed5cc155a9b774fd37eb559b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/203374 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* vboot2: Use more specific error codes, part 3Randall Spangler2014-06-111-4/+6
| | | | | | | | | | | | | | Error codes reported by 2common.c are now very specific, and tests verify the proper errors are reported. BUG=chromium:370082 BRANCH=none TEST=make clean && VBOOT2=1 COV=1 make Change-Id: I9480bd22b60ae339196c92918a8a984a9f05ac1a Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/202938 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* vboot2: Add nvstorage and secdata functionsRandall Spangler2014-06-051-0/+54
This is the second of several CLs adding a more memory- and code-efficient firmware verification library. BUG=chromium:370082 BRANCH=none TEST=make clean && COV=1 make Change-Id: I1dd571e7511bff18469707d5a2e90068e68e0d6f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/199841 Reviewed-by: Bill Richardson <wfrichar@chromium.org>