Closed osresearch closed 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.
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.
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.
This patch adds an argument for
--label
to change the machine name fromTPM2-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.