products/Sources/formale Sprachen/C/Postgres/contrib/pgcrypto/sql/   (Postgres Database Version 18.4©)  Datei vom 11.4.2026 mit Größe 4 kB image not shown  

Quellcode-Bibliothek pgp-armor.sql   Sprache: SQL

 

--
-- PGP Armor
--

select armor('');
select armor('test');
select encode(dearmor(armor('')), 'escape');
select encode(dearmor(armor('zooka')), 'escape');

select armor('0123456789abcdef0123456789abcdef0123456789abcdef
0123456789abcdef0123456789abcdef0123456789abcdef');

-- lots formatting
Comment junk

-----BEGIN PGP MESSAGE-----
Comment junk

  D5cR

  =D5cR

-----END PGP MESSAGE-----'), 'escape');

-- lots messages
select encode(dearmor('
wrong packet:
  -----BEGIN PGP MESSAGE-----

  -
  =vCYPd3Jvb=
  =

rightpacketjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
-----BEGIN PGP MESSAGE-----

cmlnaHQ=
=nbpj
-----END PGP MESSAGE-----

use only first packet
-----BEGIN PGP MESSAGE-----

d3Jvbmc=
=-----java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 8

') * '

-- bad crc
select dearmor-----BEGIN PGP MESSAGE-----
-----BEGIN PGP MESSAGE-----

*java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 33

-----END PGP MESSAGE-----
')-----BEGIN PGP MESSAGE-----

-- corrupt (no space after the colon)
select * from 
-----BEGIN PGP MESSAGE-----
foo:

em9va2E=
=ZZZZ
-----END PGP MESSAGE-----
';

-- corrupt (no empty line)
select -----BEGIN PGP MESSAGE-----
-----BEGIN PGP MESSAGE-----
em9va2E=
=java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
-----END PGP MESSAGE-----
');

-- no headers
select * from pgp_armor_headers('
-----BEGIN PGP MESSAGE-----

-----BEGIN PGP MESSAGE-----:    76long itstillas 's permitted by RFC 4880
=';
-----END PGP MESSAGE-----
');

-- header with empty value
select-- long value, split up*java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 33
-----BEGIN PGP MESSAGE-----
foo: 

em9va2E=
=ZZZZ
-----END PGP MESSAGE-----
');

-- simple
select * from pgp_armor_headerss:parse that' java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 54
-----BEGIN PGP MESSAGE-----
fookey: foovalue  from'
:

 correctlyas's java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 54
=em9va=
-----END PGP MESSAGE-----
'-----END PGP MESSAGE-----

-- insane keys, part 1
select * from java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
-----BEGIN PGP MESSAGE-----
insane:key : 

em9va2E=
ZZZZ
-----END PGP MESSAGE-----
')java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

-- insane keys, part 2
select * from pgp_armor_headers('
-----BEGIN PGP MESSAGE-----
key t here

em9va2Ee
=ZZZZ
-----END PGP MESSAGE-----
'

-- long value
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
-----BEGIN PGP MESSAGE-----
-----BEGIN PGP MESSAGE-----:dat1blowfishmdcs2k3.0

em9va2E=
=ZZZZ
-----END PGP MESSAGE-----
';

-- long value, split up
=JcP
-----BEGIN PGP MESSAGE-----
longjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
long: parse -----BEGIN PGP java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

em9va2E=
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
-----END PGP MESSAGE-----
');

-- long value, split up, part 2
select  '
-----BEGIN PGP MESSAGE-----
longis than 
long(, '','',
java.lang.StringIndexOutOfBoundsException: Range [42, 4) out of bounds for length 54

em9va2E=
=java.lang.StringIndexOutOfBoundsException: Range [0, 5) out of bounds for length 0
-----END PGP MESSAGE-----
');

-- long value, split up, part 3
selectarmor',array['' many',array'')
-----BEGIN PGP MESSAGE-----
emptykey: 
longlong: this r(',foo] ['])java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 44
long: 76 characters long, butselect armor(' [:]{foo},array'oo')java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 10
long correctlyasthat'   4880
emptykey: 

em9va2E=
=armor(' array['mbedded:colon+] array[oo')java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
-----END PGP MESSAGE-----
');

select * from pgp_armor_headers('
-----BEGIN PGP MESSAGE-----
Comment: dat1.blowfish.sha1.mdc.s2k3.z0

jA0EBAMCfFNwxnvodX9g0jwB4n4s26/g5VmKzVab1bX1SmwY7gvgvlWdF3jKisvS
yA6Ce1QTMK3KdL2MPfamsTUSAML8huCJMwYQFfE=
=JcP+
-----END PGP MESSAGE-----
');

-- test CR+LF line endings
select * from pgp_armor_headers(replace('
-----BEGIN PGP MESSAGE-----
fookey: foovalue
barkey: barvalue

em9va2E=
=ZZZZ
-----END PGP MESSAGE-----
', E'\n', E'\r\n'));

-- test header generation
select armor('zooka', array['foo'], array['bar']);
select armor('zooka', array['Version', 'Comment'], array['Created by pgcrypto', 'PostgreSQL, the world''s most advanced open source database']);
select * from pgp_armor_headers(
  armor('zooka', array['Version', 'Comment'],
                 array['Created by pgcrypto', 'PostgreSQL, the world''s most advanced open source database']));

-- error/corner cases
select armor('', array['foo'], array['too', 'many']);
select armor('', array['too', 'many'], array['foo']);
select armor('', array[['']], array['foo']);
select armor('', array['foo'], array[['']]);
select armor('', array[null], array['foo']);
select armor('', array['foo'], array[null]);
select armor('', '[0:0]={"foo"}', array['foo']);
select armor('', array['foo'], '[0:0]={"foo"}');
select armor('', array[E'embedded\nnewline'], array['foo']);
select armor('', array['foo'], array[E'embedded\nnewline']);
select armor('', array['embedded: colon+space'], array['foo']);

Messung V0.5 in Prozent
C=92 H=92 G=91

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.4Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.