~ubuntu-branches/ubuntu/precise/postgresql-9.1/precise-security

« back to all changes in this revision

Viewing changes to contrib/pgcrypto/sql/pgp-compression.sql

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--
 
2
-- PGP compression support
 
3
--
 
4
 
 
5
select pgp_sym_decrypt(dearmor('
 
6
-----BEGIN PGP MESSAGE-----
 
7
 
 
8
ww0ECQMCsci6AdHnELlh0kQB4jFcVwHMJg0Bulop7m3Mi36s15TAhBo0AnzIrRFrdLVCkKohsS6+
 
9
DMcmR53SXfLoDJOv/M8uKj3QSq7oWNIp95pxfA==
 
10
=tbSn
 
11
-----END PGP MESSAGE-----
 
12
'), 'key', 'expect-compress-algo=1');
 
13
 
 
14
select pgp_sym_decrypt(
 
15
        pgp_sym_encrypt('Secret message', 'key', 'compress-algo=0'),
 
16
        'key', 'expect-compress-algo=0');
 
17
 
 
18
select pgp_sym_decrypt(
 
19
        pgp_sym_encrypt('Secret message', 'key', 'compress-algo=1'),
 
20
        'key', 'expect-compress-algo=1');
 
21
 
 
22
select pgp_sym_decrypt(
 
23
        pgp_sym_encrypt('Secret message', 'key', 'compress-algo=2'),
 
24
        'key', 'expect-compress-algo=2');
 
25
 
 
26
-- level=0 should turn compression off
 
27
select pgp_sym_decrypt(
 
28
        pgp_sym_encrypt('Secret message', 'key',
 
29
                        'compress-algo=2, compress-level=0'),
 
30
        'key', 'expect-compress-algo=0');