268
268
-- check BUG #11905, problem with messages 6 less than a power of 2.
269
269
select pgp_sym_decrypt(pgp_sym_encrypt(repeat('x',65530),'1'),'1') = repeat('x',65530);
270
270
-- expected: true
275
-- Decryption with a certain incorrect key yields an apparent Literal Data
276
-- packet reporting its content to be binary data. Ciphertext source:
277
-- iterative pgp_sym_encrypt('secret', 'key') until the random prefix gave
278
-- rise to that property.
279
select pgp_sym_decrypt(dearmor('
280
-----BEGIN PGP MESSAGE-----
282
ww0EBwMCxf8PTrQBmJdl0jcB6y2joE7GSLKRv7trbNsF5Z8ou5NISLUg31llVH/S0B2wl4bvzZjV
285
-----END PGP MESSAGE-----
286
'), 'wrong-key', 'debug=1');
288
-- Routine text/binary mismatch.
289
select pgp_sym_decrypt(pgp_sym_encrypt_bytea('P', 'key'), 'key', 'debug=1');
291
-- Decryption with a certain incorrect key yields an apparent BZip2-compressed
292
-- plaintext. Ciphertext source: iterative pgp_sym_encrypt('secret', 'key')
293
-- until the random prefix gave rise to that property.
294
select pgp_sym_decrypt(dearmor('
295
-----BEGIN PGP MESSAGE-----
297
ww0EBwMC9rK/dMkF5Zlt0jcBlzAQ1mQY2qYbKYbw8h3EZ5Jk0K2IiY92R82TRhWzBIF/8cmXDPtP
300
-----END PGP MESSAGE-----
301
'), 'wrong-key', 'debug=1');
303
-- Routine use of BZip2 compression. Ciphertext source:
304
-- echo x | gpg --homedir /nonexistent --personal-compress-preferences bzip2 \
305
-- --personal-cipher-preferences aes --no-emit-version --batch \
306
-- --symmetric --passphrase key --armor
307
select pgp_sym_decrypt(dearmor('
308
-----BEGIN PGP MESSAGE-----
310
jA0EBwMCRhFrAKNcLVJg0mMBLJG1cCASNk/x/3dt1zJ+2eo7jHfjgg3N6wpB3XIe
311
QCwkWJwlBG5pzbO5gu7xuPQN+TbPJ7aQ2sLx3bAHhtYb0i3vV9RO10Gw++yUyd4R
312
UCAAw2JRIISttRHMfDpDuZJpvYo=
314
-----END PGP MESSAGE-----
315
'), 'key', 'debug=1');