2000-10-31 16:11:28 +03:00
|
|
|
#
|
2001-10-01 02:18:29 +04:00
|
|
|
# $Header: /cvsroot/pgsql/contrib/pgcrypto/Makefile,v 1.9 2001/09/30 22:18:29 momjian Exp $
|
2000-10-31 16:11:28 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
subdir = contrib/pgcrypto
|
|
|
|
top_builddir = ../..
|
|
|
|
include $(top_builddir)/src/Makefile.global
|
|
|
|
|
/contrib/pgcrypto:
* remove support for encode() as it is in main tree now
* remove krb5.c
* new 'PX library' architecture
* remove BSD license from my code to let the general
PostgreSQL one to apply
* md5, sha1: ANSIfy, use const where appropriate
* various other formatting and clarity changes
* hmac()
* UN*X-like crypt() - system or internal crypt
* Internal crypt: DES, Extended DES, MD5, Blowfish
crypt-des.c, crypt-md5.c from FreeBSD
crypt-blowfish.c from Solar Designer
* gen_salt() for crypt() - Blowfish, MD5, DES, Extended DES
* encrypt(), decrypt(), encrypt_iv(), decrypt_iv()
* Cipher support in mhash.c, openssl.c
* internal: Blowfish, Rijndael-128 ciphers
* blf.[ch], rijndael.[ch] from OpenBSD
* there will be generated file rijndael-tbl.inc.
Marko Kreen
2001-08-21 04:42:41 +04:00
|
|
|
# either 'builtin', 'mhash', 'openssl'
|
2000-10-31 16:11:28 +03:00
|
|
|
cryptolib = builtin
|
|
|
|
|
/contrib/pgcrypto:
* remove support for encode() as it is in main tree now
* remove krb5.c
* new 'PX library' architecture
* remove BSD license from my code to let the general
PostgreSQL one to apply
* md5, sha1: ANSIfy, use const where appropriate
* various other formatting and clarity changes
* hmac()
* UN*X-like crypt() - system or internal crypt
* Internal crypt: DES, Extended DES, MD5, Blowfish
crypt-des.c, crypt-md5.c from FreeBSD
crypt-blowfish.c from Solar Designer
* gen_salt() for crypt() - Blowfish, MD5, DES, Extended DES
* encrypt(), decrypt(), encrypt_iv(), decrypt_iv()
* Cipher support in mhash.c, openssl.c
* internal: Blowfish, Rijndael-128 ciphers
* blf.[ch], rijndael.[ch] from OpenBSD
* there will be generated file rijndael-tbl.inc.
Marko Kreen
2001-08-21 04:42:41 +04:00
|
|
|
# either 'builtin', 'system'
|
|
|
|
cryptsrc = builtin
|
|
|
|
|
2001-09-23 08:12:44 +04:00
|
|
|
# Random source, preferred order:
|
|
|
|
# 'dev' - read from random device
|
|
|
|
#
|
|
|
|
# 'openssl' - use openssl PRNG.
|
|
|
|
# Note that currently pgcrypto does not do any
|
|
|
|
# entropy feeding to it
|
|
|
|
# This works ofcouse only with cryptolib = openssl
|
|
|
|
#
|
|
|
|
# 'silly' - use libc random() - very weak
|
2001-09-29 07:11:58 +04:00
|
|
|
random = silly
|
2001-09-23 08:12:44 +04:00
|
|
|
random_dev = \"/dev/urandom\"
|
|
|
|
|
2000-10-31 16:11:28 +03:00
|
|
|
##########################
|
|
|
|
|
|
|
|
ifeq ($(cryptolib), builtin)
|
2001-02-20 18:34:14 +03:00
|
|
|
CRYPTO_CFLAGS =
|
|
|
|
CRYPTO_LDFLAGS =
|
/contrib/pgcrypto:
* remove support for encode() as it is in main tree now
* remove krb5.c
* new 'PX library' architecture
* remove BSD license from my code to let the general
PostgreSQL one to apply
* md5, sha1: ANSIfy, use const where appropriate
* various other formatting and clarity changes
* hmac()
* UN*X-like crypt() - system or internal crypt
* Internal crypt: DES, Extended DES, MD5, Blowfish
crypt-des.c, crypt-md5.c from FreeBSD
crypt-blowfish.c from Solar Designer
* gen_salt() for crypt() - Blowfish, MD5, DES, Extended DES
* encrypt(), decrypt(), encrypt_iv(), decrypt_iv()
* Cipher support in mhash.c, openssl.c
* internal: Blowfish, Rijndael-128 ciphers
* blf.[ch], rijndael.[ch] from OpenBSD
* there will be generated file rijndael-tbl.inc.
Marko Kreen
2001-08-21 04:42:41 +04:00
|
|
|
SRCS = md5.c sha1.c internal.c blf.c rijndael.c
|
2000-10-31 16:11:28 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(cryptolib), openssl)
|
2001-02-20 18:34:14 +03:00
|
|
|
CRYPTO_CFLAGS = -I/usr/include/openssl
|
|
|
|
CRYPTO_LDFLAGS = -lcrypto
|
2000-10-31 16:11:28 +03:00
|
|
|
SRCS = openssl.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(cryptolib), mhash)
|
2001-02-20 18:34:14 +03:00
|
|
|
CRYPTO_CFLAGS = -I/usr/local/include
|
/contrib/pgcrypto:
* remove support for encode() as it is in main tree now
* remove krb5.c
* new 'PX library' architecture
* remove BSD license from my code to let the general
PostgreSQL one to apply
* md5, sha1: ANSIfy, use const where appropriate
* various other formatting and clarity changes
* hmac()
* UN*X-like crypt() - system or internal crypt
* Internal crypt: DES, Extended DES, MD5, Blowfish
crypt-des.c, crypt-md5.c from FreeBSD
crypt-blowfish.c from Solar Designer
* gen_salt() for crypt() - Blowfish, MD5, DES, Extended DES
* encrypt(), decrypt(), encrypt_iv(), decrypt_iv()
* Cipher support in mhash.c, openssl.c
* internal: Blowfish, Rijndael-128 ciphers
* blf.[ch], rijndael.[ch] from OpenBSD
* there will be generated file rijndael-tbl.inc.
Marko Kreen
2001-08-21 04:42:41 +04:00
|
|
|
CRYPTO_LDFLAGS = -L/usr/local/lib -lmcrypt -lmhash -lltdl
|
2001-02-20 18:34:14 +03:00
|
|
|
SRCS = mhash.c
|
2000-10-31 16:11:28 +03:00
|
|
|
endif
|
|
|
|
|
/contrib/pgcrypto:
* remove support for encode() as it is in main tree now
* remove krb5.c
* new 'PX library' architecture
* remove BSD license from my code to let the general
PostgreSQL one to apply
* md5, sha1: ANSIfy, use const where appropriate
* various other formatting and clarity changes
* hmac()
* UN*X-like crypt() - system or internal crypt
* Internal crypt: DES, Extended DES, MD5, Blowfish
crypt-des.c, crypt-md5.c from FreeBSD
crypt-blowfish.c from Solar Designer
* gen_salt() for crypt() - Blowfish, MD5, DES, Extended DES
* encrypt(), decrypt(), encrypt_iv(), decrypt_iv()
* Cipher support in mhash.c, openssl.c
* internal: Blowfish, Rijndael-128 ciphers
* blf.[ch], rijndael.[ch] from OpenBSD
* there will be generated file rijndael-tbl.inc.
Marko Kreen
2001-08-21 04:42:41 +04:00
|
|
|
ifeq ($(cryptsrc), builtin)
|
|
|
|
SRCS += crypt-blowfish.c crypt-des.c crypt-md5.c
|
|
|
|
else
|
|
|
|
CRYPTO_CFLAGS += -DPX_SYSTEM_CRYPT
|
2000-10-31 16:11:28 +03:00
|
|
|
endif
|
|
|
|
|
2001-09-23 08:12:44 +04:00
|
|
|
ifeq ($(random), dev)
|
|
|
|
CRYPTO_CFLAGS += -DRAND_DEV=$(random_dev)
|
|
|
|
endif
|
|
|
|
ifeq ($(random), openssl)
|
|
|
|
CRYPTO_CFLAGS += -DRAND_OPENSSL
|
|
|
|
endif
|
|
|
|
ifeq ($(random), silly)
|
|
|
|
CRYPTO_CFLAGS += -DRAND_SILLY
|
|
|
|
endif
|
|
|
|
|
2001-09-29 07:11:58 +04:00
|
|
|
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
|
2000-10-31 16:11:28 +03:00
|
|
|
|
2001-09-29 07:11:58 +04:00
|
|
|
PG_CPPFLAGS := $(CRYPTO_CFLAGS) -I$(srcdir)
|
|
|
|
SHLIB_LINK := $(CRYPTO_LDFLAGS)
|
2000-10-31 16:11:28 +03:00
|
|
|
|
2001-10-01 02:18:29 +04:00
|
|
|
REGRESS := init md5 sha1 hmac-md5 hmac-sha1 blowfish rijndael \
|
|
|
|
crypt-des crypt-md5 crypt-blowfish crypt-xdes
|
|
|
|
|
2001-09-29 07:11:58 +04:00
|
|
|
include $(top_srcdir)/contrib/contrib-global.mk
|
2000-10-31 16:11:28 +03:00
|
|
|
|
/contrib/pgcrypto:
* remove support for encode() as it is in main tree now
* remove krb5.c
* new 'PX library' architecture
* remove BSD license from my code to let the general
PostgreSQL one to apply
* md5, sha1: ANSIfy, use const where appropriate
* various other formatting and clarity changes
* hmac()
* UN*X-like crypt() - system or internal crypt
* Internal crypt: DES, Extended DES, MD5, Blowfish
crypt-des.c, crypt-md5.c from FreeBSD
crypt-blowfish.c from Solar Designer
* gen_salt() for crypt() - Blowfish, MD5, DES, Extended DES
* encrypt(), decrypt(), encrypt_iv(), decrypt_iv()
* Cipher support in mhash.c, openssl.c
* internal: Blowfish, Rijndael-128 ciphers
* blf.[ch], rijndael.[ch] from OpenBSD
* there will be generated file rijndael-tbl.inc.
Marko Kreen
2001-08-21 04:42:41 +04:00
|
|
|
rijndael.o: rijndael.tbl
|
|
|
|
|
|
|
|
rijndael.tbl:
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) -DPRINT_TABS rijndael.c -o gen-rtab
|
|
|
|
./gen-rtab > rijndael.tbl
|
|
|
|
|