d-e-s-o / nitrocli

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

Support reading PWS passwords from stdin #163

Closed robinkrahl closed 3 years ago

robinkrahl commented 3 years ago

Specifying passwords as command-line arguments can be problematic: The user has to be careful that the command is not recorded in the shell history. Also, the password might be exposed over the process list.

This patch adds an alternative input method for the pws add and pws update methods: reading the password from stdin. This is activated by setting the password to "-". For the tests, we use a string as a simulated stdin buffer.


This patch is part of the PWS interface refactoring discussed in #139 and is based on #162.

d-e-s-o commented 3 years ago

Very nice change. Thanks Robin! Merged.