u-boot/test/py/tests
Tom Rini d5d9770f58 bootX measurements and measurement API moved to u-boot core
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEgWII69YpahbL5iK5gS8AYozs+qIFAmU7j50ACgkQgS8AYozs
 +qIh8w/+O4UjT0sG1NLwmyV7U1Ypk+EyYaE6wmSWzpsJLfH/YvtObBJOYRuXxRVh
 J9lkgCsw8Ct1ZNCrp8iVO+Dz1DtV8+QvTecrUHZqcOhTYDaqxXnlvEH2/EUhgo5T
 9a/ZaDtOP1mKz754C4G6G363+iRCvbcqDECeKg9VYxfWCo1cINOmqyQCqlGxFT+h
 PKiB5VzUpN/K/yiie+Hr42/+6XaykAUjUvEWeyKOsRmYY4lNiK22vG/puE42bFTh
 catXwTE2a7x+yzPKkdhR0UGvDUlIKET2kF6mi+pYN2h/cSUxWTzbP/OxcU9yJOnm
 qJiRZ+Woez1I7ul6ln4ci2kiWc3CTYFXfctwrBJPuJ/EO+2EEb3oHqG2S3Fc9VBZ
 N17flHW7XZHEQbNexlUhk9cRpCwRuSA5OJXwW+IZIuydgNeo3xF0iYvipbjkEGgW
 BBkt8PH+ivTLjEz6Gcmquvo1fHGJLHRIPg7DNb0phGHviuC0zlDJ7N5DZk0CpkiT
 36siV9xK4X6qvWkOTa6Ldw60e4tN9nv3VG30uXtPHi3XdOkKfNkyIuqO/5BkkQPt
 6yEc9IYXYoWNKDVUGme5+xszZp1sSvqltajG9VVNupt958dFyOSgS5aNa6B4UsWX
 3XfndP1/s2bezUHoQx5zjraapKVrqBFLkGeTlCDUD+mEgP440G8=
 =gvDs
 -----END PGP SIGNATURE-----

Merge tag 'tpm-next-27102023' of https://source.denx.de/u-boot/custodians/u-boot-tpm

bootX measurements and measurement API moved to u-boot core:

Up to now, U-Boot could perform measurements and EventLog creation as
described by the TCG spec when booting via EFI.

The EFI code was residing in lib/efi_loader/efi_tcg2.c and contained
both EFI specific code + the API needed to access the TPM, extend PCRs
and create an EventLog. The non-EFI part proved modular enough and
moving it around to the TPM subsystem was straightforward.

With that in place we can have a common API for measuring binaries
regardless of the boot command, EFI or boot(m|i|z), and contructing an
EventLog.

I've tested all of the EFI cases -- booting with an empty EventLog and
booting with a previous stage loader providing one and found no
regressions.  Eddie tested the bootX part.

Eddie also fixed the sandbox TPM which couldn't be used for the EFI code
and it now supports all the required capabilities. This had a slight
sideeffect in our testing since the EFI subsystem initializes the TPM
early and 'tpm2 init' failed during some python tests. That code only
opens the device though, so we can replace it with 'tpm2 autostart'
which doesn't error out and still allows you to perfom the rest of the
tests but doesn't report an error if the device is already opened.

There's a few minor issues with this PR as well but since testing and
verifying the changes takes a considerable amount of time, I prefer
merging it now.

Heinrich has already sent a PR for -master containing "efi_loader: fix
EFI_ENTRY point on get_active_pcr_banks" and I am not sure if that will
cause any conflicts, but in any case they should be trivial to resolve.

Both the EFI and non-EFI code have a Kconfig for measuring the loaded
Device Tree.  The reason this is optional is that we can't reason
when/if devices add random info like kaslr-seed, mac addresses etc in
the DT. In that case measurements are random, board specific and
eventually useless.  The reason it was difficult to fix it prior to this
patchset is because the EFI subsystem and thus measurements was brought
up late and DT fixups might have already been applied. With this
patchset we can measure the DT really early in the future.

Heinrich also pointed out that the two Kconfigs for the DTB measurements
can be squashed in a single one and that the documentation only explains
the non-EFI case.  I agree on both but as I said this is a sane working
version, so let's pull this first it's aleady big enough and painful to
test.
2023-10-27 19:27:29 -04:00
..
bootstd part: Add a function to find the first bootable partition 2023-01-23 18:11:40 -05:00
test_android global: Use proper project name U-Boot 2023-06-12 13:24:31 +02:00
test_cat tests: Fix exception when cleaning up skipped test 2023-07-17 15:39:55 -04:00
test_efi_bootmgr global: Use proper project name U-Boot 2023-06-12 13:24:31 +02:00
test_efi_capsule test: capsule: Remove logic to add public key ESL 2023-08-29 13:38:56 -04:00
test_efi_secboot global: Use proper project name U-Boot 2023-06-12 13:24:31 +02:00
test_eficonfig global: Use proper project name U-Boot 2023-06-12 13:24:31 +02:00
test_fs global: Use proper project name U-Boot 2023-06-12 13:24:31 +02:00
test_semihosting test: unit test for semihosting 2023-08-14 17:55:53 -04:00
test_xxd tests: Fix exception when cleaning up skipped test 2023-07-17 15:39:55 -04:00
vboot test: py: vboot: add test for global image signature 2022-03-31 14:12:23 -04:00
fit_util.py vbe: Add a test for VBE device tree fixups 2022-10-17 21:17:13 -06:00
fs_helper.py test: Move 1MB.fat32.img and 2MB.ext2.img 2023-08-25 17:55:19 -04:00
source.its test: Add test for source command 2022-12-31 13:35:19 -05:00
test_000_version.py
test_bind.py test: Make test_bind_unbind_with_uclass() single-threaded 2022-09-12 18:06:36 -04:00
test_bootmenu.py test: restore timeout after bootmenu unit test 2022-05-28 10:59:27 +02:00
test_button.py cmd/button: return button status 2020-10-14 11:16:34 -04:00
test_cleanup_build.py test: Find leftovers after clean/mrproper 2023-07-07 16:25:56 -04:00
test_dfu.py
test_dm.py dm: core: Support sorting devices with dm tree 2023-01-23 18:11:39 -05:00
test_efi_fit.py test: correct architecture in EFI FIT test 2023-06-16 06:45:20 +02:00
test_efi_loader.py test: address some pylint warnings 2021-11-26 21:30:59 +01:00
test_efi_selftest.py efi: Rename the base efi self-test 2023-05-04 09:57:43 +02:00
test_env.py test: env: add test for u-boot-initial-env creation 2023-01-11 15:02:23 -05:00
test_event_dump.py efi: Use the installed SMBIOS tables 2023-09-22 06:05:40 +08:00
test_extension.py pytest: add sandbox test for "extension" command 2021-05-13 13:09:09 -04:00
test_fit.py test: Move common FIT code into a separate fit_util file 2022-10-17 21:17:13 -06:00
test_fit_auto_signed.py mkimage: fit: Support signed configurations in 'auto' FITs 2023-01-27 12:51:27 -05:00
test_fit_ecdsa.py test: Update FIT tests to run in parallel 2022-09-12 18:06:36 -04:00
test_fit_hashes.py test: Update FIT tests to run in parallel 2022-09-12 18:06:36 -04:00
test_fpga.py
test_gpio.py test: Make test_gpio_read() independent 2022-09-12 18:06:36 -04:00
test_gpt.py cmd: gpt: Add command to swap partition order 2023-09-11 16:27:49 -04:00
test_handoff.py
test_help.py sandbox: Avoid binman error when run without device tree 2022-05-05 09:29:57 -04:00
test_hush_if_test.py test: hush_if_test: Add hush variable test 2023-05-03 18:30:46 -04:00
test_kconfig.py test: Add some tests for kconfig.h 2022-08-10 13:38:30 -04:00
test_log.py sandbox: Drop the 'starting...' message 2021-03-12 09:57:29 -05:00
test_lsblk.py test: test_lsblk: Mark as sandbox specific 2022-01-14 12:26:42 -05:00
test_md.py
test_mmc_rd.py
test_mmc_wr.py
test_net.py test/py: net: Add a test for 'pxe get' command 2023-10-10 14:57:29 +02:00
test_of_migrate.py dm: test: Add a test for the various migration combinations 2023-02-14 09:43:27 -07:00
test_ofplatdata.py dm: treewide: Complete migration to new driver model schema 2023-02-14 09:43:27 -07:00
test_part.py test/py: test_part: Correct the test case name 2022-05-26 10:27:14 -04:00
test_pinmux.py test: Fix test_pinmux to run in parallel 2022-09-12 18:06:36 -04:00
test_pstore.py test: Add PStore command tests 2020-10-14 11:16:34 -04:00
test_pstore_data_console.hex test: Add PStore command tests 2020-10-14 11:16:34 -04:00
test_pstore_data_panic1.hex test: Add PStore command tests 2020-10-14 11:16:34 -04:00
test_pstore_data_panic2.hex test: Add PStore command tests 2020-10-14 11:16:34 -04:00
test_qfw.py test: qemu: add qfw sandbox driver, dm tests, qemu tests 2021-04-12 17:45:39 -04:00
test_sandbox_exit.py test: unit test for exception command 2020-12-13 07:58:17 -07:00
test_scp03.py global: Use proper project name U-Boot 2023-06-12 13:24:31 +02:00
test_sf.py
test_shell_basics.py
test_sleep.py test/py: sleep: Add a test for the time command 2023-10-09 15:24:31 -04:00
test_source.py cmd: source: Support specifying config name 2022-12-31 13:35:19 -05:00
test_spl.py test: spl: Add a test for the SPI load method 2023-10-17 20:50:52 -04:00
test_stackprotector.py test/py: test_stackprotector: Disable for ASAN 2022-06-23 12:58:18 -04:00
test_tpm2.py test/py: always use autostart on tpm2 selftests 2023-10-27 13:17:21 +03:00
test_trace.py initcall: Support emitting events 2023-08-31 13:16:54 -04:00
test_ums.py
test_unknown_cmd.py
test_ut.py cmd: mbr: Allow 4 MBR partitions without need for extended 2023-10-24 17:05:24 -04:00
test_vbe.py vbe: Use a manual test 2022-10-31 11:04:00 -04:00
test_vbe_vpl.py vbe: Use the correct image filename in the test 2023-04-03 06:53:53 +12:00
test_vboot.py test_vboot.py: include test of fdt_add_pubkey tool 2023-04-02 17:39:41 +12:00
test_vpl.py vpl: Support running vpl tests 2022-05-02 09:58:13 -04:00
vboot_evil.py test: Correct pylint errors 2022-03-02 10:28:12 -05:00
vboot_forge.py fit: Don't allow verification of images with @ nodes 2021-02-15 19:17:25 -05:00