Commit cff23429 authored by Bruce Momjian's avatar Bruce Momjian

I noticed that the contrib Makefiles were reorganized.

Converted pgcrypto one too.

* Changed default randomness source to libc random()
  That way pgcrypto does not have any external dependencies
  and should work everywhere.
* Re-enabled pgcrypto build in contrib/makefile
* contrib/README update - there is more stuff than
  only 'hash functions'
* Noted the libc random fact in README.pgcrypto


Marko Kreen
parent 850ba416
# $Header: /cvsroot/pgsql/contrib/Makefile,v 1.27 2001/09/06 10:49:29 petere Exp $ # $Header: /cvsroot/pgsql/contrib/Makefile,v 1.28 2001/09/29 03:11:58 momjian Exp $
subdir = contrib subdir = contrib
top_builddir = .. top_builddir = ..
...@@ -26,6 +26,7 @@ WANTED_DIRS = \ ...@@ -26,6 +26,7 @@ WANTED_DIRS = \
pg_logger \ pg_logger \
pg_resetxlog \ pg_resetxlog \
pgbench \ pgbench \
pgcrypto \
rserv \ rserv \
rtree_gist \ rtree_gist \
seg \ seg \
...@@ -41,7 +42,6 @@ WANTED_DIRS = \ ...@@ -41,7 +42,6 @@ WANTED_DIRS = \
# mac \ (does not have a makefile) # mac \ (does not have a makefile)
# mysql \ (does not have a makefile) # mysql \ (does not have a makefile)
# oracle \ (does not have a makefile) # oracle \ (does not have a makefile)
# pgcrypto \ (non-standard makefile)
# start-scripts \ (does not have a makefile) # start-scripts \ (does not have a makefile)
# tools \ (does not have a makefile) # tools \ (does not have a makefile)
# xml \ (non-standard makefile) # xml \ (non-standard makefile)
......
...@@ -134,7 +134,7 @@ pgbench - ...@@ -134,7 +134,7 @@ pgbench -
by Tatsuo Ishii <t-ishii@sra.co.jp> by Tatsuo Ishii <t-ishii@sra.co.jp>
pgcrypto - pgcrypto -
Cryptographic hash functions Cryptographic functions
by Marko Kreen <marko@l-t.ee> by Marko Kreen <marko@l-t.ee>
retep - retep -
......
# #
# $Header: /cvsroot/pgsql/contrib/pgcrypto/Makefile,v 1.7 2001/09/23 04:12:44 momjian Exp $ # $Header: /cvsroot/pgsql/contrib/pgcrypto/Makefile,v 1.8 2001/09/29 03:11:58 momjian Exp $
# #
subdir = contrib/pgcrypto subdir = contrib/pgcrypto
...@@ -21,7 +21,7 @@ cryptsrc = builtin ...@@ -21,7 +21,7 @@ cryptsrc = builtin
# This works ofcouse only with cryptolib = openssl # This works ofcouse only with cryptolib = openssl
# #
# 'silly' - use libc random() - very weak # 'silly' - use libc random() - very weak
random = dev random = silly
random_dev = \"/dev/urandom\" random_dev = \"/dev/urandom\"
########################## ##########################
...@@ -60,24 +60,18 @@ ifeq ($(random), silly) ...@@ -60,24 +60,18 @@ ifeq ($(random), silly)
CRYPTO_CFLAGS += -DRAND_SILLY CRYPTO_CFLAGS += -DRAND_SILLY
endif endif
NAME := pgcrypto MODULE_big := pgcrypto
SRCS += pgcrypto.c px.c px-hmac.c px-crypt.c misc.c \ SRCS += pgcrypto.c px.c px-hmac.c px-crypt.c misc.c \
crypt-gensalt.c random.c crypt-gensalt.c random.c
OBJS := $(SRCS:.c=.o) OBJS := $(SRCS:.c=.o)
SHLIB_LINK := $(CRYPTO_LDFLAGS) DOCS := README.pgcrypto
SO_MAJOR_VERSION = 0 DATA_built := pgcrypto.sql
SO_MINOR_VERSION = 1 EXTRA_CLEAN := gen-rtab
override CPPFLAGS += $(CRYPTO_CFLAGS) -I$(srcdir)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
rpath :=
all: all-lib $(NAME).sql PG_CPPFLAGS := $(CRYPTO_CFLAGS) -I$(srcdir)
SHLIB_LINK := $(CRYPTO_LDFLAGS)
include $(top_srcdir)/src/Makefile.shlib
$(NAME).sql: $(NAME).sql.in include $(top_srcdir)/contrib/contrib-global.mk
sed 's,@MODULE_FILENAME@,$$libdir/$(NAME),g' $< >$@
rijndael.o: rijndael.tbl rijndael.o: rijndael.tbl
...@@ -85,16 +79,3 @@ rijndael.tbl: ...@@ -85,16 +79,3 @@ rijndael.tbl:
$(CC) $(CPPFLAGS) $(CFLAGS) -DPRINT_TABS rijndael.c -o gen-rtab $(CC) $(CPPFLAGS) $(CFLAGS) -DPRINT_TABS rijndael.c -o gen-rtab
./gen-rtab > rijndael.tbl ./gen-rtab > rijndael.tbl
install: all installdirs
$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/pgcrypto$(DLSUFFIX)
$(INSTALL_DATA) $(NAME).sql $(DESTDIR)$(datadir)/contrib/$(NAME).sql
$(INSTALL_DATA) README.$(NAME) $(DESTDIR)$(docdir)/contrib/README.$(NAME)
installdirs:
$(mkinstalldirs) $(pkglibdir) $(datadir)/contrib $(docdir)/contrib
uninstall: uninstall-lib
rm -f $(DESTDIR)$(pkglibdir)/pgcrypto$(DLSUFFIX) $(datadir)/contrib/$(NAME).sql $(docdir)/contrib/README.$(NAME)
clean distclean maintainer-clean: clean-lib
rm -f $(OBJS) $(NAME).sql gen-rtab
...@@ -9,10 +9,12 @@ INSTALLATION ...@@ -9,10 +9,12 @@ INSTALLATION
Edit makefile, if you want to use any external library. Edit makefile, if you want to use any external library.
NB! Default randomness source is /dev/urandom device. If you NB! Default randomness source is libc random() function. This
do not have it, you also need to edit Makefile to let pgcrypto is so only to get pgcrypto build everywhere. Randomness is
use either OpenSSL PRNG or libc random() PRNG. Using libc random() needed for gen_salt() function. So if you plan using it, you
is discouraged. should definitely change that by editing Makefile. You should
be using urandom device if your OS supports it, otherwise link
pgcrypto against OpenSSL library and use its PRNG.
After editing Makefile: After editing Makefile:
......
...@@ -15,51 +15,51 @@ ...@@ -15,51 +15,51 @@
CREATE FUNCTION digest(bytea, text) RETURNS bytea CREATE FUNCTION digest(bytea, text) RETURNS bytea
AS '@MODULE_FILENAME@', AS 'MODULE_PATHNAME',
'pg_digest' LANGUAGE 'C'; 'pg_digest' LANGUAGE 'C';
CREATE FUNCTION digest_exists(text) RETURNS bool CREATE FUNCTION digest_exists(text) RETURNS bool
AS '@MODULE_FILENAME@', AS 'MODULE_PATHNAME',
'pg_digest_exists' LANGUAGE 'C'; 'pg_digest_exists' LANGUAGE 'C';
CREATE FUNCTION hmac(bytea, bytea, text) RETURNS bytea CREATE FUNCTION hmac(bytea, bytea, text) RETURNS bytea
AS '@MODULE_FILENAME@', AS 'MODULE_PATHNAME',
'pg_hmac' LANGUAGE 'C'; 'pg_hmac' LANGUAGE 'C';
CREATE FUNCTION hmac_exists(text) RETURNS bool CREATE FUNCTION hmac_exists(text) RETURNS bool
AS '@MODULE_FILENAME@', AS 'MODULE_PATHNAME',
'pg_hmac_exists' LANGUAGE 'C'; 'pg_hmac_exists' LANGUAGE 'C';
CREATE FUNCTION crypt(text, text) RETURNS text CREATE FUNCTION crypt(text, text) RETURNS text
AS '@MODULE_FILENAME@', AS 'MODULE_PATHNAME',
'pg_crypt' LANGUAGE 'C'; 'pg_crypt' LANGUAGE 'C';
CREATE FUNCTION gen_salt(text) RETURNS text CREATE FUNCTION gen_salt(text) RETURNS text
AS '@MODULE_FILENAME@', AS 'MODULE_PATHNAME',
'pg_gen_salt' LANGUAGE 'C'; 'pg_gen_salt' LANGUAGE 'C';
CREATE FUNCTION gen_salt(text, int4) RETURNS text CREATE FUNCTION gen_salt(text, int4) RETURNS text
AS '@MODULE_FILENAME@', AS 'MODULE_PATHNAME',
'pg_gen_salt_rounds' LANGUAGE 'C'; 'pg_gen_salt_rounds' LANGUAGE 'C';
CREATE FUNCTION encrypt(bytea, bytea, text) RETURNS bytea CREATE FUNCTION encrypt(bytea, bytea, text) RETURNS bytea
AS '@MODULE_FILENAME@', AS 'MODULE_PATHNAME',
'pg_encrypt' LANGUAGE 'C'; 'pg_encrypt' LANGUAGE 'C';
CREATE FUNCTION decrypt(bytea, bytea, text) RETURNS bytea CREATE FUNCTION decrypt(bytea, bytea, text) RETURNS bytea
AS '@MODULE_FILENAME@', AS 'MODULE_PATHNAME',
'pg_decrypt' LANGUAGE 'C'; 'pg_decrypt' LANGUAGE 'C';
CREATE FUNCTION encrypt_iv(bytea, bytea, bytea, text) RETURNS bytea CREATE FUNCTION encrypt_iv(bytea, bytea, bytea, text) RETURNS bytea
AS '@MODULE_FILENAME@', AS 'MODULE_PATHNAME',
'pg_encrypt_iv' LANGUAGE 'C'; 'pg_encrypt_iv' LANGUAGE 'C';
CREATE FUNCTION decrypt_iv(bytea, bytea, bytea, text) RETURNS bytea CREATE FUNCTION decrypt_iv(bytea, bytea, bytea, text) RETURNS bytea
AS '@MODULE_FILENAME@', AS 'MODULE_PATHNAME',
'pg_decrypt_iv' LANGUAGE 'C'; 'pg_decrypt_iv' LANGUAGE 'C';
CREATE FUNCTION cipher_exists(text) RETURNS bool CREATE FUNCTION cipher_exists(text) RETURNS bool
AS '@MODULE_FILENAME@', AS 'MODULE_PATHNAME',
'pg_cipher_exists' LANGUAGE 'C'; 'pg_cipher_exists' LANGUAGE 'C';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment