tpm2-software / tpm2-totp

Attest the trustworthiness of a device against a human using time-based one-time passwords
https://tpm2-software.github.io
BSD 3-Clause "New" or "Revised" License
164 stars 37 forks source link

Include hostname and use 1/4 size unicode block characters #67

Closed osresearch closed 4 years ago

osresearch commented 4 years ago

This patch adds an argument for --label to change the machine name from TPM2-TOTP to whatever the user wants. If you have multiple machines used with totp, it's nice to know which is which.

It also replaces the ANSI escape sequences with unicode block drawings that pack 4 bits in a single character, so the entire QR code fits on a single terminal window more easily.

There is also a small tweak to directly link libtpm2-totp.c into the binaries, which makes it easier to include in some systems.

diabonas commented 4 years ago

Are you planning on picking up the work on this regarding making Unicode output optional? If not or if that takes a bit longer (which is totally fine, of course!), I suggest splitting out e4525307df3e92dcc5212a2b3090b31037753d53 into a separate PR since that one is ready to merge as is.

osresearch commented 4 years ago

I ended up on a deep rabbit hole of character encodings and never found a solution that worked reliably on the different terminal types. So I'll split out the hostname change since that is self contained.

diabonas commented 4 years ago

I have cherry-picked the --label argument (commit e4525307df3e92dcc5212a2b3090b31037753d53) to the master branch in order to be able to include it in the next release.

Since the Unicode output does not work on all terminals and there has been no progress on making it conditional in this PR for a while, I am closing it for now. Feel free to reopen or create a new PR if you pick up work on this.