From 6409921861a4c77846388247f85e31d44318b771 Mon Sep 17 00:00:00 2001 From: Peter Avalos Date: Sun, 10 Oct 2010 13:28:01 -1000 Subject: [PATCH] Enable DSO support in OpenSSL. OpenSSL can now load engines at run-time. We install a few in /usr/lib/engines/ by default. --- etc/mtree/BSD.usr.dist | 2 ++ secure/lib/libcrypto/Makefile | 15 ++------------- secure/lib/libcrypto/Makefile.inc | 2 +- secure/lib/libcrypto/engines/Makefile | 14 ++++++++++++++ secure/lib/libcrypto/engines/Makefile.inc | 4 ++++ secure/lib/libcrypto/engines/lib4758cca/Makefile | 4 ++++ secure/lib/libcrypto/engines/libaep/Makefile | 4 ++++ secure/lib/libcrypto/engines/libatalla/Makefile | 4 ++++ secure/lib/libcrypto/engines/libcapi/Makefile | 4 ++++ secure/lib/libcrypto/engines/libchil/Makefile | 4 ++++ secure/lib/libcrypto/engines/libcswift/Makefile | 4 ++++ secure/lib/libcrypto/engines/libgmp/Makefile | 4 ++++ secure/lib/libcrypto/engines/libgost/Makefile | 9 +++++++++ secure/lib/libcrypto/engines/libnuron/Makefile | 4 ++++ secure/lib/libcrypto/engines/libpadlock/Makefile | 4 ++++ secure/lib/libcrypto/engines/libsureware/Makefile | 4 ++++ secure/lib/libcrypto/engines/libubsec/Makefile | 4 ++++ share/man/man7/hier.7 | 2 ++ 18 files changed, 78 insertions(+), 14 deletions(-) create mode 100644 secure/lib/libcrypto/engines/Makefile create mode 100644 secure/lib/libcrypto/engines/Makefile.inc create mode 100644 secure/lib/libcrypto/engines/lib4758cca/Makefile create mode 100644 secure/lib/libcrypto/engines/libaep/Makefile create mode 100644 secure/lib/libcrypto/engines/libatalla/Makefile create mode 100644 secure/lib/libcrypto/engines/libcapi/Makefile create mode 100644 secure/lib/libcrypto/engines/libchil/Makefile create mode 100644 secure/lib/libcrypto/engines/libcswift/Makefile create mode 100644 secure/lib/libcrypto/engines/libgmp/Makefile create mode 100644 secure/lib/libcrypto/engines/libgost/Makefile create mode 100644 secure/lib/libcrypto/engines/libnuron/Makefile create mode 100644 secure/lib/libcrypto/engines/libpadlock/Makefile create mode 100644 secure/lib/libcrypto/engines/libsureware/Makefile create mode 100644 secure/lib/libcrypto/engines/libubsec/Makefile diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 9dfc3b624e..e9471656c9 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -16,6 +16,8 @@ lib debug .. + engines + .. gcc41 debug .. diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile index 9bf79fb784..8e2be1b5d9 100644 --- a/secure/lib/libcrypto/Makefile +++ b/secure/lib/libcrypto/Makefile @@ -6,6 +6,8 @@ SHLIB_MAJOR= 5 NOLINT= true +SUBDIR= engines + .if exists(Makefile.man) .include "Makefile.man" .endif @@ -134,17 +136,6 @@ SRCS+= eng_all.c eng_cnf.c eng_cryptodev.c eng_ctrl.c eng_dyn.c eng_err.c \ tb_pkmeth.c tb_rand.c tb_rsa.c tb_store.c INCS+= eng_int.h engine.h -# engines -CFLAGS+=-DOPENSSL_NO_DYNAMIC_ENGINE # needs more hacking -SRCS+= e_4758cca.c e_aep.c e_atalla.c e_capi.c e_chil.c e_cswift.c e_gmp.c \ - e_nuron.c e_padlock.c e_sureware.c e_ubsec.c - -# engines/ccgost -SRCS+= e_gost_err.c gost2001.c gost2001_keyx.c gost89.c gost94_keyx.c \ - gost_ameth.c gost_asn1.c gost_crypt.c gost_ctl.c gost_eng.c \ - gost_keywrap.c gost_md.c gost_params.c gost_pmeth.c gost_sign.c \ - gosthash.c - # err SRCS+= err.c err_all.c err_prn.c INCS+= err.h @@ -386,7 +377,5 @@ opensslconf.h: opensslconf-${MACHINE_ARCH}.h ${LCRYPTO_SRC}/crypto/whrlpool \ ${LCRYPTO_SRC}/crypto/x509 \ ${LCRYPTO_SRC}/crypto/x509v3 \ - ${LCRYPTO_SRC}/engines \ - ${LCRYPTO_SRC}/engines/ccgost \ ${LCRYPTO_SRC} \ ${.CURDIR}/man diff --git a/secure/lib/libcrypto/Makefile.inc b/secure/lib/libcrypto/Makefile.inc index 6bd0f0b3c8..881177713b 100644 --- a/secure/lib/libcrypto/Makefile.inc +++ b/secure/lib/libcrypto/Makefile.inc @@ -6,7 +6,7 @@ OSSLDATE= 2010-06-01 LCRYPTO_SRC= ${.CURDIR}/../../../crypto/openssl LCRYPTO_DOC= ${LCRYPTO_SRC}/doc -CFLAGS+= -DTERMIOS -DANSI_SOURCE -DL_ENDIAN +CFLAGS+= -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIOS CFLAGS+= -I${LCRYPTO_SRC} -I${LCRYPTO_SRC}/crypto \ -I${LCRYPTO_SRC}/crypto/engine -I${.OBJDIR} diff --git a/secure/lib/libcrypto/engines/Makefile b/secure/lib/libcrypto/engines/Makefile new file mode 100644 index 0000000000..14d92d71b8 --- /dev/null +++ b/secure/lib/libcrypto/engines/Makefile @@ -0,0 +1,14 @@ +SUBDIR= lib4758cca \ + libaep \ + libatalla \ + libcapi \ + libchil \ + libcswift \ + libgost \ + libgmp \ + libnuron \ + libpadlock \ + libsureware \ + libubsec + +.include diff --git a/secure/lib/libcrypto/engines/Makefile.inc b/secure/lib/libcrypto/engines/Makefile.inc new file mode 100644 index 0000000000..cae56ecd68 --- /dev/null +++ b/secure/lib/libcrypto/engines/Makefile.inc @@ -0,0 +1,4 @@ +LCRYPTO_SRC= ${.CURDIR}/../../../../../crypto/openssl +SHLIBDIR?= /usr/lib/engines + +.PATH: ${LCRYPTO_SRC}/engines diff --git a/secure/lib/libcrypto/engines/lib4758cca/Makefile b/secure/lib/libcrypto/engines/lib4758cca/Makefile new file mode 100644 index 0000000000..1d30db6556 --- /dev/null +++ b/secure/lib/libcrypto/engines/lib4758cca/Makefile @@ -0,0 +1,4 @@ +SHLIB_NAME= lib4758cca.so +SRCS= e_4758cca.c + +.include diff --git a/secure/lib/libcrypto/engines/libaep/Makefile b/secure/lib/libcrypto/engines/libaep/Makefile new file mode 100644 index 0000000000..25679f5c52 --- /dev/null +++ b/secure/lib/libcrypto/engines/libaep/Makefile @@ -0,0 +1,4 @@ +SHLIB_NAME= libaep.so +SRCS= e_aep.c + +.include diff --git a/secure/lib/libcrypto/engines/libatalla/Makefile b/secure/lib/libcrypto/engines/libatalla/Makefile new file mode 100644 index 0000000000..c7ee704324 --- /dev/null +++ b/secure/lib/libcrypto/engines/libatalla/Makefile @@ -0,0 +1,4 @@ +SHLIB_NAME= libatalla.so +SRCS= e_atalla.c + +.include diff --git a/secure/lib/libcrypto/engines/libcapi/Makefile b/secure/lib/libcrypto/engines/libcapi/Makefile new file mode 100644 index 0000000000..6615cd9154 --- /dev/null +++ b/secure/lib/libcrypto/engines/libcapi/Makefile @@ -0,0 +1,4 @@ +SHLIB_NAME= libcapi.so +SRCS= e_capi.c + +.include diff --git a/secure/lib/libcrypto/engines/libchil/Makefile b/secure/lib/libcrypto/engines/libchil/Makefile new file mode 100644 index 0000000000..01afd7f097 --- /dev/null +++ b/secure/lib/libcrypto/engines/libchil/Makefile @@ -0,0 +1,4 @@ +SHLIB_NAME= libchil.so +SRCS= e_chil.c + +.include diff --git a/secure/lib/libcrypto/engines/libcswift/Makefile b/secure/lib/libcrypto/engines/libcswift/Makefile new file mode 100644 index 0000000000..d5e6a9bb48 --- /dev/null +++ b/secure/lib/libcrypto/engines/libcswift/Makefile @@ -0,0 +1,4 @@ +SHLIB_NAME= libcswift.so +SRCS= e_cswift.c + +.include diff --git a/secure/lib/libcrypto/engines/libgmp/Makefile b/secure/lib/libcrypto/engines/libgmp/Makefile new file mode 100644 index 0000000000..f91fa5f188 --- /dev/null +++ b/secure/lib/libcrypto/engines/libgmp/Makefile @@ -0,0 +1,4 @@ +SHLIB_NAME= libgmp.so +SRCS= e_gmp.c + +.include diff --git a/secure/lib/libcrypto/engines/libgost/Makefile b/secure/lib/libcrypto/engines/libgost/Makefile new file mode 100644 index 0000000000..9bf94708bf --- /dev/null +++ b/secure/lib/libcrypto/engines/libgost/Makefile @@ -0,0 +1,9 @@ +SHLIB_NAME= libgost.so +SRCS= e_gost_err.c gost2001.c gost2001_keyx.c gost89.c gost94_keyx.c \ + gost_ameth.c gost_asn1.c gost_crypt.c gost_ctl.c gost_eng.c \ + gost_keywrap.c gost_md.c gost_params.c gost_pmeth.c gost_sign.c \ + gosthash.c + +.include + +.PATH: ${LCRYPTO_SRC}/engines/ccgost diff --git a/secure/lib/libcrypto/engines/libnuron/Makefile b/secure/lib/libcrypto/engines/libnuron/Makefile new file mode 100644 index 0000000000..f3ef8833ee --- /dev/null +++ b/secure/lib/libcrypto/engines/libnuron/Makefile @@ -0,0 +1,4 @@ +SHLIB_NAME= libnuron.so +SRCS= e_nuron.c + +.include diff --git a/secure/lib/libcrypto/engines/libpadlock/Makefile b/secure/lib/libcrypto/engines/libpadlock/Makefile new file mode 100644 index 0000000000..6ba5582f7e --- /dev/null +++ b/secure/lib/libcrypto/engines/libpadlock/Makefile @@ -0,0 +1,4 @@ +SHLIB_NAME= libpadlock.so +SRCS= e_padlock.c + +.include diff --git a/secure/lib/libcrypto/engines/libsureware/Makefile b/secure/lib/libcrypto/engines/libsureware/Makefile new file mode 100644 index 0000000000..03a714e591 --- /dev/null +++ b/secure/lib/libcrypto/engines/libsureware/Makefile @@ -0,0 +1,4 @@ +SHLIB_NAME= libsureware.so +SRCS= e_sureware.c + +.include diff --git a/secure/lib/libcrypto/engines/libubsec/Makefile b/secure/lib/libcrypto/engines/libubsec/Makefile new file mode 100644 index 0000000000..1316db3044 --- /dev/null +++ b/secure/lib/libcrypto/engines/libubsec/Makefile @@ -0,0 +1,4 @@ +SHLIB_NAME= libubsec.so +SRCS= e_ubsec.c + +.include diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7 index a2c0ea40fa..4d8bf6ace8 100644 --- a/share/man/man7/hier.7 +++ b/share/man/man7/hier.7 @@ -297,6 +297,8 @@ shared libraries for compatibility .It Pa aout/ a.out backward compatibility libraries .El +.It Pa engines/ +OpenSSL dynamic engines .El .Pp .It Pa libdata/ -- 2.41.0