diff --git a/README.md b/README.md index b832ddf..46d9230 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,14 @@ tpm2-totp -P verysecret reseal tpm2-totp -P verysecret -p 1,3,5,6 reseal ``` +## Status +Check enrollment status: +``` +tpm2-totp status +``` +Tip: try piping the output to e.g. `bat -l yaml -pp` for nice syntax +highlighting or to `yq` for YAML processing. + ## Deletion In order to delete the created NV index: ``` @@ -111,6 +119,7 @@ tpm2-totp -N 0x01800001 -P verysecret generate tpm2-totp -N 0x01800001 calculate tpm2-totp -N 0x01800001 -P verysecret recover tpm2-totp -N 0x01800001 -P verysecret reseal +tpm2-totp -N 0x01800001 status ``` # Limitations diff --git a/man/tpm2-totp.1.md b/man/tpm2-totp.1.md index f232b28..061c9b3 100644 --- a/man/tpm2-totp.1.md +++ b/man/tpm2-totp.1.md @@ -17,8 +17,8 @@ was not altered during his/her abscense and thus still trustworthy. # ARGUMENTS -The `tpm2-totp` command expects one of five command and provides a set of -options. +The `tpm2-totp` command expects one of the following commands and provides a +set of options. ## COMMANDS @@ -30,6 +30,10 @@ options. Calculate a TOTP value. Possible options: `-N`, `-t`, `-T` + * `status`: + Display enrollment status, PCRs, banks, etc., formatted as YAML. + Possible options: `-N` + * `reseal`: Reseal TOTP secret to new PCRs, banks or values. Possible options: `-b`, `-N`, `-p`, `-P` (required), `-T` @@ -113,6 +117,14 @@ tpm2-totp -P verysecret reseal tpm2-totp -P verysecret -p 1,3,5,6 reseal ``` +## Status +Check enrollment status: +``` +tpm2-totp status +``` +Tip: try piping the output to e.g. 'bat -l yaml -pp' for nice syntax +highlighting or to 'yq' for YAML processing. + ## Deletion In order to delete the created NV index: ``` @@ -127,6 +139,7 @@ tpm2-totp -N 0x01800001 -P verysecret generate tpm2-totp -N 0x01800001 calculate tpm2-totp -N 0x01800001 -P verysecret recover tpm2-totp -N 0x01800001 -P verysecret reseal +tpm2-totp -N 0x01800001 status ``` ## TCTI configuration diff --git a/src/tpm2-totp.c b/src/tpm2-totp.c index a805590..3b5dfda 100644 --- a/src/tpm2-totp.c +++ b/src/tpm2-totp.c @@ -460,8 +460,6 @@ main(int argc, char **argv) printf("%s%06" PRIu64, timestr, totp); break; case CMD_STATUS: - // TODO - /* NVRAM index */ const uint32_t nvindex = (opt.nvindex == 0 || opt.nvindex == DEFAULT_NV) ? DEFAULT_NV : opt.nvindex; printf("%-*s 0x%08X\n", FIELD_WIDTH, "NVRAM index:", nvindex);