swtpm: Display tpmstate-opt-lock as a new capability

Display the new capability tpmstate-opt-lock, adjust test cases,
and document it in the swptm man page.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2024-10-14 16:13:12 -04:00 committed by Stefan Berger
parent 1d17d09158
commit 38aa3d972c
4 changed files with 11 additions and 3 deletions

View File

@ -346,6 +346,7 @@ may contain the following:
"cmdarg-print-profiles",
"profile-opt-remove-disabled",
"cmdarg-print-info",
"tpmstate-opt-lock"
],
"version": "0.7.0"
}
@ -438,6 +439,10 @@ parameter.
The option I<--print-info> is supported.
=item B<tpmstate-opt-lock> (since v0.10)
The option parameter I<lock> for the I<--tpmstate> option is supported.
=back
=item B<--print-states> (since v0.7)

View File

@ -270,7 +270,7 @@ int capabilities_print_json(bool cusetpm, TPMLIB_TPMVersion tpmversion)
"{ "
"\"type\": \"swtpm\", "
"\"features\": [ "
"%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"
"%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"
" ], "
"\"profiles\": { %s}, "
"\"version\": \"" VERSION "\" "
@ -294,6 +294,7 @@ int capabilities_print_json(bool cusetpm, TPMLIB_TPMVersion tpmversion)
true ? ", \"cmdarg-print-profiles\"" : "",
true ? ", \"profile-opt-remove-disabled\"" : "",
true ? ", \"cmdarg-print-info\"" : "",
true ? ", \"tpmstate-opt-lock\"" : "",
profiles ? profiles : ""
);

View File

@ -29,7 +29,8 @@ exp='\{ "type": "swtpm", '\
'"flags-opt-disable-auto-shutdown", "ctrl-opt-terminate", '${seccomp}'"cmdarg-key-fd", '\
'"cmdarg-pwd-fd", "cmdarg-print-states", "cmdarg-chroot", "cmdarg-migration", '\
'"nvram-backend-dir", "nvram-backend-file", "cmdarg-profile", '\
'"cmdarg-print-profiles", "profile-opt-remove-disabled", "cmdarg-print-info" \], '\
'"cmdarg-print-profiles", "profile-opt-remove-disabled", "cmdarg-print-info", '\
'"tpmstate-opt-lock" \], '\
'"profiles": \{ \}, '\
'"version": "[^"]*" \}'
if ! [[ ${msg} =~ ${exp} ]]; then

View File

@ -31,7 +31,8 @@ exp='\{ "type": "swtpm", '\
'"cmdarg-pwd-fd", "cmdarg-print-states", "cmdarg-chroot", "cmdarg-migration", '\
'"nvram-backend-dir", "nvram-backend-file"'\
'(, "rsa-keysize-1024")?(, "rsa-keysize-2048")?(, "rsa-keysize-3072")?, "cmdarg-profile", '\
'"cmdarg-print-profiles", "profile-opt-remove-disabled", "cmdarg-print-info" \], '\
'"cmdarg-print-profiles", "profile-opt-remove-disabled", "cmdarg-print-info", '\
'"tpmstate-opt-lock" \], '\
'"profiles": \{ "names": \[ [^]]*\], "algorithms": \{ [^\}]*\}, "commands": \{ [^\}]*\} }, '\
'"version": "[^"]*" \}'
if ! [[ ${msg} =~ ${exp} ]]; then