pgcrypto pgp_pub_decrypt() fails with secret key password

Поиск
Список
Период
Сортировка
От Eric Lukather
Тема pgcrypto pgp_pub_decrypt() fails with secret key password
Дата
Msg-id 917399.19825.qm@web55701.mail.re3.yahoo.com
обсуждение исходный текст
Список pgsql-general
Hi,

I have pgcrypto working fine with gpg keys that do *not* have a passphrase. But,
if I try the exact same gpg -a --export commands and application code with gpg
keys that are generated *with* a passphrase, then I get the following
pgp_pub_decrypt() error within psql:

\set pubkey '''' `sed -e "s/'/''/g" -e 's/\\n/\\r\\n/g' -e 's/\\/\\\\/g' <
test-public.key` ''''
\set prvkey '''' `sed -e "s/'/''/g" -e 's/\\n/\\r\\n/g' -e 's/\\/\\\\/g' <
test-secret.key` ''''
SELECT pgp_pub_decrypt( dearmor( (SELECT armor((SELECT pgp_pub_encrypt('mypass',
dearmor(:pubkey))))) ), dearmor(:prvkey), 'test' );
ERROR:  Corrupt data

Here are my versions:

PostgreSQL version: 8.4.4
GPG version: 1.4.10
(both were built with OpenSSL support)

I've verified my SQL code via psql and I feel pretty confident it's OK, since I
have it narrowed down to where the only difference is whether the gpg exported
keys were originally assigned with a passphrase, or not assigned a passphrase
(just press enter when prompted), when running "gpg --gen-key".

Any troubleshooting help or suggestions would be greatly appreciated!

Thanks, -Eric






В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: why can't see the updated value after SPI_execute("update ....", false, 1);
Следующее
От: Casey Jones
Дата:
Сообщение: Re: Huge amount of memory errors with libpq