summaryrefslogtreecommitdiff
path: root/tests/test_common.c
Commit message (Collapse)AuthorAgeFilesLines
* Enable (and test) custom dev-mode soundsBill Richardson2011-10-051-0/+22
| | | | | | | | | | | | | | BUG=none TEST=manual cd src/platform/vboot_reference make && make runtests Change-Id: I7f7d50d7c9c5541e0b99031245f882996a6b88ec Reviewed-on: http://gerrit.chromium.org/gerrit/8731 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add tests for vboot_firmware.cRandall Spangler2011-09-011-5/+5
| | | | | | | | | | | | | | | Yaay, LoadFirmware() finally has unit tests! Fix minor memory leak in LoadFirmware(). BUG=chromium-os:17564 TEST=make && make runtests Change-Id: I7eabc14484271f488b77f286e846781ccc22b8f2 (cherry picked from commit 2b7c5635d7069c55a1d96d11b99d02291b7e308b) Reviewed-on: http://gerrit.chromium.org/gerrit/7052 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
* Add tests for rsa_utility.cRandall Spangler2011-09-011-0/+14
| | | | | | | | | | BUG=chromium-os:17564 TEST=make && make runtests Change-Id: Ia86241f5407ba53d93d3862b29c61b510e560e92 Reviewed-on: http://gerrit.chromium.org/gerrit/6959 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
* Partial unit tests for rollback_indexRandall Spangler2011-08-261-6/+25
| | | | | | | | | | | BUG=chromium-os:17564 TEST=make && make runtests Change-Id: I8ea6bcc15f277e10c5b8539f2ea19ad90be34889 Reviewed-on: http://gerrit.chromium.org/gerrit/6770 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
* Add tests for vboot_reference stateful_util.cRandall Spangler2011-08-241-1/+18
| | | | | | | | | | BUG=chromium-os:17564 TEST=make && make runtests Change-Id: I5d55be2dfead0c5d7af72841cbd6c65485685cd6 Reviewed-on: http://gerrit.chromium.org/gerrit/6596 Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
* Make vboot_reference build in MSVC command line environment.vbendeb2010-06-241-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a mostly NOOP change which modifies the source code to compile cleanly in the MSVC command line build environment. A new makefile is introduced (msc/nmakefile) along with a README.txt in the same directory explaining how to build the code in the DOS window. As of this submission the build is running in a 32 bit environment, the intention is to use the same makefile for 64 bit builds in the future. Enabling high compilation warnings level allowed to identify a couple of bugs in the code which are being fixed. Not all sources are being compiled in the MSVC environment, only those in firmware/ and most of those in test/ subdirectories. The benchmark calculations require porting of the timer facilities and are being postponed. TEST Built in DOS and linux environments. Ran unit tests in linux environment. Review URL: http://codereview.chromium.org/2809037
* Remove unused files, and tidy the directory structure of the remaining ones.Randall Spangler2010-06-171-111/+0
| | | | Review URL: http://codereview.chromium.org/2815011
* Remove old firmware verification code, now that firmware build has switched ↵Randall Spangler2010-06-161-104/+0
| | | | | | to the new algorithms. Review URL: http://codereview.chromium.org/2835006
* Add a kernel subkey signing algorithm key and algorithm fields to firmware ↵Gaurav Shah2010-06-031-0/+6
| | | | | | preamble. Review URL: http://codereview.chromium.org/2589001
* Make kernel signature a part of the kernel preamble.Gaurav Shah2010-05-261-0/+12
| | | | | | | | | With this change, the kernel signature is a part of the preamble block (and therefore, used during preamble signature verification). BUG=670 TEST=image verification tests still pass. corrected splicing test expectations (and it passes). Review URL: http://codereview.chromium.org/2292001
* Change kernel vboot header layout and add support for separate header ↵Gaurav Shah2010-05-261-1/+3
| | | | | | | | | | | verification. This CL adds 2 things: - Instead of having a kernel config, now we have a kernel preamble which contains some important parameters needed by the bootloader in the firmware to kernel hand-off. These parameters are verified using a separate preamble signature in addition to the kernel signature on actual kernel image data. - Adds a new VerifyKernelHeader() API function which verifies the kernel verified boot header excluding the kernel data and also extracts parameters out of this header needed to verify the actual kernel image data (if deemed necessary). This allows for vboot header verification and data verification to be performed separately. Review URL: http://codereview.chromium.org/2234003
* VBoot Reference: Make kernel_config a 4K byte block, and move it after the ↵Gaurav Shah2010-04-291-7/+3
| | | | | | | | | | | | verified boot block. The kernel_config is now stored as a 4K binary block instead of the kconfig_options structure that was being used before. Since the verified boot code doesn't care what kernel config options are (other than the length of the kernel image and for verifying them before the rest of kernel), it is ok to keep them as a blackbox. This CL also changes the verified boot kernel layout - VBlock Data followed by Kernel Config followed by the Kernel Image. This will allow them to be stored separately, or as a concatenated block (for easy memory mapping during kernel load). This should ease the process of generating a layout for verified boot kernel images which is also compatible with legacy BIOSes that don't support this mechanism. Finally, there is also a new firmware API function to determine the size of a kernel verified boot block, given a pointer to its beginning (for determining the offset to the kernel config and data). Review URL: http://codereview.chromium.org/1732022
* Change VerifyFirmware() to take separate pointers to firmware verification ↵Gaurav Shah2010-04-181-18/+12
| | | | | | | | | | | header and firmware data. The firmware verification code no longer assumes that verification data and firmware data are contiguous and follow each other. Needed for EFI where the actual firmware must be stored in its own firmware volume. BUG=1704 TEST=modified existing tests for the new API, and they still pass Review URL: http://codereview.chromium.org/1578035
* VBoot Reference: Output debug information using debug() instead of fprintf().Gaurav Shah2010-04-051-4/+4
| | | | | | | | This should make it easier to switch off debug messages if needed. TESTS=builds fine, autotest builds fine (using both arm/x86-generic) Review URL: http://codereview.chromium.org/1607006
* combined patch for:Gaurav Shah2010-03-311-1/+1
| | | | | | | http://codereview.chromium.org/1574005 http://codereview.chromium.org/1604001 Review URL: http://codereview.chromium.org/1585007
* Revert "VBoot Reference: Refactor Part 2 - Crypto Libraries"David Garcia2010-03-311-1/+1
| | | | | | This reverts commit e018a80a37aaa45681f45f5852f04d20aedd8b2d. Review URL: http://codereview.chromium.org/1593002
* VBoot Reference: Refactor Part 2 - Crypto LibrariesGaurav Shah2010-03-301-1/+1
| | | | | | | | Removing multiple top level includes - now padding.h, rsa.h and sha.h are used internally and cryptolib.h must be used instead for all modules that wish to use crypto functions. I am trying to separate refactors involving code movement from one file to another, and the movement of files themselves into separate CLs so that it's clear what changed. Review URL: http://codereview.chromium.org/1574005
* Propagate use of uint64_t to more functions that may need to deal with ↵Gaurav Shah2010-03-291-4/+4
| | | | | | | | | | | | | arbitrary length data. This CL fixes some functions to use uint64_t that I missed the first time around. It ended up requiring some minor changes to how some of the helper functions work (StatefulMemcpy*()). Also adds new tests to make sure that reference code can verify/process big firmware and kernel images. BUG=670 TEST=Adds some new, old ones still pass. Review URL: http://codereview.chromium.org/1519008
* VBoot Reference: Fix splicing bugs in Firmware and Kernel verification.Gaurav Shah2010-03-291-8/+14
| | | | | | | | | | | | | | | BUG=670 TESTS=Adds new tests which verify this doesn't occur anymore. Existing tests still pass. The existing code computes and verifies signatures on firmware/kernel data and firmware/kernel versions separately. This causes a image splicing bug where it is possible to combine together a version signature from a valid new firmware with firmware data and signature from an older version. The same problem exists with kernel verification. This CL fixes this by changing the firmware/kernel signatures to also include the version information. For the Firmware, there's a separate signature on the preamble (which contains the version) but the firmware signature now also includes this preamble in addition to the firmware data. For the Kernel, there's a separate signature on the kernel config/options (wich also contains the version), but the kernel signature now also includes these config/options in addition to the kernel data. Review URL: http://codereview.chromium.org/1430001
* VBoot Reference: Add kernel rollback prevention and choosing logic.Gaurav Shah2010-03-261-5/+35
| | | | | | Also adds tests for kernel rollback prevention. Review URL: http://codereview.chromium.org/1320010
* Move test utility functions to a common place.Gaurav Shah2010-03-251-1/+186
| | | | | | | | | | | | | Also removes the dev_mode flag from Firmware Image verification as key signature for the firmware should be checked whether or not dev mode is enabled. BUG=670 TEST=All tests still pass. Merge remote branch 'refs/remotes/origin/master' into fixtests Fix tests, remove dev mode. Move common code. Review URL: http://codereview.chromium.org/1280002
* VBoot Reference: Add version checking to for preventing rollbacks.Gaurav Shah2010-03-241-0/+30
This CL adds a new function VerifyFirmwareDriver_f() means to be a part of the RO firmware which determine which copy of the firmware to boot from. It is meant to ensure that a particular firmware is only booted if 1) it verifies successfully, 2) its version is newer or equal to current stored version. In addition, the driver function also updates the stored version if needed. Currently I am using the TLCL API with stub calls, (in fact, most of the TPM interaction is done in rollback_index.c which implements the actual version query/update API) used by the firmware. Review URL: http://codereview.chromium.org/1241002