xaionaro-go / trezorCipherKeyValue

A pipeline utility to encrypt/decrypt a key by a "Trezor One" device using "CipheredKeyValue" function
GNU General Public License v3.0
3 stars 1 forks source link

trezorCipherKeyValue and systemd-ask-password #2

Closed pontostroy closed 5 years ago

pontostroy commented 6 years ago

Looks like systemd-ask-password does not work

echo luks | /home/pontostroy/GO/GOPATH/bin/trezorCipherKeyValue -p "/usr/bin/systemd-ask-password" -e -k luks

Password entry required for 'PIN' (PID 7541). Please enter password with the systemd-tty-ask-password-agent tool! 3443 82987694 70741

I can't entered my pin, pressing the ernter button leads to a new line.

xaionaro commented 5 years ago

First of all, systemd-ask-password answered:

Please enter password with the systemd-tty-ask-password-agent tool!

it means that systemd-ask-password expects you to run systemd-tty-ask-password-agent tool and enter the password there.

The second you're trying to pass both key and passphrase via one stdin. I don't understand how to implement this correctly on the utility side (to understand which of the stdin data is for what), so you should use one of this options:

The third, yes: systemd-ask-password requires a terminal (what wasn't implemented earlier), fixed. Should work if you consider the first two problems above.

An example:

TREZOR_CIPHER_VALUE=luks `go env GOPATH`/bin/trezorCipherKeyValue -e -k luks