Skip to content

Commit

Permalink
docs: status sub-command
Browse files Browse the repository at this point in the history
Signed-off-by: Oskar Kohout <oskar@evilbit.at>
  • Loading branch information
EvilBit committed Jul 21, 2021
1 parent fd44b03 commit 8f7e37c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
```
Expand All @@ -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
Expand Down
17 changes: 15 additions & 2 deletions man/tpm2-totp.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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`
Expand Down Expand Up @@ -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:
```
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/tpm2-totp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8f7e37c

Please sign in to comment.