d-e-s-o / nitrocli

A command line tool for interacting with Nitrokey devices.
30 stars 10 forks source link

Fix cache ID for pinentry calls #145

Closed robinkrahl closed 3 years ago

robinkrahl commented 3 years ago

Since nitrokey-rs v0.8.0 added support for the Librem Key, the Display implementation for nitrokey::Model may include a space, for example "Nitrokey Pro" (instead of "Pro"). I missed that we used this string representation to generate the pinentry cache ID, leading to an additional space in the GnuPG GET_PASSPHRASE call. This messed up the error message, prompt and description arguments that come after the cache ID.

With this patch, we use a hard-coded string for the cache IDs instead of nitrokey::Model’s Display implementation.

d-e-s-o commented 3 years ago

Fabulous stuff! I've seen that issue a bunch of times myself, but had not investigated yet. Merged.