mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
aa1b504927
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>
190 lines
12 KiB
C
190 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 { 0x000011c8, { \
|
|
{0x00000000, "\x4d\x5a\x00\x00\x00\x00\x00\x00"}, /* MZ...... */ \
|
|
{0x00000030, "\x52\x49\x53\x43\x56\x00\x00\x00"}, /* RISCV... */ \
|
|
{0x00000038, "\x52\x53\x43\x05\x40\x00\x00\x00"}, /* RSC.@... */ \
|
|
{0x00000040, "\x50\x45\x00\x00\x64\x50\x02\x00"}, /* PE..dP.. */ \
|
|
{0x00000050, "\x00\x00\x00\x00\xf0\x00\x0e\x02"}, /* ........ */ \
|
|
{0x00000058, "\x0b\x02\x02\x14\x58\x04\x00\x00"}, /* ....X... */ \
|
|
{0x00000068, "\x98\x01\x00\x00\x98\x01\x00\x00"}, /* ........ */ \
|
|
{0x00000078, "\x20\x00\x00\x00\x08\x00\x00\x00"}, /* ....... */ \
|
|
{0x00000080, "\x00\x00\x00\x00\x01\x00\x00\x00"}, /* ........ */ \
|
|
{0x00000090, "\xf0\x05\x00\x00\x98\x01\x00\x00"}, /* ........ */ \
|
|
{0x00000098, "\x00\x00\x00\x00\x0a\x00\x00\x00"}, /* ........ */ \
|
|
{0x000000c0, "\x00\x00\x00\x00\x06\x00\x00\x00"}, /* ........ */ \
|
|
{0x00000148, "\x2e\x72\x65\x6c\x6f\x63\x00\x00"}, /* .reloc.. */ \
|
|
{0x00000168, "\x00\x00\x00\x00\x40\x00\x10\x42"}, /* ....@..B */ \
|
|
{0x00000170, "\x2e\x74\x65\x78\x74\x00\x00\x00"}, /* .text... */ \
|
|
{0x00000178, "\x58\x04\x00\x00\x98\x01\x00\x00"}, /* X....... */ \
|
|
{0x00000180, "\x58\x04\x00\x00\x98\x01\x00\x00"}, /* X....... */ \
|
|
{0x00000190, "\x00\x00\x00\x00\x20\x00\x50\xe0"}, /* .... .P. */ \
|
|
{0x00000198, "\x21\x11\x2a\xe0\x2e\xe4\x06\xe8"}, /* !....... */ \
|
|
{0x000001a0, "\x17\x05\x00\x00\x13\x05\x05\xe6"}, /* ........ */ \
|
|
{0x000001a8, "\x97\x05\x00\x00\x93\x85\x85\x31"}, /* .......1 */ \
|
|
{0x000001b0, "\xef\x00\x20\x0f\x63\x17\x05\x00"}, /* .. .c... */ \
|
|
{0x000001b8, "\xa2\x65\x02\x65\xef\x00\x80\x07"}, /* .e.e.... */ \
|
|
{0x000001c0, "\xc2\x60\x61\x01\x82\x80\x79\x71"}, /* .`a...yq */ \
|
|
{0x000001c8, "\x22\xf0\x06\xf4\x26\xec\xbc\x71"}, /* "...&..q */ \
|
|
{0x000001d0, "\xa4\x61\x01\x47\x03\xb8\x87\x11"}, /* .a.G.... */ \
|
|
{0x000001d8, "\x81\x46\x89\x47\x30\x00\x97\x05"}, /* .F.G0... */ \
|
|
{0x000001e0, "\x00\x00\x93\x85\x25\x3f\x02\x98"}, /* ....%?.. */ \
|
|
{0x000001e8, "\x2a\x84\x11\xcd\x9c\x64\x97\x05"}, /* .....d.. */ \
|
|
{0x000001f0, "\x00\x00\x93\x85\x25\x1a\x26\x85"}, /* ....%.&. */ \
|
|
{0x000001f8, "\x82\x97\x22\x85\xa2\x70\x02\x74"}, /* .."..p.t */ \
|
|
{0x00000200, "\xe2\x64\x45\x61\x82\x80\xa2\x66"}, /* .dEa...f */ \
|
|
{0x00000208, "\x17\x07\x00\x00\x13\x07\xe7\xfb"}, /* ........ */ \
|
|
{0x00000210, "\xbc\x62\x63\x66\xf7\x00\xb4\x66"}, /* .bcf...f */ \
|
|
{0x00000218, "\xb6\x97\xe3\x60\xf7\xfe\x9c\x64"}, /* ...`...d */ \
|
|
{0x00000220, "\x7d\x54\x97\x05\x00\x00\x93\x85"}, /* }T...... */ \
|
|
{0x00000228, "\xe5\x1b\x26\x85\x7e\x14\x82\x97"}, /* ..&.~... */ \
|
|
{0x00000230, "\x39\x04\xe1\xb7\x79\x71\x97\x07"}, /* 9...yq.. */ \
|
|
{0x00000238, "\x00\x00\x93\x87\x27\x27\x26\xec"}, /* ....''&. */ \
|
|
{0x00000240, "\x4a\xe8\x06\xf4\x22\xf0\x98\x63"}, /* J..."..c */ \
|
|
{0x00000248, "\x9c\x67\xa0\x61\x3a\xe0\x3e\xe4"}, /* .g.a:.>. */ \
|
|
{0x00000250, "\x1c\x64\x2a\x89\xae\x84\x22\x85"}, /* .d....". */ \
|
|
{0x00000258, "\x97\x05\x00\x00\x93\x85\x05\x1d"}, /* ........ */ \
|
|
{0x00000260, "\x82\x97\xa6\x85\x4a\x85\xef\xf0"}, /* ....J... */ \
|
|
{0x00000268, "\x1f\xf6\x05\xc9\x1c\x64\x97\x05"}, /* .....d.. */ \
|
|
{0x00000270, "\x00\x00\x93\x85\xa5\x1f\x22\x85"}, /* ......". */ \
|
|
{0x00000278, "\x82\x97\xfd\x55\xfe\x15\xb9\x05"}, /* ...U.... */ \
|
|
{0x00000280, "\xbc\x70\x8a\x86\x4a\x85\xfc\x6f"}, /* .p..J..o */ \
|
|
{0x00000288, "\x41\x46\x82\x97\xa2\x70\x02\x74"}, /* AF...p.t */ \
|
|
{0x00000290, "\xe2\x64\x42\x69\x01\x45\x45\x61"}, /* .dBi.EEa */ \
|
|
{0x00000298, "\x82\x80\xfd\x55\xfe\x15\x8d\x05"}, /* ...U.... */ \
|
|
{0x000002a0, "\xc5\xb7\xa1\x05\x81\x47\x01\x47"}, /* .....G.G */ \
|
|
{0x000002a8, "\x81\x46\x21\x48\xa5\x48\x1d\x43"}, /* .F!H.H.C */ \
|
|
{0x000002b0, "\x03\xb6\x85\xff\x09\xe6\x95\xe3"}, /* ........ */ \
|
|
{0x000002b8, "\x31\xe7\x01\x45\x82\x80\x63\x0a"}, /* 1..E..c. */ \
|
|
{0x000002c0, "\x06\x01\x63\x0a\x16\x01\x63\x14"}, /* ..c...c. */ \
|
|
{0x000002c8, "\x66\x00\x9c\x61\xaa\x97\xc1\x05"}, /* f..a.... */ \
|
|
{0x000002d0, "\xc5\xb7\x94\x61\xed\xbf\x98\x61"}, /* ...a...a */ \
|
|
{0x000002d8, "\xdd\xbf\x0d\xc7\x7d\x56\x01\x92"}, /* ....}V.. */ \
|
|
{0x000002e0, "\x8d\x48\xe3\x5c\xd0\xfc\x8c\x67"}, /* .H.\...g */ \
|
|
{0x000002e8, "\xf1\x8d\x63\x9c\x15\x01\x8c\x63"}, /* ..c....c */ \
|
|
{0x000002f0, "\x03\xb8\x07\x01\x99\x8e\xaa\x95"}, /* ........ */ \
|
|
{0x000002f8, "\x2a\x98\x23\xb0\x05\x01\xba\x97"}, /* ..#..... */ \
|
|
{0x00000300, "\xcd\xb7\x01\xa0\x7d\x55\x7e\x15"}, /* ....}U~. */ \
|
|
{0x00000308, "\x05\x05\x82\x80\x01\x47\x63\x14"}, /* .....Gc. */ \
|
|
{0x00000310, "\xe6\x00\x01\x45\x82\x80\xb3\x07"}, /* ...E.... */ \
|
|
{0x00000318, "\xe5\x00\x05\x07\xb3\x86\xe5\x00"}, /* ........ */ \
|
|
{0x00000320, "\x83\xc7\x07\x00\x83\xc6\xf6\xff"}, /* ........ */ \
|
|
{0x00000328, "\xe3\x83\xd7\xfe\x3b\x85\xd7\x40"}, /* ....;..@ */ \
|
|
{0x00000330, "\x82\x80\x63\xf5\xa5\x02\x93\x46"}, /* ..c....F */ \
|
|
{0x00000338, "\xf6\xff\x81\x47\xfd\x17\x63\x91"}, /* ...G..c. */ \
|
|
{0x00000340, "\xd7\x02\x82\x80\x33\x87\xf5\x00"}, /* ....3... */ \
|
|
{0x00000348, "\x83\x46\x07\x00\x33\x07\xf5\x00"}, /* .F..3... */ \
|
|
{0x00000350, "\x85\x07\x23\x00\xd7\x00\xe3\x17"}, /* ..#..... */ \
|
|
{0x00000358, "\xf6\xfe\x82\x80\x81\x47\xe5\xbf"}, /* .....G.. */ \
|
|
{0x00000360, "\x33\x07\xf6\x00\x33\x88\xe5\x00"}, /* 3...3... */ \
|
|
{0x00000368, "\x03\x48\x08\x00\x2a\x97\x23\x00"}, /* .H....#. */ \
|
|
{0x00000370, "\x07\x01\xe9\xb7\x6f\xf0\xff\xfb"}, /* ....o... */ \
|
|
{0x00000378, "\x2a\x96\xaa\x87\x63\x93\xc7\x00"}, /* ....c... */ \
|
|
{0x00000380, "\x82\x80\x85\x07\xa3\x8f\xb7\xfe"}, /* ........ */ \
|
|
{0x00000388, "\xd5\xbf\x82\x80\x82\x80\x00\x00"}, /* ........ */ \
|
|
{0x00000390, "\x43\x00\x6f\x00\x75\x00\x6c\x00"}, /* C.o.u.l. */ \
|
|
{0x00000398, "\x64\x00\x20\x00\x6e\x00\x6f\x00"}, /* d. .n.o. */ \
|
|
{0x000003a0, "\x74\x00\x20\x00\x6f\x00\x70\x00"}, /* t. .o.p. */ \
|
|
{0x000003a8, "\x65\x00\x6e\x00\x20\x00\x6c\x00"}, /* e.n. .l. */ \
|
|
{0x000003b0, "\x6f\x00\x61\x00\x64\x00\x65\x00"}, /* o.a.d.e. */ \
|
|
{0x000003b8, "\x64\x00\x20\x00\x69\x00\x6d\x00"}, /* d. .i.m. */ \
|
|
{0x000003c0, "\x61\x00\x67\x00\x65\x00\x20\x00"}, /* a.g.e. . */ \
|
|
{0x000003c8, "\x70\x00\x72\x00\x6f\x00\x74\x00"}, /* p.r.o.t. */ \
|
|
{0x000003d0, "\x6f\x00\x63\x00\x6f\x00\x6c\x00"}, /* o.c.o.l. */ \
|
|
{0x000003e0, "\x49\x00\x6e\x00\x63\x00\x6f\x00"}, /* I.n.c.o. */ \
|
|
{0x000003e8, "\x72\x00\x72\x00\x65\x00\x63\x00"}, /* r.r.e.c. */ \
|
|
{0x000003f0, "\x74\x00\x20\x00\x69\x00\x6d\x00"}, /* t. .i.m. */ \
|
|
{0x000003f8, "\x61\x00\x67\x00\x65\x00\x5f\x00"}, /* a.g.e._. */ \
|
|
{0x00000400, "\x62\x00\x61\x00\x73\x00\x65\x00"}, /* b.a.s.e. */ \
|
|
{0x00000408, "\x20\x00\x6f\x00\x72\x00\x20\x00"}, /* .o.r. . */ \
|
|
{0x00000410, "\x69\x00\x6d\x00\x61\x00\x67\x00"}, /* i.m.a.g. */ \
|
|
{0x00000418, "\x65\x00\x5f\x00\x73\x00\x69\x00"}, /* e._.s.i. */ \
|
|
{0x00000420, "\x7a\x00\x65\x00\x0a\x00\x00\x00"}, /* z.e..... */ \
|
|
{0x00000428, "\x45\x00\x46\x00\x49\x00\x20\x00"}, /* E.F.I. . */ \
|
|
{0x00000430, "\x61\x00\x70\x00\x70\x00\x6c\x00"}, /* a.p.p.l. */ \
|
|
{0x00000438, "\x69\x00\x63\x00\x61\x00\x74\x00"}, /* i.c.a.t. */ \
|
|
{0x00000440, "\x69\x00\x6f\x00\x6e\x00\x20\x00"}, /* i.o.n. . */ \
|
|
{0x00000448, "\x63\x00\x61\x00\x6c\x00\x6c\x00"}, /* c.a.l.l. */ \
|
|
{0x00000450, "\x69\x00\x6e\x00\x67\x00\x20\x00"}, /* i.n.g. . */ \
|
|
{0x00000458, "\x45\x00\x78\x00\x69\x00\x74\x00"}, /* E.x.i.t. */ \
|
|
{0x00000460, "\x0a\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00000468, "\x4c\x00\x6f\x00\x61\x00\x64\x00"}, /* L.o.a.d. */ \
|
|
{0x00000470, "\x65\x00\x64\x00\x20\x00\x69\x00"}, /* e.d. .i. */ \
|
|
{0x00000478, "\x6d\x00\x61\x00\x67\x00\x65\x00"}, /* m.a.g.e. */ \
|
|
{0x00000480, "\x20\x00\x70\x00\x72\x00\x6f\x00"}, /* .p.r.o. */ \
|
|
{0x00000488, "\x74\x00\x6f\x00\x63\x00\x6f\x00"}, /* t.o.c.o. */ \
|
|
{0x00000490, "\x6c\x00\x20\x00\x6d\x00\x69\x00"}, /* l. .m.i. */ \
|
|
{0x00000498, "\x73\x00\x73\x00\x69\x00\x6e\x00"}, /* s.s.i.n. */ \
|
|
{0x000004a0, "\x67\x00\x0a\x00\x00\x00\x00\x00"}, /* g....... */ \
|
|
{0x000004a8, "\x53\x00\x55\x00\x43\x00\x43\x00"}, /* S.U.C.C. */ \
|
|
{0x000004b0, "\x45\x00\x53\x00\x53\x00\x00\x00"}, /* E.S.S... */ \
|
|
{0x000004c0, "\x10\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x000004d0, "\x04\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x000004d8, "\xb0\x20\x00\x00\x00\x00\x00\x00"}, /* . ...... */ \
|
|
{0x000004e0, "\xf5\xfe\xff\x6f\x00\x00\x00\x00"}, /* ...o.... */ \
|
|
{0x000004e8, "\x48\x21\x00\x00\x00\x00\x00\x00"}, /* H!...... */ \
|
|
{0x000004f0, "\x05\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x000004f8, "\x00\x20\x00\x00\x00\x00\x00\x00"}, /* . ...... */ \
|
|
{0x00000500, "\x06\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00000508, "\x00\x10\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00000510, "\x0a\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00000518, "\xaa\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00000520, "\x0b\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00000528, "\x18\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00000530, "\x07\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00000540, "\x08\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00000550, "\x09\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00000558, "\x18\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00000560, "\x1e\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00000568, "\x02\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x000005d0, "\xa1\x31\x1b\x5b\x62\x95\xd2\x11"}, /* .1.[b... */ \
|
|
{0x000005d8, "\x8e\x3f\x00\xa0\xc9\x69\x72\x3b"}, /* .?...ir; */ \
|
|
{0x000005e0, "\xc0\x04\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00001018, "\x00\x00\x00\x00\x03\x00\x01\x00"}, /* ........ */ \
|
|
{0x00001030, "\x42\x00\x00\x00\x12\x00\x01\x00"}, /* B....... */ \
|
|
{0x00001038, "\x8a\x03\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00001040, "\x02\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00001048, "\x73\x00\x00\x00\x10\x00\x01\x00"}, /* s....... */ \
|
|
{0x00001060, "\x3b\x00\x00\x00\x12\x00\x01\x00"}, /* ;....... */ \
|
|
{0x00001068, "\x78\x03\x00\x00\x00\x00\x00\x00"}, /* x....... */ \
|
|
{0x00001070, "\x12\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00001078, "\x96\x00\x00\x00\x10\x00\x03\x00"}, /* ........ */ \
|
|
{0x00001080, "\xf0\x05\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00001090, "\x1b\x00\x00\x00\x12\x00\x01\x00"}, /* ........ */ \
|
|
{0x00001098, "\xa2\x02\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x000010a0, "\x6a\x00\x00\x00\x00\x00\x00\x00"}, /* j....... */ \
|
|
{0x000010a8, "\x25\x00\x00\x00\x12\x00\x01\x00"}, /* %....... */ \
|
|
{0x000010b0, "\x0c\x03\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x000010b8, "\x26\x00\x00\x00\x00\x00\x00\x00"}, /* &....... */ \
|
|
{0x000010c0, "\x14\x00\x00\x00\x10\x00\x03\x00"}, /* ........ */ \
|
|
{0x000010c8, "\xf0\x05\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x000010d8, "\x5b\x00\x00\x00\x12\x00\x01\x00"}, /* [....... */ \
|
|
{0x000010e0, "\x8c\x03\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x000010e8, "\x02\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x000010f0, "\x9f\x00\x00\x00\x10\x00\x03\x00"}, /* ........ */ \
|
|
{0x000010f8, "\x30\x01\x00\x00\x00\x00\x00\x00"}, /* 0....... */ \
|
|
{0x00001108, "\x79\x00\x00\x00\x10\x00\x01\x00"}, /* y....... */ \
|
|
{0x00001110, "\xc0\x04\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00001120, "\x2c\x00\x00\x00\x12\x00\x01\x00"}, /* ,....... */ \
|
|
{0x00001128, "\x32\x03\x00\x00\x00\x00\x00\x00"}, /* 2....... */ \
|
|
{0x00001130, "\x42\x00\x00\x00\x00\x00\x00\x00"}, /* B....... */ \
|
|
{0x00001138, "\x01\x00\x00\x00\x12\x00\x01\x00"}, /* ........ */ \
|
|
{0x00001140, "\x34\x02\x00\x00\x00\x00\x00\x00"}, /* 4....... */ \
|
|
{0x00001148, "\x6e\x00\x00\x00\x00\x00\x00\x00"}, /* n....... */ \
|
|
{0x00001150, "\x91\x00\x00\x00\x10\x00\x03\x00"}, /* ........ */ \
|
|
{0x00001158, "\xf0\x05\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00001168, "\x0a\x00\x00\x00\x10\x00\x01\x00"}, /* ........ */ \
|
|
{0x00001180, "\x80\x00\x00\x00\x10\x00\xf1\xff"}, /* ........ */ \
|
|
{0x00001188, "\xc0\x04\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x00001198, "\x34\x00\x00\x00\x12\x00\x01\x00"}, /* 4....... */ \
|
|
{0x000011a0, "\x74\x03\x00\x00\x00\x00\x00\x00"}, /* t....... */ \
|
|
{0x000011a8, "\x04\x00\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0x000011b0, "\x8b\x00\x00\x00\x10\x00\x03\x00"}, /* ........ */ \
|
|
{0x000011b8, "\xd0\x05\x00\x00\x00\x00\x00\x00"}, /* ........ */ \
|
|
{0, NULL} } }
|