libtpms/tests
Stefan Berger 712ab4d531 tpm2: Filter-out commands by given maximum StateFormatLevel
When the user passes no command profile, then the default command profile
of the (custom) profile will be used. If the user limits the
StateFormatLevel by setting it in the profile, then all those commands from
the default command profile that exceed the given StateFormatLevel have to
be filtered-out to avoid a rejection of the command profile. Therefore, add
a parameter to indicate that filtering of commands should be done and
return a new string with the enabled command codes if any command was
filtered-out.

Add a test case that demonstrates the filtering-out of commands 0x199 and
0x19a (from the default command profile) due to the choice of
StateFormatLevel '2'. Both command codes were enable in StateFormatLevel
'3'.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2026-02-23 10:49:28 -05:00
..
corpus-execute-command tpm2: Intercept unsupported external and permanent NV indices 2024-07-19 16:04:10 -04:00
base64decode.c tests: Initialize len_cmp to 0 so it has an assigned value 2024-11-11 17:11:19 -05:00
base64decode.sh tests: run a lot less tests in base64decode.sh 2019-05-07 16:01:48 -04:00
common tpm2 + test: Make it compilable on Debian GNU Hurd 2025-04-28 12:16:21 -04:00
freebl_sha1flattensize.c tests: Add license identifier to test cases 2022-07-12 11:30:53 -04:00
fuzz-main.c fuzz: better oss-fuzz integration 2019-04-01 11:22:03 -04:00
fuzz.cc tests: fuzz: Store initialized permall state blob 2021-07-22 22:23:16 -04:00
fuzz.sh tests: Restrict number of command line parameters to fuzz 2019-05-07 16:01:48 -04:00
Makefile.am tpm2: Adopt the directory structure of upstream code repo 2026-02-13 09:59:26 -05:00
nvram_offsets.c tpm2: Enable support for 4096 bit RSA keys (with fixes) 2025-05-07 12:23:44 -04:00
object_size.c tests: Properly fill-out data structure for stricter marshalling to work 2026-02-19 21:41:38 -05:00
oss-fuzz.sh tests: oss-fuzz.sh: Append -fno-sanitize=bounds to CFLAGS 2024-01-15 14:53:19 -05:00
run-fuzzer.sh build-sys: don't tweak LD_LIBRARY_PATH 2019-04-16 07:17:53 -04:00
tpm2_createprimary.c tests: Add license identifier to test cases 2022-07-12 11:30:53 -04:00
tpm2_createprimary.sh tests: Refactor repetitive test scripts to use one common script 2023-03-02 09:32:38 -05:00
tpm2_cve-2023-1017.c tests: Initialize cmd with NULL at top of function 2024-11-11 17:11:19 -05:00
tpm2_cve-2023-1017.sh tests: Add test cases for CVE-2023-1017 and CVE-2023-1018 2023-03-02 09:32:38 -05:00
tpm2_cve-2023-1018.c tests: Add test cases for CVE-2023-1017 and CVE-2023-1018 2023-03-02 09:32:38 -05:00
tpm2_cve-2023-1018.sh tests: Add test cases for CVE-2023-1017 and CVE-2023-1018 2023-03-02 09:32:38 -05:00
tpm2_pcr_read.c tests: Add license identifier to test cases 2022-07-12 11:30:53 -04:00
tpm2_pcr_read.sh tests: Refactor repetitive test scripts to use one common script 2023-03-02 09:32:38 -05:00
tpm2_run_test.sh tests: Refactor repetitive test scripts to use one common script 2023-03-02 09:32:38 -05:00
tpm2_selftest.c tests: Add license identifier to test cases 2022-07-12 11:30:53 -04:00
tpm2_selftest.sh tests: Refactor repetitive test scripts to use one common script 2023-03-02 09:32:38 -05:00
tpm2_setprofile.c tpm2: Filter-out commands by given maximum StateFormatLevel 2026-02-23 10:49:28 -05:00
tpm2_setprofile.sh tests: Add test case for TPMLIB_SetProfile() 2024-07-15 11:51:38 -04:00