u-boot/lib/efi_selftest/efi_miniapp_tcg2_ia32.h
Masahisa Kojima aa1b504927 efi_selftest: add selftest for EFI_TCG2_PROTOCOL and Measured Boot
This commit adds the missing EFI_TCG2_PROTOCOL selftest
and Measured Boot selftest in lib/efi_selftest.

This selftest includes PE/COFF image measurement test, some PCR values are
different in each architecture. With that, this commit also adds pre-built
versions of lib/efi_selftest/efi_miniapp_file_image_exit.c for PE/COFF
image measurement test for 32-bit arm, arm64, ia32, x86_64, riscv32 and
riscv64. Prebuilding avoids the problem of reproducible builds.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>

Make the test 'onrequest'.
Add code comments to the includes with the binaries.
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-11-07 18:36:55 +01:00

178 lines
12 KiB
C

/* SPDX-License-Identifier: GPL-2.0+ */
/*
* This file contains a precompiled EFI binary built from
* lib/efi_selftest/efi_miniapp_file_image_exit.c and converted to an include
* using tools/file2include. It is used to testing the EFI_TCG2_PROTOCOL.
* The precompiled form is needed to avoid the problem of reproducible builds.
*/
#define EFI_ST_DISK_IMG { 0x00001200, { \
{0x00000000, "\x4d\x5a\x90\x00\x03\x00\x00\x00"}, /* MZ...... */ \
{0x00000008, "\x04\x00\x00\x00\xff\xff\x00\x00"}, /* ........ */ \
{0x00000010, "\xb8\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
{0x00000018, "\x40\x00\x00\x00\x00\x00\x00\x00"}, /* @....... */ \
{0x00000038, "\x00\x00\x00\x00\x80\x00\x00\x00"}, /* ........ */ \
{0x00000040, "\x0e\x1f\xba\x0e\x00\xb4\x09\xcd"}, /* ........ */ \
{0x00000048, "\x21\xb8\x01\x4c\xcd\x21\x54\x68"}, /* !..L.!Th */ \
{0x00000050, "\x69\x73\x20\x70\x72\x6f\x67\x72"}, /* is progr */ \
{0x00000058, "\x61\x6d\x20\x63\x61\x6e\x6e\x6f"}, /* am canno */ \
{0x00000060, "\x74\x20\x62\x65\x20\x72\x75\x6e"}, /* t be run */ \
{0x00000068, "\x20\x69\x6e\x20\x44\x4f\x53\x20"}, /* in DOS */ \
{0x00000070, "\x6d\x6f\x64\x65\x2e\x0d\x0d\x0a"}, /* mode.... */ \
{0x00000078, "\x24\x00\x00\x00\x00\x00\x00\x00"}, /* $....... */ \
{0x00000080, "\x50\x45\x00\x00\x4c\x01\x06\x00"}, /* PE..L... */ \
{0x00000090, "\x00\x00\x00\x00\xe0\x00\x0e\x03"}, /* ........ */ \
{0x00000098, "\x0b\x01\x02\x1e\x00\x04\x00\x00"}, /* ........ */ \
{0x000000a0, "\x00\x0a\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
{0x000000a8, "\x00\x10\x00\x00\x00\x10\x00\x00"}, /* ........ */ \
{0x000000b0, "\x00\x30\x00\x00\x00\x00\x00\x00"}, /* .0...... */ \
{0x000000b8, "\x00\x10\x00\x00\x00\x02\x00\x00"}, /* ........ */ \
{0x000000d0, "\x00\x70\x00\x00\x00\x04\x00\x00"}, /* .p...... */ \
{0x000000d8, "\x6c\xdf\x00\x00\x0a\x00\x00\x00"}, /* l....... */ \
{0x000000f0, "\x00\x00\x00\x00\x10\x00\x00\x00"}, /* ........ */ \
{0x00000120, "\x00\x50\x00\x00\x0a\x00\x00\x00"}, /* .P...... */ \
{0x00000178, "\x2e\x74\x65\x78\x74\x00\x00\x00"}, /* .text... */ \
{0x00000180, "\x1b\x02\x00\x00\x00\x10\x00\x00"}, /* ........ */ \
{0x00000188, "\x00\x04\x00\x00\x00\x04\x00\x00"}, /* ........ */ \
{0x00000198, "\x00\x00\x00\x00\x20\x00\x30\x60"}, /* .... .0` */ \
{0x000001a0, "\x2e\x73\x64\x61\x74\x61\x00\x00"}, /* .sdata.. */ \
{0x000001a8, "\x0c\x00\x00\x00\x00\x20\x00\x00"}, /* ..... .. */ \
{0x000001b0, "\x00\x02\x00\x00\x00\x08\x00\x00"}, /* ........ */ \
{0x000001c0, "\x00\x00\x00\x00\x40\x00\x30\xc0"}, /* ....@.0. */ \
{0x000001c8, "\x2e\x64\x61\x74\x61\x00\x00\x00"}, /* .data... */ \
{0x000001d0, "\x38\x01\x00\x00\x00\x30\x00\x00"}, /* 8....0.. */ \
{0x000001d8, "\x00\x02\x00\x00\x00\x0a\x00\x00"}, /* ........ */ \
{0x000001e8, "\x00\x00\x00\x00\x40\x00\x40\xc0"}, /* ....@.@. */ \
{0x000001f0, "\x2e\x64\x79\x6e\x61\x6d\x69\x63"}, /* .dynamic */ \
{0x000001f8, "\x70\x00\x00\x00\x00\x40\x00\x00"}, /* p....@.. */ \
{0x00000200, "\x00\x02\x00\x00\x00\x0c\x00\x00"}, /* ........ */ \
{0x00000210, "\x00\x00\x00\x00\x40\x00\x30\xc0"}, /* ....@.0. */ \
{0x00000218, "\x2e\x72\x65\x6c\x6f\x63\x00\x00"}, /* .reloc.. */ \
{0x00000220, "\x0a\x00\x00\x00\x00\x50\x00\x00"}, /* .....P.. */ \
{0x00000228, "\x00\x02\x00\x00\x00\x0e\x00\x00"}, /* ........ */ \
{0x00000238, "\x00\x00\x00\x00\x40\x00\x10\x42"}, /* ....@..B */ \
{0x00000240, "\x2e\x64\x79\x6e\x73\x79\x6d\x00"}, /* .dynsym. */ \
{0x00000248, "\x30\x00\x00\x00\x00\x60\x00\x00"}, /* 0....`.. */ \
{0x00000250, "\x00\x02\x00\x00\x00\x10\x00\x00"}, /* ........ */ \
{0x00000260, "\x00\x00\x00\x00\x40\x00\x30\x40"}, /* ....@.0@ */ \
{0x00000400, "\x55\x89\xe5\xff\x75\x0c\xff\x75"}, /* U...u..u */ \
{0x00000408, "\x08\xe8\x00\x00\x00\x00\x58\x89"}, /* ......X. */ \
{0x00000410, "\xc3\x05\xf2\xef\xff\xff\x81\xc3"}, /* ........ */ \
{0x00000418, "\xf2\x2f\x00\x00\x53\x50\xe8\x20"}, /* ./..SP. */ \
{0x00000420, "\x01\x00\x00\x5b\x5b\x85\xc0\x75"}, /* ...[[..u */ \
{0x00000428, "\x05\xe8\x8a\x00\x00\x00\xc9\xc3"}, /* ........ */ \
{0x00000430, "\x57\x56\x53\x83\xec\x18\xe8\x00"}, /* WVS..... */ \
{0x00000438, "\x01\x00\x00\x81\xc6\xc5\x0f\x00"}, /* ........ */ \
{0x00000440, "\x00\x8b\x44\x24\x2c\x8b\x58\x2c"}, /* ..D$,.X, */ \
{0x00000448, "\x8b\x40\x3c\x6a\x02\x6a\x00\x6a"}, /* .@<j.j.j */ \
{0x00000450, "\x00\x8d\x54\x24\x20\x52\x8d\x96"}, /* ..T$ R.. */ \
{0x00000458, "\x28\x11\x00\x00\x52\xff\x74\x24"}, /* (...R.t$ */ \
{0x00000460, "\x3c\xff\x90\x98\x00\x00\x00\x89"}, /* <....... */ \
{0x00000468, "\xc7\x83\xc4\x20\x85\xc0\x74\x12"}, /* ... ..t. */ \
{0x00000470, "\x52\x52\x8d\x86\x02\x10\x00\x00"}, /* RR...... */ \
{0x00000478, "\x50\x53\xff\x53\x04\x83\xc4\x10"}, /* PS.S.... */ \
{0x00000480, "\xeb\x2d\x8b\x4c\x24\x0c\x8b\x41"}, /* .-.L$..A */ \
{0x00000488, "\x20\x8d\x96\x30\xf0\xff\xff\x39"}, /* ..0...9 */ \
{0x00000490, "\xd0\x77\x07\x03\x41\x28\x39\xd0"}, /* .w..A(9. */ \
{0x00000498, "\x77\x15\x50\x50\x8d\x86\x4c\x10"}, /* w.PP..L. */ \
{0x000004a0, "\x00\x00\x50\x53\xff\x53\x04\x83"}, /* ..PS.S.. */ \
{0x000004a8, "\xc4\x10\xbf\x0e\x00\x00\x80\x89"}, /* ........ */ \
{0x000004b0, "\xf8\x83\xc4\x10\x5b\x5e\x5f\xc3"}, /* ....[^_. */ \
{0x000004b8, "\x55\x57\x56\x53\x83\xec\x1c\xe8"}, /* UWVS.... */ \
{0x000004c0, "\x7b\x00\x00\x00\x81\xc5\x3c\x0f"}, /* {.....<. */ \
{0x000004c8, "\x00\x00\x8b\x44\x24\x34\x8b\x58"}, /* ...D$4.X */ \
{0x000004d0, "\x2c\x89\xe7\x8d\xb5\x0e\x11\x00"}, /* ,....... */ \
{0x000004d8, "\x00\xb9\x04\x00\x00\x00\xf3\xa5"}, /* ........ */ \
{0x000004e0, "\x52\x52\x8d\x85\x94\x10\x00\x00"}, /* RR...... */ \
{0x000004e8, "\x50\x53\xff\x53\x04\x59\x5e\xff"}, /* PS.S.Y^. */ \
{0x000004f0, "\x74\x24\x3c\xff\x74\x24\x3c\xe8"}, /* t$<.t$<. */ \
{0x000004f8, "\x34\xff\xff\xff\x83\xc4\x10\xba"}, /* 4....... */ \
{0x00000500, "\x03\x00\x00\x80\x85\xc0\x74\x15"}, /* ......t. */ \
{0x00000508, "\x50\x50\x8d\x85\xd0\x10\x00\x00"}, /* PP...... */ \
{0x00000510, "\x50\x53\xff\x53\x04\x83\xc4\x10"}, /* PS.S.... */ \
{0x00000518, "\xba\x0e\x00\x00\x80\x8b\x44\x24"}, /* ......D$ */ \
{0x00000520, "\x34\x8b\x40\x3c\x89\xe1\x51\x6a"}, /* 4.@<..Qj */ \
{0x00000528, "\x10\x52\xff\x74\x24\x3c\xff\x50"}, /* .R.t$<.P */ \
{0x00000530, "\x78\x31\xc0\x83\xc4\x2c\x5b\x5e"}, /* x1...,[^ */ \
{0x00000538, "\x5f\x5d\xc3\x8b\x34\x24\xc3\x8b"}, /* _]..4$.. */ \
{0x00000540, "\x2c\x24\xc3\x57\x56\x53\x8b\x7c"}, /* ,$.WVS.| */ \
{0x00000548, "\x24\x10\x8b\x44\x24\x14\x83\xc0"}, /* $..D$... */ \
{0x00000550, "\x04\x31\xd2\x31\xc9\x31\xdb\x8b"}, /* .1.1.1.. */ \
{0x00000558, "\x70\xfc\x85\xf6\x74\x20\x83\xfe"}, /* p...t .. */ \
{0x00000560, "\x12\x74\x10\x83\xfe\x13\x74\x0f"}, /* .t....t. */ \
{0x00000568, "\x83\xfe\x11\x75\x0c\x8b\x10\x01"}, /* ...u.... */ \
{0x00000570, "\xfa\xeb\x06\x8b\x18\xeb\x02\x8b"}, /* ........ */ \
{0x00000578, "\x08\x83\xc0\x08\xeb\xd9\xb8\x01"}, /* ........ */ \
{0x00000580, "\x00\x00\x80\x85\xd2\x75\x08\x85"}, /* .....u.. */ \
{0x00000588, "\xc9\x75\x1e\x31\xc0\xeb\x1a\x85"}, /* .u.1.... */ \
{0x00000590, "\xc9\x74\x16\x85\xdb\x7e\xf4\x80"}, /* .t...~.. */ \
{0x00000598, "\x7a\x04\x08\x75\x06\x8b\x02\x01"}, /* z..u.... */ \
{0x000005a0, "\xf8\x01\x38\x01\xca\x29\xcb\xeb"}, /* ..8..).. */ \
{0x000005a8, "\xea\x5b\x5e\x5f\xc3\x57\x56\x53"}, /* .[^_.WVS */ \
{0x000005b0, "\x53\x89\xc7\x31\xf6\x39\xf1\x74"}, /* S..1.9.t */ \
{0x000005b8, "\x1c\x8a\x1c\x37\x46\x8a\x44\x32"}, /* ...7F.D2 */ \
{0x000005c0, "\xff\x88\x44\x24\x03\x38\xc3\x74"}, /* ..D$.8.t */ \
{0x000005c8, "\xec\x0f\xb6\xc3\x0f\xb6\x54\x24"}, /* ......T$ */ \
{0x000005d0, "\x03\x29\xd0\xeb\x02\x31\xc0\x5a"}, /* .)...1.Z */ \
{0x000005d8, "\x5b\x5e\x5f\xc3\x56\x53\x89\xce"}, /* [^_.VS.. */ \
{0x000005e0, "\x39\xd0\x77\x0f\x31\xdb\x39\xde"}, /* 9.w.1.9. */ \
{0x000005e8, "\x74\x18\x8a\x0c\x1a\x88\x0c\x18"}, /* t....... */ \
{0x000005f0, "\x43\xeb\xf3\x85\xf6\x74\x0b\x8a"}, /* C....t.. */ \
{0x000005f8, "\x5c\x32\xff\x88\x5c\x30\xff\x4e"}, /* \2..\0.N */ \
{0x00000600, "\xeb\xf1\x5b\x5e\xc3\xe9\xd2\xff"}, /* ..[^.... */ \
{0x00000608, "\xff\xff\x53\x31\xdb\x39\xd9\x74"}, /* ..S1.9.t */ \
{0x00000610, "\x06\x88\x14\x18\x43\xeb\xf6\x5b"}, /* ....C..[ */ \
{0x00000618, "\xc3\xc3\xc3\x00\x00\x00\x00\x00"}, /* ........ */ \
{0x00000800, "\x00\x40\x00\x00\x00\x00\x00\x00"}, /* .@...... */ \
{0x00000a00, "\x00\x00\x43\x00\x6f\x00\x75\x00"}, /* ..C.o.u. */ \
{0x00000a08, "\x6c\x00\x64\x00\x20\x00\x6e\x00"}, /* l.d. .n. */ \
{0x00000a10, "\x6f\x00\x74\x00\x20\x00\x6f\x00"}, /* o.t. .o. */ \
{0x00000a18, "\x70\x00\x65\x00\x6e\x00\x20\x00"}, /* p.e.n. . */ \
{0x00000a20, "\x6c\x00\x6f\x00\x61\x00\x64\x00"}, /* l.o.a.d. */ \
{0x00000a28, "\x65\x00\x64\x00\x20\x00\x69\x00"}, /* e.d. .i. */ \
{0x00000a30, "\x6d\x00\x61\x00\x67\x00\x65\x00"}, /* m.a.g.e. */ \
{0x00000a38, "\x20\x00\x70\x00\x72\x00\x6f\x00"}, /* .p.r.o. */ \
{0x00000a40, "\x74\x00\x6f\x00\x63\x00\x6f\x00"}, /* t.o.c.o. */ \
{0x00000a48, "\x6c\x00\x00\x00\x49\x00\x6e\x00"}, /* l...I.n. */ \
{0x00000a50, "\x63\x00\x6f\x00\x72\x00\x72\x00"}, /* c.o.r.r. */ \
{0x00000a58, "\x65\x00\x63\x00\x74\x00\x20\x00"}, /* e.c.t. . */ \
{0x00000a60, "\x69\x00\x6d\x00\x61\x00\x67\x00"}, /* i.m.a.g. */ \
{0x00000a68, "\x65\x00\x5f\x00\x62\x00\x61\x00"}, /* e._.b.a. */ \
{0x00000a70, "\x73\x00\x65\x00\x20\x00\x6f\x00"}, /* s.e. .o. */ \
{0x00000a78, "\x72\x00\x20\x00\x69\x00\x6d\x00"}, /* r. .i.m. */ \
{0x00000a80, "\x61\x00\x67\x00\x65\x00\x5f\x00"}, /* a.g.e._. */ \
{0x00000a88, "\x73\x00\x69\x00\x7a\x00\x65\x00"}, /* s.i.z.e. */ \
{0x00000a90, "\x0a\x00\x00\x00\x45\x00\x46\x00"}, /* ....E.F. */ \
{0x00000a98, "\x49\x00\x20\x00\x61\x00\x70\x00"}, /* I. .a.p. */ \
{0x00000aa0, "\x70\x00\x6c\x00\x69\x00\x63\x00"}, /* p.l.i.c. */ \
{0x00000aa8, "\x61\x00\x74\x00\x69\x00\x6f\x00"}, /* a.t.i.o. */ \
{0x00000ab0, "\x6e\x00\x20\x00\x63\x00\x61\x00"}, /* n. .c.a. */ \
{0x00000ab8, "\x6c\x00\x6c\x00\x69\x00\x6e\x00"}, /* l.l.i.n. */ \
{0x00000ac0, "\x67\x00\x20\x00\x45\x00\x78\x00"}, /* g. .E.x. */ \
{0x00000ac8, "\x69\x00\x74\x00\x0a\x00\x00\x00"}, /* i.t..... */ \
{0x00000ad0, "\x4c\x00\x6f\x00\x61\x00\x64\x00"}, /* L.o.a.d. */ \
{0x00000ad8, "\x65\x00\x64\x00\x20\x00\x69\x00"}, /* e.d. .i. */ \
{0x00000ae0, "\x6d\x00\x61\x00\x67\x00\x65\x00"}, /* m.a.g.e. */ \
{0x00000ae8, "\x20\x00\x70\x00\x72\x00\x6f\x00"}, /* .p.r.o. */ \
{0x00000af0, "\x74\x00\x6f\x00\x63\x00\x6f\x00"}, /* t.o.c.o. */ \
{0x00000af8, "\x6c\x00\x20\x00\x6d\x00\x69\x00"}, /* l. .m.i. */ \
{0x00000b00, "\x73\x00\x73\x00\x69\x00\x6e\x00"}, /* s.s.i.n. */ \
{0x00000b08, "\x67\x00\x0a\x00\x00\x00\x53\x00"}, /* g.....S. */ \
{0x00000b10, "\x55\x00\x43\x00\x43\x00\x45\x00"}, /* U.C.C.E. */ \
{0x00000b18, "\x53\x00\x53\x00\x00\x00\x00\x00"}, /* S.S..... */ \
{0x00000b28, "\xa1\x31\x1b\x5b\x62\x95\xd2\x11"}, /* .1.[b... */ \
{0x00000b30, "\x8e\x3f\x00\xa0\xc9\x69\x72\x3b"}, /* .?...ir; */ \
{0x00000c00, "\x10\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
{0x00000c08, "\x04\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
{0x00000c10, "\xf5\xfe\xff\x6f\x14\x70\x00\x00"}, /* ...o.p.. */ \
{0x00000c18, "\x05\x00\x00\x00\x00\x70\x00\x00"}, /* .....p.. */ \
{0x00000c20, "\x06\x00\x00\x00\x00\x60\x00\x00"}, /* .....`.. */ \
{0x00000c28, "\x0a\x00\x00\x00\x13\x00\x00\x00"}, /* ........ */ \
{0x00000c30, "\x0b\x00\x00\x00\x10\x00\x00\x00"}, /* ........ */ \
{0x00000c38, "\x1e\x00\x00\x00\x02\x00\x00\x00"}, /* ........ */ \
{0x00000e00, "\x20\x31\x00\x00\x0a\x00\x00\x00"}, /* 1...... */ \
{0x00001010, "\x01\x00\x00\x00\x00\x10\x00\x00"}, /* ........ */ \
{0x00001018, "\x00\x00\x00\x00\x10\x00\x02\x00"}, /* ........ */ \
{0x00001020, "\x08\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
{0x00001028, "\x00\x00\x00\x00\x10\x00\x01\x00"}, /* ........ */ \
{0, NULL} } }