| |||||||||||||||||||||||||||||||
|
schrieb Christoph Anton Mitterer <christoph.anton.mitterer>: > 1) When using a basic test-keyscript like > > #!/bin/sh > gpg --decrypt "$1" > > and I boot from the initramfs I'll get the following error: > gpg:cannot open /dev/tty: No such device or address. > and gpg doesn't offer a prompt to enter the passphares > > Of course I've googled around but I found no practical solution. > The --no-tty --pasphrase-fd 0 is not a solution as it will print the > password in cleartext. > > read -s only available in bash but not sh. > > > Any ideas here? a) copy stty to your initial ramdisk -- stty_orig=`stty -g </dev/console` echo "Enter password for ...." stty -echo </dev/console read PASS </dev/console stty $stty_orig </dev/console echo "$PASS" | gpg -d --passphrase-fd 0 .... -- b) copy bash to your initial ramdisk c) usplash_write (if avaiable) usplash_write "INPUTQUIET Enter password for ..." PASS="$(cat /dev/.initramfs/usplash_outfifo)" echo "$PASS" | gpg -d --passphrase-fd 0 .... > 4) As I cannot check the return value of gpg if the decryption > succeeded (the output from the keyscript is piped to cryptsetup) I > must have other means to check whether the decryption was successful. Do it in two steps? CRYPTSETUP_PASS=$(echo "$PASS" | gpg -d --passphrase-fd 0 ...) if [ "$?" -eq "0" ]; then echo "$CRYPTSETUP_PASS" | cryptsetup ...... .... _______________________________________________ Gnupg-users mailing list Gnupg-users http://lists.gnupg.org/mailman/listinfo/gnupg-users
| ||||||||||||||||||||||||||||||
© 2004-2008 readlist.com