d-e-s-o / nitrocli

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

Refactor status to avoid unnecessary commands #174

Closed robinkrahl closed 3 years ago

robinkrahl commented 3 years ago

I wrote the first version of the current status command when I was not too familiar with libnitrokey inner workings. This resulted in a combinaton of funtions that requires more command invocations than necessary. With this patch, we can reduce the number of command invocations from three to one GetStatus commands for the Nitrokey Pro and from six to two GetDeviceStatus commands for the Nitrokey Storage.

Once a minor issue in nitrokey-rs [0] is fixed, we can further reduce the Nitrokey Storage case to a single GetDeviceStatus invocation.

[0] https://todo.sr.ht/~ireas/nitrokey-rs/1

d-e-s-o commented 3 years ago

Good stuff! Merged. Thanks Robin!