Skip to content

Commit

Permalink
swtpm: Add flags-opt-recreate-svn-base-secret capability
Browse files Browse the repository at this point in the history
Update test case checking for --tpm2 capabilities.

Signed-off-by: Stefan Berger <[email protected]>
  • Loading branch information
stefanberger committed Oct 28, 2024
1 parent 94bb06a commit 9746c16
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
7 changes: 6 additions & 1 deletion man/man8/swtpm.pod
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ may contain the following:
"cmdarg-print-profiles",
"profile-opt-remove-disabled",
"cmdarg-print-info",
"tpmstate-opt-lock"
"tpmstate-opt-lock",
"flags-opt-recreate-svn-base-secret"
],
"version": "0.7.0"
}
Expand Down Expand Up @@ -448,6 +449,10 @@ The option I<--print-info> is supported.

The option parameter I<lock> for the I<--tpmstate> option is supported.

=item B<flags-opt-recreate-svn-base-secret> (since v0.10)

The I<--flags> option supports the I<recreate-svn-base-secret> flag.

=back

=item B<--print-states> (since v0.7)
Expand Down
3 changes: 2 additions & 1 deletion src/swtpm/capabilities.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,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%s%s"
" ], "
"\"profiles\": { %s}, "
"\"version\": \"" VERSION "\" "
Expand All @@ -296,6 +296,7 @@ int capabilities_print_json(bool cusetpm, TPMLIB_TPMVersion tpmversion)
is_tpm2 ? ", \"profile-opt-remove-disabled\"" : "",
true ? ", \"cmdarg-print-info\"" : "",
true ? ", \"tpmstate-opt-lock\"" : "",
is_tpm2 ? ", \"flags-opt-recreate-svn-base-secret\"" : "",
profiles ? profiles : ""
);

Expand Down
2 changes: 1 addition & 1 deletion tests/_test_tpm2_print_capabilities
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exp='\{ "type": "swtpm", '\
'"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", '\
'"tpmstate-opt-lock" \], '\
'"tpmstate-opt-lock", "flags-opt-recreate-svn-base-secret" \], '\
'"profiles": \{ "names": \[ [^]]*\], "algorithms": \{ [^\}]*\}, "commands": \{ [^\}]*\} }, '\
'"version": "[^"]*" \}'
if ! [[ ${msg} =~ ${exp} ]]; then
Expand Down

0 comments on commit 9746c16

Please sign in to comment.