decryption failed: secret key not available
5468696A6D656E
thijmen@xs4all.nl
Tue Apr 22 22:01:02 2003
On Tue, Apr 22, 2003 at 07:44:10PM +0200, 5468696A6D656E wrote:
> On Tue, Apr 22, 2003 at 11:04:50AM -0400, Jacques Dejean wrote:
> > # echo '$PGPPASS' | gpg -v -v --passphrase-fd 0 --no-default-keyring -r
> try this:
> echo $PGPPASS| gpg -v -v --passphrase-fd 0 --no-default-keyring -r
>
> note that the pipe sign ("|") is directly behind the passphrase.
To test this kind of output i made this tiny program:
//stdincheck.c
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
char buffer[1024];
int size;
fgets(buffer, 1024, stdin);
size = strlen(buffer);
if (size > 0 && buffer[size - 1] == '\n')
{
printf("stripping linefeed\r\n");
buffer[size - 1] = '\0';
}
if (size > 1 && buffer[size - 2] == '\r')
{
printf("stripping carriage return\r\n");
buffer[size - 2] = '\0';
}
printf("Passphrase (quoted): \"%s\"\r\n", buffer);
}
On windows 98 SE this is the output:
T:\stdincheck\Debug>echo blaa|stdincheck.exe
stripping linefeed
Passphrase (quoted): "blaa"
T:\stdincheck\Debug>echo blaa | stdincheck.exe
stripping linefeed
Passphrase (quoted): "blaa "
T:\stdincheck\Debug>echo "blaa" | stdincheck.exe
stripping linefeed
Passphrase (quoted): ""blaa" "
See the differences? As Gpg cannot know whether a quote character
is part of the passphrase you need to send it unquoted, and
without any space before the | pipesign.
Th.
--
__Thijmen Klok________