Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite94dd6a

Browse files
committed
Add missing pgcrypto files from previous commit.
1 parent42e7b0f commite94dd6a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+10539
-0
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
--
2+
-- PGP Armor
3+
--
4+
select armor('');
5+
armor
6+
---------------------------------------------------------------
7+
-----BEGIN PGP MESSAGE-----
8+
9+
=twTO
10+
-----END PGP MESSAGE-----
11+
12+
(1 row)
13+
14+
select armor('test');
15+
armor
16+
------------------------------------------------------------------------
17+
-----BEGIN PGP MESSAGE-----
18+
19+
dGVzdA==
20+
=+G7Q
21+
-----END PGP MESSAGE-----
22+
23+
(1 row)
24+
25+
select dearmor(armor(''));
26+
dearmor
27+
---------
28+
29+
(1 row)
30+
31+
select dearmor(armor('zooka'));
32+
dearmor
33+
---------
34+
zooka
35+
(1 row)
36+
37+
select armor('0123456789abcdef0123456789abcdef0123456789abcdef
38+
0123456789abcdef0123456789abcdef0123456789abcdef');
39+
armor
40+
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
41+
-----BEGIN PGP MESSAGE-----
42+
43+
MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWYwMTIzNDU2Nzg5YWJjZGVmCjAxMjM0NTY3
44+
ODlhYmNkZWYwMTIzNDU2Nzg5YWJjZGVmMDEyMzQ1Njc4OWFiY2RlZg==
45+
=JFw5
46+
-----END PGP MESSAGE-----
47+
48+
(1 row)
49+
50+
-- lots formatting
51+
select dearmor(' a pgp msg:
52+
53+
-----BEGIN PGP MESSAGE-----
54+
Comment: Some junk
55+
56+
em9va2E=
57+
58+
=D5cR
59+
60+
-----END PGP MESSAGE-----');
61+
dearmor
62+
---------
63+
zooka
64+
(1 row)
65+
66+
-- lots messages
67+
select dearmor('
68+
wrong packet:
69+
-----BEGIN PGP MESSAGE-----
70+
71+
d3Jvbmc=
72+
=vCYP
73+
-----END PGP MESSAGE-----
74+
75+
right packet:
76+
-----BEGIN PGP MESSAGE-----
77+
78+
cmlnaHQ=
79+
=nbpj
80+
-----END PGP MESSAGE-----
81+
82+
use only first packet
83+
-----BEGIN PGP MESSAGE-----
84+
85+
d3Jvbmc=
86+
=vCYP
87+
-----END PGP MESSAGE-----
88+
');
89+
dearmor
90+
---------
91+
right
92+
(1 row)
93+
94+
-- bad crc
95+
select dearmor('
96+
-----BEGIN PGP MESSAGE-----
97+
98+
em9va2E=
99+
=ZZZZ
100+
-----END PGP MESSAGE-----
101+
');
102+
ERROR: dearmor: Corrupt ascii-armor
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
--
2+
-- PGP compression support
3+
--
4+
select pgp_sym_decrypt(dearmor('
5+
-----BEGIN PGP MESSAGE-----
6+
7+
ww0ECQMCsci6AdHnELlh0kQB4jFcVwHMJg0Bulop7m3Mi36s15TAhBo0AnzIrRFrdLVCkKohsS6+
8+
DMcmR53SXfLoDJOv/M8uKj3QSq7oWNIp95pxfA==
9+
=tbSn
10+
-----END PGP MESSAGE-----
11+
'), 'key', 'expect-compress-algo=1');
12+
pgp_sym_decrypt
13+
-----------------
14+
Secret message
15+
(1 row)
16+
17+
select pgp_sym_decrypt(
18+
pgp_sym_encrypt('Secret message', 'key', 'compress-algo=0'),
19+
'key', 'expect-compress-algo=0');
20+
pgp_sym_decrypt
21+
-----------------
22+
Secret message
23+
(1 row)
24+
25+
select pgp_sym_decrypt(
26+
pgp_sym_encrypt('Secret message', 'key', 'compress-algo=1'),
27+
'key', 'expect-compress-algo=1');
28+
pgp_sym_decrypt
29+
-----------------
30+
Secret message
31+
(1 row)
32+
33+
select pgp_sym_decrypt(
34+
pgp_sym_encrypt('Secret message', 'key', 'compress-algo=2'),
35+
'key', 'expect-compress-algo=2');
36+
pgp_sym_decrypt
37+
-----------------
38+
Secret message
39+
(1 row)
40+
41+
-- level=0 should turn compression off
42+
select pgp_sym_decrypt(
43+
pgp_sym_encrypt('Secret message', 'key',
44+
'compress-algo=2, compress-level=0'),
45+
'key', 'expect-compress-algo=0');
46+
pgp_sym_decrypt
47+
-----------------
48+
Secret message
49+
(1 row)
50+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp