6 msgMoving from PGP to GPG
1 msgpassphrase doesn't work?
1 msgwhy do not 'gpgme-1.1.4/tests/gpg/t-decrypt.c' ...
1 msgImporting GnuPG (v1.48 on Win32) Keys into IBMp...

/dev/tty problem and other questions
\ Christoph Anton Mitterer (19 Feb 2008)
. \ Rudolf Deilmann (19 Feb 2008)

1 msga pgpme error
4 msgCannot Set the Expiration Date on Secure Subkeys
2 msgpinentry stdin problems
4 msgQ about verifying sig's
5 msgpgp servers hanging
3 msgMultiple users of GPG
1 msgSPOJ signature - may be offtopic
2 msgNew to GnuPG and OpenGPG
1 msgusing a key server with gpgme
1 msg[Announce] Libksba 1.0.3 released
4 msgneed example of passing clear text to gpg from ...
4 msgAuthenticate capability of DSA or RSA signing keys
21 msgAre DSA2 signing keys backwards compatible?
2 msgSigning Multiple Files
28 msgCorporate use of gnupg
Subject:Re: /dev/tty problem and other questions
Group:Gnupg-users
From:Rudolf Deilmann
Date:19 Feb 2008


 
Am Tue, 19 Feb 2008 13:00:51 +0100
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