diff options
author | Michael P | 2011-07-05 03:16:11 +0000 |
---|---|---|
committer | Michael P | 2011-07-06 03:40:35 +0000 |
commit | 0bbfc1e6338b5d98d6cb83fa75f2c38f527d4d4b (patch) | |
tree | 46fa412a31d08ea6e53d488ae7bc231df0b273da /contrib/pgcrypto | |
parent | 091b0e828cf0fd5bbd1f9ae58ab96fc983e55d77 (diff) | |
parent | a4bebdd92624e018108c2610fc3f2c1584b6c687 (diff) |
Merge commit 'a4bebdd92624e018108c2610fc3f2c1584b6c687' into master
This is the commit merge of Postgres-XC with the intersection of
PostgreSQL REL9_1_STABLE and master branches.
Conflicts:
COPYRIGHT
contrib/pgbench/pgbench.c
src/Makefile
src/backend/access/transam/recovery.conf.sample
src/backend/access/transam/varsup.c
src/backend/access/transam/xlog.c
src/backend/catalog/Makefile
src/backend/catalog/dependency.c
src/backend/catalog/system_views.sql
src/backend/commands/copy.c
src/backend/commands/explain.c
src/backend/commands/sequence.c
src/backend/commands/tablecmds.c
src/backend/commands/vacuum.c
src/backend/executor/nodeAgg.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/setrefs.c
src/backend/parser/gram.y
src/backend/parser/parse_utilcmd.c
src/backend/postmaster/postmaster.c
src/backend/rewrite/rewriteHandler.c
src/backend/storage/lmgr/proc.c
src/backend/tcop/postgres.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/init/postinit.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample
src/backend/utils/sort/tuplesort.c
src/bin/initdb/initdb.c
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_dump/pg_dump.c
src/include/access/xlog.h
src/include/catalog/catversion.h
src/include/catalog/indexing.h
src/include/catalog/pg_aggregate.h
src/include/catalog/pg_proc.h
src/include/commands/copy.h
src/include/nodes/parsenodes.h
src/include/nodes/primnodes.h
src/include/optimizer/pathnode.h
src/include/parser/kwlist.h
src/include/storage/procarray.h
src/test/regress/expected/.gitignore
src/test/regress/expected/aggregates.out
src/test/regress/expected/alter_table.out
src/test/regress/expected/bit.out
src/test/regress/expected/box.out
src/test/regress/expected/delete.out
src/test/regress/expected/float4.out
src/test/regress/expected/float8.out
src/test/regress/expected/int2.out
src/test/regress/expected/int8.out
src/test/regress/expected/interval.out
src/test/regress/expected/numeric.out
src/test/regress/expected/point.out
src/test/regress/expected/polygon.out
src/test/regress/expected/sequence.out
src/test/regress/expected/timestamp.out
src/test/regress/expected/timestamptz.out
src/test/regress/expected/transactions.out
src/test/regress/expected/window.out
src/test/regress/input/misc.source
src/test/regress/output/create_misc_1.source
src/test/regress/output/misc.source
src/test/regress/sql/aggregates.sql
src/test/regress/sql/alter_table.sql
src/test/regress/sql/bit.sql
src/test/regress/sql/box.sql
src/test/regress/sql/delete.sql
src/test/regress/sql/domain.sql
src/test/regress/sql/float4.sql
src/test/regress/sql/float8.sql
src/test/regress/sql/int2.sql
src/test/regress/sql/int8.sql
src/test/regress/sql/interval.sql
src/test/regress/sql/lseg.sql
src/test/regress/sql/numeric.sql
src/test/regress/sql/path.sql
src/test/regress/sql/point.sql
src/test/regress/sql/polygon.sql
src/test/regress/sql/portals.sql
src/test/regress/sql/sequence.sql
src/test/regress/sql/timestamp.sql
src/test/regress/sql/timestamptz.sql
src/test/regress/sql/transactions.sql
src/test/regress/sql/window.sql
src/test/regress/sql/with.sql
Diffstat (limited to 'contrib/pgcrypto')
81 files changed, 158 insertions, 220 deletions
diff --git a/contrib/pgcrypto/.gitignore b/contrib/pgcrypto/.gitignore new file mode 100644 index 0000000000..5dcb3ff972 --- /dev/null +++ b/contrib/pgcrypto/.gitignore @@ -0,0 +1,4 @@ +# Generated subdirectories +/log/ +/results/ +/tmp_check/ diff --git a/contrib/pgcrypto/Makefile b/contrib/pgcrypto/Makefile index cfb586ba49..dadec953c2 100644 --- a/contrib/pgcrypto/Makefile +++ b/contrib/pgcrypto/Makefile @@ -1,6 +1,4 @@ -# -# $PostgreSQL: pgsql/contrib/pgcrypto/Makefile,v 1.27 2007/11/10 23:59:51 momjian Exp $ -# +# contrib/pgcrypto/Makefile INT_SRCS = md5.c sha1.c sha2.c internal.c internal-sha2.c blf.c rijndael.c \ fortuna.c random.c pgp-mpi-internal.c imath.c @@ -26,9 +24,9 @@ SRCS = pgcrypto.c px.c px-hmac.c px-crypt.c \ MODULE_big = pgcrypto OBJS = $(SRCS:.c=.o) -DATA_built = pgcrypto.sql -DATA = uninstall_pgcrypto.sql -EXTRA_CLEAN = gen-rtab + +EXTENSION = pgcrypto +DATA = pgcrypto--1.0.sql pgcrypto--unpackaged--1.0.sql REGRESS = init md5 sha1 hmac-md5 hmac-sha1 blowfish rijndael \ $(CF_TESTS) \ @@ -36,6 +34,7 @@ REGRESS = init md5 sha1 hmac-md5 hmac-sha1 blowfish rijndael \ pgp-armor pgp-decrypt pgp-encrypt $(CF_PGP_TESTS) \ pgp-pubkey-decrypt pgp-pubkey-encrypt pgp-info +EXTRA_CLEAN = gen-rtab ifdef USE_PGXS PG_CONFIG = pg_config diff --git a/contrib/pgcrypto/blf.c b/contrib/pgcrypto/blf.c index e03c542c0d..f8a2c63c9f 100644 --- a/contrib/pgcrypto/blf.c +++ b/contrib/pgcrypto/blf.c @@ -1,7 +1,7 @@ /* * Butchered version of sshblowf.c from putty-0.59. * - * $PostgreSQL: pgsql/contrib/pgcrypto/blf.c,v 1.10 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/blf.c */ /* diff --git a/contrib/pgcrypto/blf.h b/contrib/pgcrypto/blf.h index 507d7f9055..84aba37ba8 100644 --- a/contrib/pgcrypto/blf.h +++ b/contrib/pgcrypto/blf.h @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/contrib/pgcrypto/blf.h,v 1.8 2009/06/11 14:48:52 momjian Exp $ */ +/* contrib/pgcrypto/blf.h */ /* * PuTTY is copyright 1997-2007 Simon Tatham. * diff --git a/contrib/pgcrypto/crypt-blowfish.c b/contrib/pgcrypto/crypt-blowfish.c index 9c1d2d4706..a7b7e758ff 100644 --- a/contrib/pgcrypto/crypt-blowfish.c +++ b/contrib/pgcrypto/crypt-blowfish.c @@ -1,5 +1,5 @@ /* - * $PostgreSQL: pgsql/contrib/pgcrypto/crypt-blowfish.c,v 1.14 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/crypt-blowfish.c * * This code comes from John the Ripper password cracker, with reentrant * and crypt(3) interfaces added, but optimizations specific to password diff --git a/contrib/pgcrypto/crypt-des.c b/contrib/pgcrypto/crypt-des.c index a907626d39..1f497432da 100644 --- a/contrib/pgcrypto/crypt-des.c +++ b/contrib/pgcrypto/crypt-des.c @@ -1,7 +1,7 @@ /* * FreeSec: libcrypt for NetBSD * - * $PostgreSQL: pgsql/contrib/pgcrypto/crypt-des.c,v 1.15 2006/07/13 04:15:24 neilc Exp $ + * contrib/pgcrypto/crypt-des.c * * Copyright (c) 1994 David Burren * All rights reserved. diff --git a/contrib/pgcrypto/crypt-gensalt.c b/contrib/pgcrypto/crypt-gensalt.c index b2ec3da828..84bf27bedb 100644 --- a/contrib/pgcrypto/crypt-gensalt.c +++ b/contrib/pgcrypto/crypt-gensalt.c @@ -2,7 +2,7 @@ * Written by Solar Designer and placed in the public domain. * See crypt_blowfish.c for more information. * - * $PostgreSQL: pgsql/contrib/pgcrypto/crypt-gensalt.c,v 1.11 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/crypt-gensalt.c * * This file contains salt generation functions for the traditional and * other common crypt(3) algorithms, except for bcrypt which is defined diff --git a/contrib/pgcrypto/crypt-md5.c b/contrib/pgcrypto/crypt-md5.c index d70fc341af..30eb8bf5a2 100644 --- a/contrib/pgcrypto/crypt-md5.c +++ b/contrib/pgcrypto/crypt-md5.c @@ -3,7 +3,7 @@ * * $FreeBSD: src/lib/libcrypt/crypt-md5.c,v 1.5 1999/12/17 20:21:45 peter Exp $ * - * $PostgreSQL: pgsql/contrib/pgcrypto/crypt-md5.c,v 1.9 2009/04/15 18:58:24 mha Exp $ + * contrib/pgcrypto/crypt-md5.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/expected/blowfish.out b/contrib/pgcrypto/expected/blowfish.out index 86c3244cec..72557ea161 100644 --- a/contrib/pgcrypto/expected/blowfish.out +++ b/contrib/pgcrypto/expected/blowfish.out @@ -108,7 +108,7 @@ decode('37363534333231204e6f77206973207468652074696d6520666f722000', 'hex'), 3ea6357a0ee7fad6d0c4b63464f2aafa40c2e91b4b7e1bba8114932fd92b5c8f111e7e50e7b2e541 (1 row) --- blowfish-448 +-- blowfish-448 SELECT encode(encrypt( decode('fedcba9876543210', 'hex'), decode('f0e1d2c3b4a5968778695a4b3c2d1e0f001122334455667704689104c2fd3b2f584023641aba61761f1f1f1f0e0e0e0effffffffffffffff', 'hex'), @@ -120,21 +120,21 @@ decode('f0e1d2c3b4a5968778695a4b3c2d1e0f001122334455667704689104c2fd3b2f58402364 -- result: c04504012e4e1f53 -- empty data -select encode( encrypt('', 'foo', 'bf'), 'hex'); +select encode(encrypt('', 'foo', 'bf'), 'hex'); encode ------------------ 1871949bb2311c8e (1 row) -- 10 bytes key -select encode( encrypt('foo', '0123456789', 'bf'), 'hex'); +select encode(encrypt('foo', '0123456789', 'bf'), 'hex'); encode ------------------ 42f58af3b2c03f46 (1 row) -- 22 bytes key -select encode( encrypt('foo', '0123456789012345678901', 'bf'), 'hex'); +select encode(encrypt('foo', '0123456789012345678901', 'bf'), 'hex'); encode ------------------ 86ab6f0bc72b5f22 diff --git a/contrib/pgcrypto/expected/crypt-blowfish.out b/contrib/pgcrypto/expected/crypt-blowfish.out index 8a8b007181..329d78f625 100644 --- a/contrib/pgcrypto/expected/crypt-blowfish.out +++ b/contrib/pgcrypto/expected/crypt-blowfish.out @@ -17,7 +17,7 @@ CREATE TABLE ctest (data text, res text, salt text); INSERT INTO ctest VALUES ('password', '', ''); UPDATE ctest SET salt = gen_salt('bf', 8); UPDATE ctest SET res = crypt(data, salt); -SELECT res = crypt(data, res) AS "worked" +SELECT res = crypt(data, res) AS "worked" FROM ctest; worked -------- diff --git a/contrib/pgcrypto/expected/init.out b/contrib/pgcrypto/expected/init.out index 4cb1081997..bd8f8e1380 100644 --- a/contrib/pgcrypto/expected/init.out +++ b/contrib/pgcrypto/expected/init.out @@ -1,13 +1,7 @@ -- -- init pgcrypto -- --- --- first, define the functions. Turn off echoing so that expected file --- does not depend on contents of pgcrypto.sql. --- -SET client_min_messages = warning; -\set ECHO none -RESET client_min_messages; +CREATE EXTENSION pgcrypto; -- ensure consistent test output regardless of the default bytea format SET bytea_output TO escape; -- check for encoding fn's diff --git a/contrib/pgcrypto/expected/rijndael.out b/contrib/pgcrypto/expected/rijndael.out index 106181ef22..14b2650c32 100644 --- a/contrib/pgcrypto/expected/rijndael.out +++ b/contrib/pgcrypto/expected/rijndael.out @@ -70,21 +70,21 @@ decode('000102030405060708090a0b0c0d0e0f101112131415161718191a1b', 'hex'), (1 row) -- empty data -select encode( encrypt('', 'foo', 'aes'), 'hex'); +select encode(encrypt('', 'foo', 'aes'), 'hex'); encode ---------------------------------- b48cc3338a2eb293b6007ef72c360d48 (1 row) -- 10 bytes key -select encode( encrypt('foo', '0123456789', 'aes'), 'hex'); +select encode(encrypt('foo', '0123456789', 'aes'), 'hex'); encode ---------------------------------- f397f03d2819b7172b68d0706fda4693 (1 row) -- 22 bytes key -select encode( encrypt('foo', '0123456789012345678901', 'aes'), 'hex'); +select encode(encrypt('foo', '0123456789012345678901', 'aes'), 'hex'); encode ---------------------------------- 5c9db77af02b4678117bcd8a71ae7f53 @@ -105,7 +105,7 @@ select encode(encrypt_iv('foo', '0123456', 'abcd', 'aes'), 'hex'); (1 row) select decrypt_iv(decode('2c24cb7da91d6d5699801268b0f5adad', 'hex'), - '0123456', 'abcd', 'aes'); + '0123456', 'abcd', 'aes'); decrypt_iv ------------ foo diff --git a/contrib/pgcrypto/fortuna.c b/contrib/pgcrypto/fortuna.c index 4e97946ab3..1228fb4ad0 100644 --- a/contrib/pgcrypto/fortuna.c +++ b/contrib/pgcrypto/fortuna.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/fortuna.c,v 1.9 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/fortuna.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/fortuna.h b/contrib/pgcrypto/fortuna.h index b4d7064dec..2e49f8aab8 100644 --- a/contrib/pgcrypto/fortuna.h +++ b/contrib/pgcrypto/fortuna.h @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/fortuna.h,v 1.3 2005/10/15 02:49:06 momjian Exp $ + * contrib/pgcrypto/fortuna.h */ #ifndef __FORTUNA_H diff --git a/contrib/pgcrypto/imath.c b/contrib/pgcrypto/imath.c index 51f1f00e30..de24076322 100644 --- a/contrib/pgcrypto/imath.c +++ b/contrib/pgcrypto/imath.c @@ -27,7 +27,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $PostgreSQL: pgsql/contrib/pgcrypto/imath.c,v 1.9 2010/04/02 15:21:20 mha Exp $ */ +/* contrib/pgcrypto/imath.c */ #include "postgres.h" #include "px.h" diff --git a/contrib/pgcrypto/imath.h b/contrib/pgcrypto/imath.h index c7b29cf3a5..f2b02d0cd7 100644 --- a/contrib/pgcrypto/imath.h +++ b/contrib/pgcrypto/imath.h @@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $PostgreSQL: pgsql/contrib/pgcrypto/imath.h,v 1.8 2010/04/02 15:21:20 mha Exp $ */ +/* contrib/pgcrypto/imath.h */ #ifndef IMATH_H_ #define IMATH_H_ diff --git a/contrib/pgcrypto/internal-sha2.c b/contrib/pgcrypto/internal-sha2.c index 1e36a369e0..f86b47816b 100644 --- a/contrib/pgcrypto/internal-sha2.c +++ b/contrib/pgcrypto/internal-sha2.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/internal-sha2.c,v 1.3 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/internal-sha2.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/internal.c b/contrib/pgcrypto/internal.c index 84bda624a4..fedfe2dd03 100644 --- a/contrib/pgcrypto/internal.c +++ b/contrib/pgcrypto/internal.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/internal.c,v 1.29 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/internal.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/mbuf.c b/contrib/pgcrypto/mbuf.c index d3eee2ee4f..6246900c7a 100644 --- a/contrib/pgcrypto/mbuf.c +++ b/contrib/pgcrypto/mbuf.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/mbuf.c,v 1.5 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/mbuf.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/mbuf.h b/contrib/pgcrypto/mbuf.h index aa2b5596ee..37d2db5337 100644 --- a/contrib/pgcrypto/mbuf.h +++ b/contrib/pgcrypto/mbuf.h @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/mbuf.h,v 1.3 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/mbuf.h */ #ifndef __PX_MBUF_H diff --git a/contrib/pgcrypto/md5.c b/contrib/pgcrypto/md5.c index 8083d1f280..b5071fba43 100644 --- a/contrib/pgcrypto/md5.c +++ b/contrib/pgcrypto/md5.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/md5.c,v 1.15 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/md5.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/md5.h b/contrib/pgcrypto/md5.h index eb7c620b48..03b9ab58ba 100644 --- a/contrib/pgcrypto/md5.h +++ b/contrib/pgcrypto/md5.h @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/contrib/pgcrypto/md5.h,v 1.10 2009/06/11 14:48:52 momjian Exp $ */ +/* contrib/pgcrypto/md5.h */ /* $KAME: md5.h,v 1.3 2000/02/22 14:01:18 itojun Exp $ */ /* diff --git a/contrib/pgcrypto/openssl.c b/contrib/pgcrypto/openssl.c index bb0b4eefd3..dc25acea5d 100644 --- a/contrib/pgcrypto/openssl.c +++ b/contrib/pgcrypto/openssl.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/openssl.c,v 1.33 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/openssl.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgcrypto.sql.in b/contrib/pgcrypto/pgcrypto--1.0.sql index 8388e8620e..52be0950ce 100644 --- a/contrib/pgcrypto/pgcrypto.sql.in +++ b/contrib/pgcrypto/pgcrypto--1.0.sql @@ -1,64 +1,61 @@ -/* $PostgreSQL: pgsql/contrib/pgcrypto/pgcrypto.sql.in,v 1.15 2007/11/13 04:24:28 momjian Exp $ */ +/* contrib/pgcrypto/pgcrypto--1.0.sql */ --- Adjust this setting to control where the objects get created. -SET search_path = public; - -CREATE OR REPLACE FUNCTION digest(text, text) +CREATE FUNCTION digest(text, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pg_digest' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION digest(bytea, text) +CREATE FUNCTION digest(bytea, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pg_digest' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION hmac(text, text, text) +CREATE FUNCTION hmac(text, text, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pg_hmac' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION hmac(bytea, bytea, text) +CREATE FUNCTION hmac(bytea, bytea, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pg_hmac' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION crypt(text, text) +CREATE FUNCTION crypt(text, text) RETURNS text AS 'MODULE_PATHNAME', 'pg_crypt' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION gen_salt(text) +CREATE FUNCTION gen_salt(text) RETURNS text AS 'MODULE_PATHNAME', 'pg_gen_salt' LANGUAGE C VOLATILE STRICT; -CREATE OR REPLACE FUNCTION gen_salt(text, int4) +CREATE FUNCTION gen_salt(text, int4) RETURNS text AS 'MODULE_PATHNAME', 'pg_gen_salt_rounds' LANGUAGE C VOLATILE STRICT; -CREATE OR REPLACE FUNCTION encrypt(bytea, bytea, text) +CREATE FUNCTION encrypt(bytea, bytea, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pg_encrypt' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION decrypt(bytea, bytea, text) +CREATE FUNCTION decrypt(bytea, bytea, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pg_decrypt' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION encrypt_iv(bytea, bytea, bytea, text) +CREATE FUNCTION encrypt_iv(bytea, bytea, bytea, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pg_encrypt_iv' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION decrypt_iv(bytea, bytea, bytea, text) +CREATE FUNCTION decrypt_iv(bytea, bytea, bytea, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pg_decrypt_iv' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION gen_random_bytes(int4) +CREATE FUNCTION gen_random_bytes(int4) RETURNS bytea AS 'MODULE_PATHNAME', 'pg_random_bytes' LANGUAGE 'C' VOLATILE STRICT; @@ -66,12 +63,12 @@ LANGUAGE 'C' VOLATILE STRICT; -- -- pgp_sym_encrypt(data, key) -- -CREATE OR REPLACE FUNCTION pgp_sym_encrypt(text, text) +CREATE FUNCTION pgp_sym_encrypt(text, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pgp_sym_encrypt_text' LANGUAGE C STRICT; -CREATE OR REPLACE FUNCTION pgp_sym_encrypt_bytea(bytea, text) +CREATE FUNCTION pgp_sym_encrypt_bytea(bytea, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pgp_sym_encrypt_bytea' LANGUAGE C STRICT; @@ -79,12 +76,12 @@ LANGUAGE C STRICT; -- -- pgp_sym_encrypt(data, key, args) -- -CREATE OR REPLACE FUNCTION pgp_sym_encrypt(text, text, text) +CREATE FUNCTION pgp_sym_encrypt(text, text, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pgp_sym_encrypt_text' LANGUAGE C STRICT; -CREATE OR REPLACE FUNCTION pgp_sym_encrypt_bytea(bytea, text, text) +CREATE FUNCTION pgp_sym_encrypt_bytea(bytea, text, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pgp_sym_encrypt_bytea' LANGUAGE C STRICT; @@ -92,12 +89,12 @@ LANGUAGE C STRICT; -- -- pgp_sym_decrypt(data, key) -- -CREATE OR REPLACE FUNCTION pgp_sym_decrypt(bytea, text) +CREATE FUNCTION pgp_sym_decrypt(bytea, text) RETURNS text AS 'MODULE_PATHNAME', 'pgp_sym_decrypt_text' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION pgp_sym_decrypt_bytea(bytea, text) +CREATE FUNCTION pgp_sym_decrypt_bytea(bytea, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pgp_sym_decrypt_bytea' LANGUAGE C IMMUTABLE STRICT; @@ -105,12 +102,12 @@ LANGUAGE C IMMUTABLE STRICT; -- -- pgp_sym_decrypt(data, key, args) -- -CREATE OR REPLACE FUNCTION pgp_sym_decrypt(bytea, text, text) +CREATE FUNCTION pgp_sym_decrypt(bytea, text, text) RETURNS text AS 'MODULE_PATHNAME', 'pgp_sym_decrypt_text' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION pgp_sym_decrypt_bytea(bytea, text, text) +CREATE FUNCTION pgp_sym_decrypt_bytea(bytea, text, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pgp_sym_decrypt_bytea' LANGUAGE C IMMUTABLE STRICT; @@ -118,12 +115,12 @@ LANGUAGE C IMMUTABLE STRICT; -- -- pgp_pub_encrypt(data, key) -- -CREATE OR REPLACE FUNCTION pgp_pub_encrypt(text, bytea) +CREATE FUNCTION pgp_pub_encrypt(text, bytea) RETURNS bytea AS 'MODULE_PATHNAME', 'pgp_pub_encrypt_text' LANGUAGE C STRICT; -CREATE OR REPLACE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea) +CREATE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea) RETURNS bytea AS 'MODULE_PATHNAME', 'pgp_pub_encrypt_bytea' LANGUAGE C STRICT; @@ -131,12 +128,12 @@ LANGUAGE C STRICT; -- -- pgp_pub_encrypt(data, key, args) -- -CREATE OR REPLACE FUNCTION pgp_pub_encrypt(text, bytea, text) +CREATE FUNCTION pgp_pub_encrypt(text, bytea, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pgp_pub_encrypt_text' LANGUAGE C STRICT; -CREATE OR REPLACE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text) +CREATE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pgp_pub_encrypt_bytea' LANGUAGE C STRICT; @@ -144,12 +141,12 @@ LANGUAGE C STRICT; -- -- pgp_pub_decrypt(data, key) -- -CREATE OR REPLACE FUNCTION pgp_pub_decrypt(bytea, bytea) +CREATE FUNCTION pgp_pub_decrypt(bytea, bytea) RETURNS text AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_text' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea) +CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea) RETURNS bytea AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_bytea' LANGUAGE C IMMUTABLE STRICT; @@ -157,12 +154,12 @@ LANGUAGE C IMMUTABLE STRICT; -- -- pgp_pub_decrypt(data, key, psw) -- -CREATE OR REPLACE FUNCTION pgp_pub_decrypt(bytea, bytea, text) +CREATE FUNCTION pgp_pub_decrypt(bytea, bytea, text) RETURNS text AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_text' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text) +CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_bytea' LANGUAGE C IMMUTABLE STRICT; @@ -170,12 +167,12 @@ LANGUAGE C IMMUTABLE STRICT; -- -- pgp_pub_decrypt(data, key, psw, arg) -- -CREATE OR REPLACE FUNCTION pgp_pub_decrypt(bytea, bytea, text, text) +CREATE FUNCTION pgp_pub_decrypt(bytea, bytea, text, text) RETURNS text AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_text' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text) +CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text) RETURNS bytea AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_bytea' LANGUAGE C IMMUTABLE STRICT; @@ -183,7 +180,7 @@ LANGUAGE C IMMUTABLE STRICT; -- -- PGP key ID -- -CREATE OR REPLACE FUNCTION pgp_key_id(bytea) +CREATE FUNCTION pgp_key_id(bytea) RETURNS text AS 'MODULE_PATHNAME', 'pgp_key_id_w' LANGUAGE C IMMUTABLE STRICT; @@ -191,13 +188,12 @@ LANGUAGE C IMMUTABLE STRICT; -- -- pgp armor -- -CREATE OR REPLACE FUNCTION armor(bytea) +CREATE FUNCTION armor(bytea) RETURNS text AS 'MODULE_PATHNAME', 'pg_armor' LANGUAGE C IMMUTABLE STRICT; -CREATE OR REPLACE FUNCTION dearmor(text) +CREATE FUNCTION dearmor(text) RETURNS bytea AS 'MODULE_PATHNAME', 'pg_dearmor' LANGUAGE C IMMUTABLE STRICT; - diff --git a/contrib/pgcrypto/pgcrypto--unpackaged--1.0.sql b/contrib/pgcrypto/pgcrypto--unpackaged--1.0.sql new file mode 100644 index 0000000000..64f0cdf23a --- /dev/null +++ b/contrib/pgcrypto/pgcrypto--unpackaged--1.0.sql @@ -0,0 +1,35 @@ +/* contrib/pgcrypto/pgcrypto--unpackaged--1.0.sql */ + +ALTER EXTENSION pgcrypto ADD function digest(text,text); +ALTER EXTENSION pgcrypto ADD function digest(bytea,text); +ALTER EXTENSION pgcrypto ADD function hmac(text,text,text); +ALTER EXTENSION pgcrypto ADD function hmac(bytea,bytea,text); +ALTER EXTENSION pgcrypto ADD function crypt(text,text); +ALTER EXTENSION pgcrypto ADD function gen_salt(text); +ALTER EXTENSION pgcrypto ADD function gen_salt(text,integer); +ALTER EXTENSION pgcrypto ADD function encrypt(bytea,bytea,text); +ALTER EXTENSION pgcrypto ADD function decrypt(bytea,bytea,text); +ALTER EXTENSION pgcrypto ADD function encrypt_iv(bytea,bytea,bytea,text); +ALTER EXTENSION pgcrypto ADD function decrypt_iv(bytea,bytea,bytea,text); +ALTER EXTENSION pgcrypto ADD function gen_random_bytes(integer); +ALTER EXTENSION pgcrypto ADD function pgp_sym_encrypt(text,text); +ALTER EXTENSION pgcrypto ADD function pgp_sym_encrypt_bytea(bytea,text); +ALTER EXTENSION pgcrypto ADD function pgp_sym_encrypt(text,text,text); +ALTER EXTENSION pgcrypto ADD function pgp_sym_encrypt_bytea(bytea,text,text); +ALTER EXTENSION pgcrypto ADD function pgp_sym_decrypt(bytea,text); +ALTER EXTENSION pgcrypto ADD function pgp_sym_decrypt_bytea(bytea,text); +ALTER EXTENSION pgcrypto ADD function pgp_sym_decrypt(bytea,text,text); +ALTER EXTENSION pgcrypto ADD function pgp_sym_decrypt_bytea(bytea,text,text); +ALTER EXTENSION pgcrypto ADD function pgp_pub_encrypt(text,bytea); +ALTER EXTENSION pgcrypto ADD function pgp_pub_encrypt_bytea(bytea,bytea); +ALTER EXTENSION pgcrypto ADD function pgp_pub_encrypt(text,bytea,text); +ALTER EXTENSION pgcrypto ADD function pgp_pub_encrypt_bytea(bytea,bytea,text); +ALTER EXTENSION pgcrypto ADD function pgp_pub_decrypt(bytea,bytea); +ALTER EXTENSION pgcrypto ADD function pgp_pub_decrypt_bytea(bytea,bytea); +ALTER EXTENSION pgcrypto ADD function pgp_pub_decrypt(bytea,bytea,text); +ALTER EXTENSION pgcrypto ADD function pgp_pub_decrypt_bytea(bytea,bytea,text); +ALTER EXTENSION pgcrypto ADD function pgp_pub_decrypt(bytea,bytea,text,text); +ALTER EXTENSION pgcrypto ADD function pgp_pub_decrypt_bytea(bytea,bytea,text,text); +ALTER EXTENSION pgcrypto ADD function pgp_key_id(bytea); +ALTER EXTENSION pgcrypto ADD function armor(bytea); +ALTER EXTENSION pgcrypto ADD function dearmor(text); diff --git a/contrib/pgcrypto/pgcrypto.c b/contrib/pgcrypto/pgcrypto.c index 04c90d8672..d271ddc302 100644 --- a/contrib/pgcrypto/pgcrypto.c +++ b/contrib/pgcrypto/pgcrypto.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgcrypto.c,v 1.27 2008/03/25 22:42:41 tgl Exp $ + * contrib/pgcrypto/pgcrypto.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgcrypto.control b/contrib/pgcrypto/pgcrypto.control new file mode 100644 index 0000000000..8375cf9e7b --- /dev/null +++ b/contrib/pgcrypto/pgcrypto.control @@ -0,0 +1,5 @@ +# pgcrypto extension +comment = 'cryptographic functions' +default_version = '1.0' +module_pathname = '$libdir/pgcrypto' +relocatable = true diff --git a/contrib/pgcrypto/pgcrypto.h b/contrib/pgcrypto/pgcrypto.h index b011b06062..6284ba2406 100644 --- a/contrib/pgcrypto/pgcrypto.h +++ b/contrib/pgcrypto/pgcrypto.h @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgcrypto.h,v 1.11 2006/09/05 21:26:48 tgl Exp $ + * contrib/pgcrypto/pgcrypto.h */ #ifndef _PG_CRYPTO_H diff --git a/contrib/pgcrypto/pgp-armor.c b/contrib/pgcrypto/pgp-armor.c index 7963ccc329..87adf91125 100644 --- a/contrib/pgcrypto/pgp-armor.c +++ b/contrib/pgcrypto/pgp-armor.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-armor.c,v 1.3 2005/10/15 02:49:06 momjian Exp $ + * contrib/pgcrypto/pgp-armor.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgp-cfb.c b/contrib/pgcrypto/pgp-cfb.c index bd05ccc94e..7cf9bf0b8c 100644 --- a/contrib/pgcrypto/pgp-cfb.c +++ b/contrib/pgcrypto/pgp-cfb.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-cfb.c,v 1.4 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp-cfb.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgp-compress.c b/contrib/pgcrypto/pgp-compress.c index 41f5855247..7a9516b070 100644 --- a/contrib/pgcrypto/pgp-compress.c +++ b/contrib/pgcrypto/pgp-compress.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-compress.c,v 1.8 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp-compress.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgp-decrypt.c b/contrib/pgcrypto/pgp-decrypt.c index 9df5c717f2..c9aa6cd66a 100644 --- a/contrib/pgcrypto/pgp-decrypt.c +++ b/contrib/pgcrypto/pgp-decrypt.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-decrypt.c,v 1.8 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp-decrypt.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgp-encrypt.c b/contrib/pgcrypto/pgp-encrypt.c index 48f2f01f62..3b9b5d20ed 100644 --- a/contrib/pgcrypto/pgp-encrypt.c +++ b/contrib/pgcrypto/pgp-encrypt.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-encrypt.c,v 1.4 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp-encrypt.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgp-info.c b/contrib/pgcrypto/pgp-info.c index a51a553236..b75266f18c 100644 --- a/contrib/pgcrypto/pgp-info.c +++ b/contrib/pgcrypto/pgp-info.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-info.c,v 1.5 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp-info.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgp-mpi-internal.c b/contrib/pgcrypto/pgp-mpi-internal.c index 283946b17d..d0e5830fe0 100644 --- a/contrib/pgcrypto/pgp-mpi-internal.c +++ b/contrib/pgcrypto/pgp-mpi-internal.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi-internal.c,v 1.8 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp-mpi-internal.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgp-mpi-openssl.c b/contrib/pgcrypto/pgp-mpi-openssl.c index f2b25de090..ed41e1151c 100644 --- a/contrib/pgcrypto/pgp-mpi-openssl.c +++ b/contrib/pgcrypto/pgp-mpi-openssl.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi-openssl.c,v 1.5 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp-mpi-openssl.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgp-mpi.c b/contrib/pgcrypto/pgp-mpi.c index 3f2ec0f5c7..c8765b6d14 100644 --- a/contrib/pgcrypto/pgp-mpi.c +++ b/contrib/pgcrypto/pgp-mpi.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi.c,v 1.5 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp-mpi.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgp-pgsql.c b/contrib/pgcrypto/pgp-pgsql.c index 530a3d38d8..f1f09cd83b 100644 --- a/contrib/pgcrypto/pgp-pgsql.c +++ b/contrib/pgcrypto/pgp-pgsql.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pgsql.c,v 1.11 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp-pgsql.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgp-pubdec.c b/contrib/pgcrypto/pgp-pubdec.c index cb32708fee..fe5fae0c42 100644 --- a/contrib/pgcrypto/pgp-pubdec.c +++ b/contrib/pgcrypto/pgp-pubdec.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pubdec.c,v 1.6 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp-pubdec.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgp-pubenc.c b/contrib/pgcrypto/pgp-pubenc.c index 0e9ebb4285..943d2e49f5 100644 --- a/contrib/pgcrypto/pgp-pubenc.c +++ b/contrib/pgcrypto/pgp-pubenc.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pubenc.c,v 1.5 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp-pubenc.c */ #include "postgres.h" @@ -199,7 +199,7 @@ pgp_write_pubenc_sesskey(PGP_Context *ctx, PushFilter *dst) PGP_PubKey *pk = ctx->pub_key; uint8 ver = 3; PushFilter *pkt = NULL; - uint8 algo = pk->algo; + uint8 algo; if (pk == NULL) { @@ -207,6 +207,8 @@ pgp_write_pubenc_sesskey(PGP_Context *ctx, PushFilter *dst) return PXE_BUG; } + algo = pk->algo; + /* * now write packet */ diff --git a/contrib/pgcrypto/pgp-pubkey.c b/contrib/pgcrypto/pgp-pubkey.c index 62b6e1ab0e..283e0ec17e 100644 --- a/contrib/pgcrypto/pgp-pubkey.c +++ b/contrib/pgcrypto/pgp-pubkey.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pubkey.c,v 1.5 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp-pubkey.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgp-s2k.c b/contrib/pgcrypto/pgp-s2k.c index 326b1bbf31..349234e243 100644 --- a/contrib/pgcrypto/pgp-s2k.c +++ b/contrib/pgcrypto/pgp-s2k.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-s2k.c,v 1.5 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp-s2k.c */ #include "postgres.h" @@ -39,14 +39,12 @@ static int calc_s2k_simple(PGP_S2K *s2k, PX_MD *md, const uint8 *key, unsigned key_len) { - unsigned md_bs, - md_rlen; + unsigned md_rlen; uint8 buf[PGP_MAX_DIGEST]; unsigned preload; unsigned remain; uint8 *dst = s2k->key; - md_bs = px_md_block_size(md); md_rlen = px_md_result_size(md); remain = s2k->key_len; @@ -83,14 +81,12 @@ calc_s2k_simple(PGP_S2K *s2k, PX_MD *md, const uint8 *key, static int calc_s2k_salted(PGP_S2K *s2k, PX_MD *md, const uint8 *key, unsigned key_len) { - unsigned md_bs, - md_rlen; + unsigned md_rlen; uint8 buf[PGP_MAX_DIGEST]; unsigned preload = 0; uint8 *dst; unsigned remain; - md_bs = px_md_block_size(md); md_rlen = px_md_result_size(md); dst = s2k->key; @@ -129,8 +125,7 @@ static int calc_s2k_iter_salted(PGP_S2K *s2k, PX_MD *md, const uint8 *key, unsigned key_len) { - unsigned md_bs, - md_rlen; + unsigned md_rlen; uint8 buf[PGP_MAX_DIGEST]; uint8 *dst; unsigned preload = 0; @@ -143,7 +138,6 @@ calc_s2k_iter_salted(PGP_S2K *s2k, PX_MD *md, const uint8 *key, cval = s2k->iter; count = ((unsigned) 16 + (cval & 15)) << ((cval >> 4) + 6); - md_bs = px_md_block_size(md); md_rlen = px_md_result_size(md); remain = s2k->key_len; diff --git a/contrib/pgcrypto/pgp.c b/contrib/pgcrypto/pgp.c index ce6f199a9e..b8a6bc49b4 100644 --- a/contrib/pgcrypto/pgp.c +++ b/contrib/pgcrypto/pgp.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp.c,v 1.4 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/pgp.h b/contrib/pgcrypto/pgp.h index 7860d830c4..7ae01ccc4d 100644 --- a/contrib/pgcrypto/pgp.h +++ b/contrib/pgcrypto/pgp.h @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/pgp.h,v 1.6 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/pgp.h */ enum PGP_S2K_TYPE diff --git a/contrib/pgcrypto/px-crypt.c b/contrib/pgcrypto/px-crypt.c index e21acb73c6..ab12e2a6e7 100644 --- a/contrib/pgcrypto/px-crypt.c +++ b/contrib/pgcrypto/px-crypt.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/px-crypt.c,v 1.15 2005/10/15 02:49:06 momjian Exp $ + * contrib/pgcrypto/px-crypt.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/px-crypt.h b/contrib/pgcrypto/px-crypt.h index c2460cb9f9..7dde9ab77b 100644 --- a/contrib/pgcrypto/px-crypt.h +++ b/contrib/pgcrypto/px-crypt.h @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/px-crypt.h,v 1.10 2006/07/13 04:15:25 neilc Exp $ + * contrib/pgcrypto/px-crypt.h */ #ifndef _PX_CRYPT_H diff --git a/contrib/pgcrypto/px-hmac.c b/contrib/pgcrypto/px-hmac.c index 3b2016190e..36efabd4a3 100644 --- a/contrib/pgcrypto/px-hmac.c +++ b/contrib/pgcrypto/px-hmac.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/px-hmac.c,v 1.8 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/px-hmac.c */ #include "postgres.h" @@ -52,13 +52,11 @@ static void hmac_init(PX_HMAC *h, const uint8 *key, unsigned klen) { unsigned bs, - hlen, i; uint8 *keybuf; PX_MD *md = h->md; bs = px_md_block_size(md); - hlen = px_md_result_size(md); keybuf = px_alloc(bs); memset(keybuf, 0, bs); diff --git a/contrib/pgcrypto/px.c b/contrib/pgcrypto/px.c index f2db06a898..e3f5e26221 100644 --- a/contrib/pgcrypto/px.c +++ b/contrib/pgcrypto/px.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/px.c,v 1.18 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/px.c */ #include "postgres.h" @@ -162,14 +162,12 @@ combo_init(PX_Combo *cx, const uint8 *key, unsigned klen, const uint8 *iv, unsigned ivlen) { int err; - unsigned bs, - ks, + unsigned ks, ivs; PX_Cipher *c = cx->cipher; uint8 *ivbuf = NULL; uint8 *keybuf; - bs = px_cipher_block_size(c); ks = px_cipher_key_size(c); ivs = px_cipher_iv_size(c); @@ -205,7 +203,6 @@ combo_encrypt(PX_Combo *cx, const uint8 *data, unsigned dlen, int err = 0; uint8 *bbuf; unsigned bs, - maxlen, bpos, i, pad; @@ -213,7 +210,6 @@ combo_encrypt(PX_Combo *cx, const uint8 *data, unsigned dlen, PX_Cipher *c = cx->cipher; bbuf = NULL; - maxlen = *rlen; bs = px_cipher_block_size(c); /* encrypt */ diff --git a/contrib/pgcrypto/px.h b/contrib/pgcrypto/px.h index c916e9361c..9709f9bdb6 100644 --- a/contrib/pgcrypto/px.h +++ b/contrib/pgcrypto/px.h @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/px.h,v 1.19 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/px.h */ #ifndef __PX_H diff --git a/contrib/pgcrypto/random.c b/contrib/pgcrypto/random.c index b22e029d2c..393a0be983 100644 --- a/contrib/pgcrypto/random.c +++ b/contrib/pgcrypto/random.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/random.c,v 1.17 2006/06/08 03:29:30 momjian Exp $ + * contrib/pgcrypto/random.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/rijndael.c b/contrib/pgcrypto/rijndael.c index cf9eca91dc..5651d03750 100644 --- a/contrib/pgcrypto/rijndael.c +++ b/contrib/pgcrypto/rijndael.c @@ -1,6 +1,6 @@ /* $OpenBSD: rijndael.c,v 1.6 2000/12/09 18:51:34 markus Exp $ */ -/* $PostgreSQL: pgsql/contrib/pgcrypto/rijndael.c,v 1.14 2009/06/11 14:48:52 momjian Exp $ */ +/* contrib/pgcrypto/rijndael.c */ /* This is an independent implementation of the encryption algorithm: */ /* */ diff --git a/contrib/pgcrypto/rijndael.h b/contrib/pgcrypto/rijndael.h index e4c4229170..fb30e46c14 100644 --- a/contrib/pgcrypto/rijndael.h +++ b/contrib/pgcrypto/rijndael.h @@ -1,5 +1,5 @@ /* - * $PostgreSQL: pgsql/contrib/pgcrypto/rijndael.h,v 1.7 2009/06/11 14:48:52 momjian Exp $ + * contrib/pgcrypto/rijndael.h * * $OpenBSD: rijndael.h,v 1.3 2001/05/09 23:01:32 markus Exp $ */ diff --git a/contrib/pgcrypto/rijndael.tbl b/contrib/pgcrypto/rijndael.tbl index bc0a3822cc..c7610c0134 100644 --- a/contrib/pgcrypto/rijndael.tbl +++ b/contrib/pgcrypto/rijndael.tbl @@ -1133,7 +1133,6 @@ static const u4byte il_tab[4][256] = { }; static const u4byte rco_tab[10] = { - 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010, + 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010, 0x00000020, 0x00000040, 0x00000080, 0x0000001b, 0x00000036 }; - diff --git a/contrib/pgcrypto/sha1.c b/contrib/pgcrypto/sha1.c index 94849a78c5..4ee4f24559 100644 --- a/contrib/pgcrypto/sha1.c +++ b/contrib/pgcrypto/sha1.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $PostgreSQL: pgsql/contrib/pgcrypto/sha1.c,v 1.18 2010/04/02 15:21:20 mha Exp $ + * contrib/pgcrypto/sha1.c */ /* * FIPS pub 180-1: Secure Hash Algorithm (SHA-1) diff --git a/contrib/pgcrypto/sha1.h b/contrib/pgcrypto/sha1.h index ccd925b75e..3e0931efbc 100644 --- a/contrib/pgcrypto/sha1.h +++ b/contrib/pgcrypto/sha1.h @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/contrib/pgcrypto/sha1.h,v 1.10 2010/04/02 15:21:20 mha Exp $ */ +/* contrib/pgcrypto/sha1.h */ /* $KAME: sha1.h,v 1.4 2000/02/22 14:01:18 itojun Exp $ */ /* diff --git a/contrib/pgcrypto/sha2.c b/contrib/pgcrypto/sha2.c index d65995456c..5de94b2fcd 100644 --- a/contrib/pgcrypto/sha2.c +++ b/contrib/pgcrypto/sha2.c @@ -33,7 +33,7 @@ * * $From: sha2.c,v 1.1 2001/11/08 00:01:51 adg Exp adg $ * - * $PostgreSQL: pgsql/contrib/pgcrypto/sha2.c,v 1.13 2010/07/06 19:18:55 momjian Exp $ + * contrib/pgcrypto/sha2.c */ #include "postgres.h" diff --git a/contrib/pgcrypto/sha2.h b/contrib/pgcrypto/sha2.h index 8d593c60e5..df77a7a659 100644 --- a/contrib/pgcrypto/sha2.h +++ b/contrib/pgcrypto/sha2.h @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/contrib/pgcrypto/sha2.h,v 1.5 2009/06/11 14:48:52 momjian Exp $ */ +/* contrib/pgcrypto/sha2.h */ /* $OpenBSD: sha2.h,v 1.2 2004/04/28 23:11:57 millert Exp $ */ /* diff --git a/contrib/pgcrypto/sql/3des.sql b/contrib/pgcrypto/sql/3des.sql index 274d7d81f6..ef54592060 100644 --- a/contrib/pgcrypto/sql/3des.sql +++ b/contrib/pgcrypto/sql/3des.sql @@ -29,4 +29,3 @@ select decrypt_iv(decode('50735067b073bb93', 'hex'), '0123456', 'abcd', '3des'); -- long message select encode(encrypt('Lets try a longer message.', '0123456789012345678901', '3des'), 'hex'); select decrypt(encrypt('Lets try a longer message.', '0123456789012345678901', '3des'), '0123456789012345678901', '3des'); - diff --git a/contrib/pgcrypto/sql/blowfish.sql b/contrib/pgcrypto/sql/blowfish.sql index 1a8536d686..ba8df41c68 100644 --- a/contrib/pgcrypto/sql/blowfish.sql +++ b/contrib/pgcrypto/sql/blowfish.sql @@ -66,7 +66,7 @@ decode('6b77b4d63006dee605b156e27403979358deb9e7154616d959f1652bd5ff92cc', 'hex' decode('37363534333231204e6f77206973207468652074696d6520666f722000', 'hex'), 'bf-cbc'), 'hex'); --- blowfish-448 +-- blowfish-448 SELECT encode(encrypt( decode('fedcba9876543210', 'hex'), decode('f0e1d2c3b4a5968778695a4b3c2d1e0f001122334455667704689104c2fd3b2f584023641aba61761f1f1f1f0e0e0e0effffffffffffffff', 'hex'), @@ -74,11 +74,11 @@ decode('f0e1d2c3b4a5968778695a4b3c2d1e0f001122334455667704689104c2fd3b2f58402364 -- result: c04504012e4e1f53 -- empty data -select encode( encrypt('', 'foo', 'bf'), 'hex'); +select encode(encrypt('', 'foo', 'bf'), 'hex'); -- 10 bytes key -select encode( encrypt('foo', '0123456789', 'bf'), 'hex'); +select encode(encrypt('foo', '0123456789', 'bf'), 'hex'); -- 22 bytes key -select encode( encrypt('foo', '0123456789012345678901', 'bf'), 'hex'); +select encode(encrypt('foo', '0123456789012345678901', 'bf'), 'hex'); -- decrypt select decrypt(encrypt('foo', '0123456', 'bf'), '0123456', 'bf'); @@ -90,4 +90,3 @@ select decrypt_iv(decode('95c7e89322525d59', 'hex'), '0123456', 'abcd', 'bf'); -- long message select encode(encrypt('Lets try a longer message.', '0123456789', 'bf'), 'hex'); select decrypt(encrypt('Lets try a longer message.', '0123456789', 'bf'), '0123456789', 'bf'); - diff --git a/contrib/pgcrypto/sql/cast5.sql b/contrib/pgcrypto/sql/cast5.sql index 599ee060fa..527a76a160 100644 --- a/contrib/pgcrypto/sql/cast5.sql +++ b/contrib/pgcrypto/sql/cast5.sql @@ -45,4 +45,3 @@ select decrypt_iv(decode('384a970695ce016a', 'hex'), -- long message select encode(encrypt('Lets try a longer message.', '0123456789', 'cast5'), 'hex'); select decrypt(encrypt('Lets try a longer message.', '0123456789', 'cast5'), '0123456789', 'cast5'); - diff --git a/contrib/pgcrypto/sql/crypt-blowfish.sql b/contrib/pgcrypto/sql/crypt-blowfish.sql index effc186620..60c1140055 100644 --- a/contrib/pgcrypto/sql/crypt-blowfish.sql +++ b/contrib/pgcrypto/sql/crypt-blowfish.sql @@ -11,8 +11,7 @@ INSERT INTO ctest VALUES ('password', '', ''); UPDATE ctest SET salt = gen_salt('bf', 8); UPDATE ctest SET res = crypt(data, salt); -SELECT res = crypt(data, res) AS "worked" +SELECT res = crypt(data, res) AS "worked" FROM ctest; DROP TABLE ctest; - diff --git a/contrib/pgcrypto/sql/crypt-des.sql b/contrib/pgcrypto/sql/crypt-des.sql index b13d2f9de7..fabdc652fc 100644 --- a/contrib/pgcrypto/sql/crypt-des.sql +++ b/contrib/pgcrypto/sql/crypt-des.sql @@ -15,4 +15,3 @@ SELECT res = crypt(data, res) AS "worked" FROM ctest; DROP TABLE ctest; - diff --git a/contrib/pgcrypto/sql/crypt-md5.sql b/contrib/pgcrypto/sql/crypt-md5.sql index 0002f0d34d..ba7befb228 100644 --- a/contrib/pgcrypto/sql/crypt-md5.sql +++ b/contrib/pgcrypto/sql/crypt-md5.sql @@ -15,4 +15,3 @@ SELECT res = crypt(data, res) AS "worked" FROM ctest; DROP TABLE ctest; - diff --git a/contrib/pgcrypto/sql/crypt-xdes.sql b/contrib/pgcrypto/sql/crypt-xdes.sql index 51271dba6d..d4a74f76bd 100644 --- a/contrib/pgcrypto/sql/crypt-xdes.sql +++ b/contrib/pgcrypto/sql/crypt-xdes.sql @@ -15,4 +15,3 @@ SELECT res = crypt(data, res) AS "worked" FROM ctest; DROP TABLE ctest; - diff --git a/contrib/pgcrypto/sql/des.sql b/contrib/pgcrypto/sql/des.sql index 0b3d339251..6abc5b5ffe 100644 --- a/contrib/pgcrypto/sql/des.sql +++ b/contrib/pgcrypto/sql/des.sql @@ -27,4 +27,3 @@ select decrypt_iv(decode('50735067b073bb93', 'hex'), '0123456', 'abcd', 'des'); -- long message select encode(encrypt('Lets try a longer message.', '01234567', 'des'), 'hex'); select decrypt(encrypt('Lets try a longer message.', '01234567', 'des'), '01234567', 'des'); - diff --git a/contrib/pgcrypto/sql/hmac-md5.sql b/contrib/pgcrypto/sql/hmac-md5.sql index 70bef7cd50..71dcd089e6 100644 --- a/contrib/pgcrypto/sql/hmac-md5.sql +++ b/contrib/pgcrypto/sql/hmac-md5.sql @@ -42,5 +42,3 @@ SELECT encode(hmac( 'Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data', decode('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'hex'), 'md5'), 'hex'); - - diff --git a/contrib/pgcrypto/sql/hmac-sha1.sql b/contrib/pgcrypto/sql/hmac-sha1.sql index 4adf6ed086..6f741934bf 100644 --- a/contrib/pgcrypto/sql/hmac-sha1.sql +++ b/contrib/pgcrypto/sql/hmac-sha1.sql @@ -42,5 +42,3 @@ SELECT encode(hmac( 'Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data', decode('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'hex'), 'sha1'), 'hex'); - - diff --git a/contrib/pgcrypto/sql/init.sql b/contrib/pgcrypto/sql/init.sql index ee1c231bdc..5c3d100576 100644 --- a/contrib/pgcrypto/sql/init.sql +++ b/contrib/pgcrypto/sql/init.sql @@ -2,15 +2,7 @@ -- init pgcrypto -- --- --- first, define the functions. Turn off echoing so that expected file --- does not depend on contents of pgcrypto.sql. --- -SET client_min_messages = warning; -\set ECHO none -\i pgcrypto.sql -\set ECHO all -RESET client_min_messages; +CREATE EXTENSION pgcrypto; -- ensure consistent test output regardless of the default bytea format SET bytea_output TO escape; @@ -24,4 +16,3 @@ select gen_salt('foo'); select digest('foo', 'foo'); select hmac('foo', 'foo', 'foo'); select encrypt('foo', 'foo', 'foo'); - diff --git a/contrib/pgcrypto/sql/md5.sql b/contrib/pgcrypto/sql/md5.sql index d6e502779a..4df910fafb 100644 --- a/contrib/pgcrypto/sql/md5.sql +++ b/contrib/pgcrypto/sql/md5.sql @@ -9,4 +9,3 @@ SELECT encode(digest('message digest', 'md5'), 'hex'); SELECT encode(digest('abcdefghijklmnopqrstuvwxyz', 'md5'), 'hex'); SELECT encode(digest('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 'md5'), 'hex'); SELECT encode(digest('12345678901234567890123456789012345678901234567890123456789012345678901234567890', 'md5'), 'hex'); - diff --git a/contrib/pgcrypto/sql/pgp-compression.sql b/contrib/pgcrypto/sql/pgp-compression.sql index f71c176da5..ca9ee1fc00 100644 --- a/contrib/pgcrypto/sql/pgp-compression.sql +++ b/contrib/pgcrypto/sql/pgp-compression.sql @@ -28,4 +28,3 @@ select pgp_sym_decrypt( pgp_sym_encrypt('Secret message', 'key', 'compress-algo=2, compress-level=0'), 'key', 'expect-compress-algo=0'); - diff --git a/contrib/pgcrypto/sql/pgp-encrypt-DISABLED.sql b/contrib/pgcrypto/sql/pgp-encrypt-DISABLED.sql index 80fb4d123c..4122300d97 100644 --- a/contrib/pgcrypto/sql/pgp-encrypt-DISABLED.sql +++ b/contrib/pgcrypto/sql/pgp-encrypt-DISABLED.sql @@ -1,3 +1 @@ - -- no random source - diff --git a/contrib/pgcrypto/sql/pgp-encrypt.sql b/contrib/pgcrypto/sql/pgp-encrypt.sql index 218bd419e5..cac37c8442 100644 --- a/contrib/pgcrypto/sql/pgp-encrypt.sql +++ b/contrib/pgcrypto/sql/pgp-encrypt.sql @@ -95,4 +95,3 @@ select encode(digest(pgp_sym_decrypt( pgp_sym_encrypt(E'\r\n0\n1\r\r\n\n2\r', 'key', 'convert-crlf=1'), 'key', 'convert-crlf=1'), 'sha1'), 'hex') as result, encode(digest(E'\r\n0\n1\r\r\n\n2\r', 'sha1'), 'hex') as expect; - diff --git a/contrib/pgcrypto/sql/pgp-info.sql b/contrib/pgcrypto/sql/pgp-info.sql index c525ce307e..8e1d72a415 100644 --- a/contrib/pgcrypto/sql/pgp-info.sql +++ b/contrib/pgcrypto/sql/pgp-info.sql @@ -20,4 +20,3 @@ select pgp_key_id(dearmor(seckey)) from keytbl where id=6; select pgp_key_id(dearmor(data)) as data_key_id from encdata order by id; - diff --git a/contrib/pgcrypto/sql/pgp-pubkey-DISABLED.sql b/contrib/pgcrypto/sql/pgp-pubkey-DISABLED.sql index b4aec5daf6..d35c0971ba 100644 --- a/contrib/pgcrypto/sql/pgp-pubkey-DISABLED.sql +++ b/contrib/pgcrypto/sql/pgp-pubkey-DISABLED.sql @@ -1,3 +1 @@ - -- no bignum support - diff --git a/contrib/pgcrypto/sql/pgp-pubkey-decrypt.sql b/contrib/pgcrypto/sql/pgp-pubkey-decrypt.sql index a7cb880625..cc82420084 100644 --- a/contrib/pgcrypto/sql/pgp-pubkey-decrypt.sql +++ b/contrib/pgcrypto/sql/pgp-pubkey-decrypt.sql @@ -546,4 +546,3 @@ from keytbl, encdata where keytbl.id=5 and encdata.id=1; -- password-protected secret key, right password select pgp_pub_decrypt(dearmor(data), dearmor(seckey), 'parool') from keytbl, encdata where keytbl.id=5 and encdata.id=1; - diff --git a/contrib/pgcrypto/sql/pgp-pubkey-encrypt.sql b/contrib/pgcrypto/sql/pgp-pubkey-encrypt.sql index 2c4e622e5c..879b47f871 100644 --- a/contrib/pgcrypto/sql/pgp-pubkey-encrypt.sql +++ b/contrib/pgcrypto/sql/pgp-pubkey-encrypt.sql @@ -48,5 +48,3 @@ select pgp_pub_decrypt( pgp_pub_encrypt_bytea('Secret msg', dearmor(pubkey)), dearmor(seckey)) from keytbl where keytbl.id=1; - - diff --git a/contrib/pgcrypto/sql/pgp-zlib-DISABLED.sql b/contrib/pgcrypto/sql/pgp-zlib-DISABLED.sql index 85c24683be..6f4eccd457 100644 --- a/contrib/pgcrypto/sql/pgp-zlib-DISABLED.sql +++ b/contrib/pgcrypto/sql/pgp-zlib-DISABLED.sql @@ -1,3 +1 @@ - -- zlib is disabled - diff --git a/contrib/pgcrypto/sql/rijndael.sql b/contrib/pgcrypto/sql/rijndael.sql index 428ad1332c..bfbf95d39b 100644 --- a/contrib/pgcrypto/sql/rijndael.sql +++ b/contrib/pgcrypto/sql/rijndael.sql @@ -44,11 +44,11 @@ decode('000102030405060708090a0b0c0d0e0f101112131415161718191a1b', 'hex'), 'aes-cbc'), 'hex'); -- empty data -select encode( encrypt('', 'foo', 'aes'), 'hex'); +select encode(encrypt('', 'foo', 'aes'), 'hex'); -- 10 bytes key -select encode( encrypt('foo', '0123456789', 'aes'), 'hex'); +select encode(encrypt('foo', '0123456789', 'aes'), 'hex'); -- 22 bytes key -select encode( encrypt('foo', '0123456789012345678901', 'aes'), 'hex'); +select encode(encrypt('foo', '0123456789012345678901', 'aes'), 'hex'); -- decrypt select decrypt(encrypt('foo', '0123456', 'aes'), '0123456', 'aes'); @@ -56,9 +56,8 @@ select decrypt(encrypt('foo', '0123456', 'aes'), '0123456', 'aes'); -- iv select encode(encrypt_iv('foo', '0123456', 'abcd', 'aes'), 'hex'); select decrypt_iv(decode('2c24cb7da91d6d5699801268b0f5adad', 'hex'), - '0123456', 'abcd', 'aes'); + '0123456', 'abcd', 'aes'); -- long message select encode(encrypt('Lets try a longer message.', '0123456789', 'aes'), 'hex'); select decrypt(encrypt('Lets try a longer message.', '0123456789', 'aes'), '0123456789', 'aes'); - diff --git a/contrib/pgcrypto/sql/sha1.sql b/contrib/pgcrypto/sql/sha1.sql index 6a398b411e..32b1f0698f 100644 --- a/contrib/pgcrypto/sql/sha1.sql +++ b/contrib/pgcrypto/sql/sha1.sql @@ -9,4 +9,3 @@ SELECT encode(digest('message digest', 'sha1'), 'hex'); SELECT encode(digest('abcdefghijklmnopqrstuvwxyz', 'sha1'), 'hex'); SELECT encode(digest('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 'sha1'), 'hex'); SELECT encode(digest('12345678901234567890123456789012345678901234567890123456789012345678901234567890', 'sha1'), 'hex'); - diff --git a/contrib/pgcrypto/sql/sha2.sql b/contrib/pgcrypto/sql/sha2.sql index 447ae90765..3fe63d3e87 100644 --- a/contrib/pgcrypto/sql/sha2.sql +++ b/contrib/pgcrypto/sql/sha2.sql @@ -31,5 +31,3 @@ SELECT encode(digest('abc', 'sha512'), 'hex'); SELECT encode(digest('abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq', 'sha512'), 'hex'); SELECT encode(digest('abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu', 'sha512'), 'hex'); SELECT encode(digest('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz', 'sha512'), 'hex'); - - diff --git a/contrib/pgcrypto/uninstall_pgcrypto.sql b/contrib/pgcrypto/uninstall_pgcrypto.sql deleted file mode 100644 index a2891f6882..0000000000 --- a/contrib/pgcrypto/uninstall_pgcrypto.sql +++ /dev/null @@ -1,46 +0,0 @@ -/* $PostgreSQL: pgsql/contrib/pgcrypto/uninstall_pgcrypto.sql,v 1.4 2007/11/13 04:24:28 momjian Exp $ */ - --- Adjust this setting to control where the objects get dropped. -SET search_path = public; - -DROP FUNCTION digest(text, text); -DROP FUNCTION digest(bytea, text); - -DROP FUNCTION hmac(text, text, text); -DROP FUNCTION hmac(bytea, bytea, text); - -DROP FUNCTION crypt(text, text); -DROP FUNCTION gen_salt(text); -DROP FUNCTION gen_salt(text, int4); - -DROP FUNCTION encrypt(bytea, bytea, text); -DROP FUNCTION decrypt(bytea, bytea, text); -DROP FUNCTION encrypt_iv(bytea, bytea, bytea, text); -DROP FUNCTION decrypt_iv(bytea, bytea, bytea, text); - -DROP FUNCTION gen_random_bytes(int4); - -DROP FUNCTION pgp_sym_encrypt(text, text); -DROP FUNCTION pgp_sym_encrypt_bytea(bytea, text); -DROP FUNCTION pgp_sym_encrypt(text, text, text); -DROP FUNCTION pgp_sym_encrypt_bytea(bytea, text, text); -DROP FUNCTION pgp_sym_decrypt(bytea, text); -DROP FUNCTION pgp_sym_decrypt_bytea(bytea, text); -DROP FUNCTION pgp_sym_decrypt(bytea, text, text); -DROP FUNCTION pgp_sym_decrypt_bytea(bytea, text, text); - -DROP FUNCTION pgp_pub_encrypt(text, bytea); -DROP FUNCTION pgp_pub_encrypt_bytea(bytea, bytea); -DROP FUNCTION pgp_pub_encrypt(text, bytea, text); -DROP FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text); -DROP FUNCTION pgp_pub_decrypt(bytea, bytea); -DROP FUNCTION pgp_pub_decrypt_bytea(bytea, bytea); -DROP FUNCTION pgp_pub_decrypt(bytea, bytea, text); -DROP FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text); -DROP FUNCTION pgp_pub_decrypt(bytea, bytea, text, text); -DROP FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text); - -DROP FUNCTION pgp_key_id(bytea); -DROP FUNCTION armor(bytea); -DROP FUNCTION dearmor(text); - |