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
top_builddir = ..
......@@ -26,6 +26,7 @@ WANTED_DIRS = \
pg_logger \
pg_resetxlog \
pgbench \
pgcrypto \
rserv \
rtree_gist \
seg \
......@@ -41,7 +42,6 @@ WANTED_DIRS = \
# mac \ (does not have a makefile)
# mysql \ (does not have a makefile)
# oracle \ (does not have a makefile)
# pgcrypto \ (non-standard makefile)
# start-scripts \ (does not have a makefile)
# tools \ (does not have a makefile)
# xml \ (non-standard makefile)
......
......@@ -134,7 +134,7 @@ pgbench -
by Tatsuo Ishii <t-ishii@sra.co.jp>
pgcrypto -
Cryptographic hash functions
Cryptographic functions
by Marko Kreen <marko@l-t.ee>
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
......@@ -21,7 +21,7 @@ cryptsrc = builtin
# This works ofcouse only with cryptolib = openssl
#
# 'silly' - use libc random() - very weak
random = dev
random = silly
random_dev = \"/dev/urandom\"
##########################
......@@ -60,24 +60,18 @@ ifeq ($(random), silly)
CRYPTO_CFLAGS += -DRAND_SILLY
endif
NAME := pgcrypto
SRCS += pgcrypto.c px.c px-hmac.c px-crypt.c misc.c \
crypt-gensalt.c random.c
OBJS := $(SRCS:.c=.o)
SHLIB_LINK := $(CRYPTO_LDFLAGS)
SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 1
MODULE_big := pgcrypto
SRCS += pgcrypto.c px.c px-hmac.c px-crypt.c misc.c \
crypt-gensalt.c random.c
OBJS := $(SRCS:.c=.o)
DOCS := README.pgcrypto
DATA_built := pgcrypto.sql
EXTRA_CLEAN := gen-rtab
override CPPFLAGS += $(CRYPTO_CFLAGS) -I$(srcdir)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
rpath :=
PG_CPPFLAGS := $(CRYPTO_CFLAGS) -I$(srcdir)
SHLIB_LINK := $(CRYPTO_LDFLAGS)
all: all-lib $(NAME).sql
include $(top_srcdir)/src/Makefile.shlib
$(NAME).sql: $(NAME).sql.in
sed 's,@MODULE_FILENAME@,$$libdir/$(NAME),g' $< >$@
include $(top_srcdir)/contrib/contrib-global.mk
rijndael.o: rijndael.tbl
......@@ -85,16 +79,3 @@ rijndael.tbl:
$(CC) $(CPPFLAGS) $(CFLAGS) -DPRINT_TABS rijndael.c -o gen-rtab
./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
Edit makefile, if you want to use any external library.
NB! Default randomness source is /dev/urandom device. If you
do not have it, you also need to edit Makefile to let pgcrypto
use either OpenSSL PRNG or libc random() PRNG. Using libc random()
is discouraged.
NB! Default randomness source is libc random() function. This
is so only to get pgcrypto build everywhere. Randomness is
needed for gen_salt() function. So if you plan using it, you
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:
......
......@@ -15,51 +15,51 @@
CREATE FUNCTION digest(bytea, text) RETURNS bytea
AS '@MODULE_FILENAME@',
AS 'MODULE_PATHNAME',
'pg_digest' LANGUAGE 'C';
CREATE FUNCTION digest_exists(text) RETURNS bool
AS '@MODULE_FILENAME@',
AS 'MODULE_PATHNAME',
'pg_digest_exists' LANGUAGE 'C';
CREATE FUNCTION hmac(bytea, bytea, text) RETURNS bytea
AS '@MODULE_FILENAME@',
AS 'MODULE_PATHNAME',
'pg_hmac' LANGUAGE 'C';
CREATE FUNCTION hmac_exists(text) RETURNS bool
AS '@MODULE_FILENAME@',
AS 'MODULE_PATHNAME',
'pg_hmac_exists' LANGUAGE 'C';
CREATE FUNCTION crypt(text, text) RETURNS text
AS '@MODULE_FILENAME@',
AS 'MODULE_PATHNAME',
'pg_crypt' LANGUAGE 'C';
CREATE FUNCTION gen_salt(text) RETURNS text
AS '@MODULE_FILENAME@',
AS 'MODULE_PATHNAME',
'pg_gen_salt' LANGUAGE 'C';
CREATE FUNCTION gen_salt(text, int4) RETURNS text
AS '@MODULE_FILENAME@',
AS 'MODULE_PATHNAME',
'pg_gen_salt_rounds' LANGUAGE 'C';
CREATE FUNCTION encrypt(bytea, bytea, text) RETURNS bytea
AS '@MODULE_FILENAME@',
AS 'MODULE_PATHNAME',
'pg_encrypt' LANGUAGE 'C';
CREATE FUNCTION decrypt(bytea, bytea, text) RETURNS bytea
AS '@MODULE_FILENAME@',
AS 'MODULE_PATHNAME',
'pg_decrypt' LANGUAGE 'C';
CREATE FUNCTION encrypt_iv(bytea, bytea, bytea, text) RETURNS bytea
AS '@MODULE_FILENAME@',
AS 'MODULE_PATHNAME',
'pg_encrypt_iv' LANGUAGE 'C';
CREATE FUNCTION decrypt_iv(bytea, bytea, bytea, text) RETURNS bytea
AS '@MODULE_FILENAME@',
AS 'MODULE_PATHNAME',
'pg_decrypt_iv' LANGUAGE 'C';
CREATE FUNCTION cipher_exists(text) RETURNS bool
AS '@MODULE_FILENAME@',
AS 'MODULE_PATHNAME',
'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