Skip to content

Commit

Permalink
read: print byte as 2-digit hex
Browse files Browse the repository at this point in the history
This is a minor formatting improvement.

Before:

```bash
$ tmtool-aarch64 --key-slot 0xe0e8 read
~~ TrustM initinialised
~~ Key at slot 0xe0e8
[e2, b, 5, c4, f7, 97, 40, 1, f7, 64, 8f, ff, 38, 41, 5, a1, 85, 89, af, c3, ca, 56, d5, 96, 57, 75, 4c, 42, 14, 9, 8f, 7f, 80, 84, bb, 6c, d0, 92, 52, 37, 4e, 81, b1, 22, 6a, 26, cd, 23, 85, 55, 88, 87, 58, 9b, 79, f9, 11, 8c, ec, 6f, 4, cb, bd, 63]
```

After:

```bash
$ tmtool-aarch64 --key-slot 0xe0e8 read
~~ TrustM initinialised
~~ Key at slot 0xe0e8
[e2, 0b, 05, c4, f7, 97, 40, 01, f7, 64, 8f, ff, 38, 41, 05, a1, 85, 89, af, c3, ca, 56, d5, 96, 57, 75, 4c, 42, 14, 09, 8f, 7f, 80, 84, bb, 6c, d0, 92, 52, 37, 4e, 81, b1, 22, 6a, 26, cd, 23, 85, 55, 88, 87, 58, 9b, 79, f9, 11, 8c, ec, 6f, 04, cb, bd, 63]
```
  • Loading branch information
syncom committed Feb 26, 2025
1 parent 8615ec4 commit 7998537
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub fn read(device: String, slot: u16, raw: bool) -> Result<()> {

let pk = &pk[9..73];
eprintln!("~~ Key at slot {:#04x}", slot);
eprintln!("{:x?}", pk);
eprintln!("{:02x?}", pk);

if raw {
std::io::stdout().write_all(pk)?;
Expand Down

0 comments on commit 7998537

Please sign in to comment.