summaryrefslogtreecommitdiffstats
path: root/secure
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-02-26 13:13:03 +0000
committerpeter <peter@FreeBSD.org>2000-02-26 13:13:03 +0000
commit58c2a78aa2a72044e1717c1ff77cfdc9b2dc0463 (patch)
tree4667af4182179bf0fd04fc76aa3c798f4ff9d140 /secure
parent527ba28c8fdf2e7a104fa19c1b56892d2612156b (diff)
downloadFreeBSD-src-58c2a78aa2a72044e1717c1ff77cfdc9b2dc0463.zip
FreeBSD-src-58c2a78aa2a72044e1717c1ff77cfdc9b2dc0463.tar.gz
Merge from internat.freebsd.org repo, minus change to rsa_eay.c (missing)
Reorganize and unify libcrypto's interface so that the RSA implementation is chosen at runtime via dlopen(). This is a checkpoint and may require more tweaks still.
Diffstat (limited to 'secure')
-rw-r--r--secure/lib/Makefile6
-rw-r--r--secure/lib/libcrypto/Makefile15
-rw-r--r--secure/lib/libcrypto/Makefile.inc5
-rw-r--r--secure/lib/librsaintl/Makefile45
-rw-r--r--secure/lib/librsausa/Makefile45
-rw-r--r--secure/usr.bin/openssl/Makefile7
6 files changed, 98 insertions, 25 deletions
diff --git a/secure/lib/Makefile b/secure/lib/Makefile
index 8608de2..8aeb2bf 100644
--- a/secure/lib/Makefile
+++ b/secure/lib/Makefile
@@ -6,6 +6,12 @@ SUBDIR+=libtelnet
.endif
.if !defined(NO_OPENSSL)
SUBDIR+=libcrypto librsaglue libssl
+.if exists(${.CURDIR}/../../crypto/openssl/rsaref)
+SUBDIR+=librsausa
+.endif
+.if exists(${.CURDIR}/../../crypto/openssl/crypto/rsa/rsa_eay.c)
+SUBDIR+=librsaintl
+.endif
.endif
.if !defined(NO_OPENSSH)
SUBDIR+=libssh
diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile
index fd3acc7..6824189 100644
--- a/secure/lib/libcrypto/Makefile
+++ b/secure/lib/libcrypto/Makefile
@@ -125,15 +125,8 @@ SRCS+= rmd_dgst.c rmd_one.c
# rsa
.if defined(WITH_RSA) && ${WITH_RSA} == YES
-SRCS+= rsa_chk.c rsa_err.c rsa_gen.c rsa_lib.c rsa_none.c rsa_oaep.c \
- rsa_pk1.c rsa_saos.c rsa_sign.c rsa_ssl.c
-.if (!defined(RSAREF) || ${RSAREF} != YES) && exists(${LCRYPTO_SRC}/rsa/rsa_eay.c)
-SRCS+= rsa_eay.c # native rsa
-.else
-SRCS+= rsar_err.c rsaref.c rsaref_stubs.c # external rsaref
-HDRS+= ../rsaref/rsaref.h
-CFLAGS+=-DRSAref
-.endif
+SRCS+= rsa_chk.c rsa_gen.c rsa_lib.c rsa_none.c rsa_oaep.c \
+ rsa_pk1.c rsa_saos.c rsa_sign.c rsa_ssl.c rsa_stubs.c
.endif
# sha
@@ -166,10 +159,6 @@ HDRS= asn1/asn1.h asn1/asn1_mac.h bio/bio.h bf/blowfish.h bn/bn.h \
sha/sha.h stack/stack.h tmdiff.h txt_db/txt_db.h x509/x509.h \
x509/x509_vfy.h x509v3/x509v3.h
-.if defined(RSAREF) && ${RSAREF} == YES
-HDRS+= ../rsaref/rsaref.h
-.endif
-
beforedepend: ${.OBJDIR}/obj_dat.h ${.OBJDIR}/buildinf.h \
${.OBJDIR}/openssl/opensslconf.h headers
diff --git a/secure/lib/libcrypto/Makefile.inc b/secure/lib/libcrypto/Makefile.inc
index 11fee3a..6391c68 100644
--- a/secure/lib/libcrypto/Makefile.inc
+++ b/secure/lib/libcrypto/Makefile.inc
@@ -13,9 +13,4 @@ CFLAGS+= -DDEVRANDOM=\"/dev/urandom\"
.endif
.endif
-LOCALBASE?= /usr/local
-
WITH_RSA?= YES
-.if (!defined(USA_RESIDENT) || ${USA_RESIDENT} != NO) && ${WITH_RSA} != NO
-RSAREF= YES
-.endif
diff --git a/secure/lib/librsaintl/Makefile b/secure/lib/librsaintl/Makefile
new file mode 100644
index 0000000..e967203
--- /dev/null
+++ b/secure/lib/librsaintl/Makefile
@@ -0,0 +1,45 @@
+# $FreeBSD$
+
+.include "../libcrypto/Makefile.inc"
+
+# Don't blame kris.. -peter
+MAINTAINER= kris
+
+LIB= rsaINTL
+SHLIB_MAJOR= 1
+
+CFLAGS+= -I${.OBJDIR}
+
+# rsaref
+SRCS+= rsa_err.c rsa_eay.c
+
+HDRS= asn1/asn1.h asn1/asn1_mac.h bio/bio.h bf/blowfish.h bn/bn.h \
+ buffer/buffer.h cast/cast.h comp/comp.h conf/conf.h crypto.h \
+ des/des.h dh/dh.h dsa/dsa.h ../e_os.h ../e_os2.h ebcdic.h \
+ err/err.h evp/evp.h hmac/hmac.h lhash/lhash.h md2/md2.h \
+ md5/md5.h mdc2/mdc2.h objects/objects.h opensslv.h pem/pem.h \
+ pem/pem2.h pkcs12/pkcs12.h pkcs7/pkcs7.h rand/rand.h rc2/rc2.h \
+ rc4/rc4.h rc5/rc5.h ripemd/ripemd.h rsa/rsa.h ../rsaref/rsaref.h \
+ stack/safestack.h sha/sha.h stack/stack.h tmdiff.h txt_db/txt_db.h \
+ x509/x509.h x509/x509_vfy.h x509v3/x509v3.h
+
+beforedepend: headers ${.OBJDIR}/openssl/opensslconf.h
+
+DPADD+= ${.OBJDIR}/openssl/opensslconf.h
+
+CLEANDIRS+= ${.OBJDIR}/openssl
+
+${.OBJDIR}/openssl/opensslconf.h: ../libcrypto/opensslconf-${MACHINE_ARCH}.h
+ @test -d ${.OBJDIR}/openssl || mkdir -p ${.OBJDIR}/openssl; \
+ cp ${.OODATE} ${.TARGET}
+
+headers:
+ @test -d ${.OBJDIR}/openssl || mkdir -p ${.OBJDIR}/openssl; \
+ for i in ${HDRS}; do \
+ ${INSTALL} ${COPY} -m 444 ${LCRYPTO_SRC}/$$i \
+ ${.OBJDIR}/openssl; \
+ done
+
+.PATH: ${LCRYPTO_SRC}/rsa
+
+.include <bsd.lib.mk>
diff --git a/secure/lib/librsausa/Makefile b/secure/lib/librsausa/Makefile
new file mode 100644
index 0000000..9fed9eb
--- /dev/null
+++ b/secure/lib/librsausa/Makefile
@@ -0,0 +1,45 @@
+# $FreeBSD$
+
+.include "../libcrypto/Makefile.inc"
+
+# Don't blame kris.. -peter
+MAINTAINER= kris
+
+LIB= rsaUSA
+SHLIB_MAJOR= 1
+
+CFLAGS+= -I${.OBJDIR}
+
+# rsaref
+SRCS+= rsar_err.c rsaref.c rsaref_stubs.c
+
+HDRS= asn1/asn1.h asn1/asn1_mac.h bio/bio.h bf/blowfish.h bn/bn.h \
+ buffer/buffer.h cast/cast.h comp/comp.h conf/conf.h crypto.h \
+ des/des.h dh/dh.h dsa/dsa.h ../e_os.h ../e_os2.h ebcdic.h \
+ err/err.h evp/evp.h hmac/hmac.h lhash/lhash.h md2/md2.h \
+ md5/md5.h mdc2/mdc2.h objects/objects.h opensslv.h pem/pem.h \
+ pem/pem2.h pkcs12/pkcs12.h pkcs7/pkcs7.h rand/rand.h rc2/rc2.h \
+ rc4/rc4.h rc5/rc5.h ripemd/ripemd.h rsa/rsa.h ../rsaref/rsaref.h \
+ stack/safestack.h sha/sha.h stack/stack.h tmdiff.h txt_db/txt_db.h \
+ x509/x509.h x509/x509_vfy.h x509v3/x509v3.h
+
+beforedepend: headers ${.OBJDIR}/openssl/opensslconf.h
+
+DPADD+= ${.OBJDIR}/openssl/opensslconf.h
+
+CLEANDIRS+= ${.OBJDIR}/openssl
+
+${.OBJDIR}/openssl/opensslconf.h: ../libcrypto/opensslconf-${MACHINE_ARCH}.h
+ @test -d ${.OBJDIR}/openssl || mkdir -p ${.OBJDIR}/openssl; \
+ cp ${.OODATE} ${.TARGET}
+
+headers:
+ @test -d ${.OBJDIR}/openssl || mkdir -p ${.OBJDIR}/openssl; \
+ for i in ${HDRS}; do \
+ ${INSTALL} ${COPY} -m 444 ${LCRYPTO_SRC}/$$i \
+ ${.OBJDIR}/openssl; \
+ done
+
+.PATH: ${LCRYPTO_SRC}/../rsaref
+
+.include <bsd.lib.mk>
diff --git a/secure/usr.bin/openssl/Makefile b/secure/usr.bin/openssl/Makefile
index 697faf1..93c19d8 100644
--- a/secure/usr.bin/openssl/Makefile
+++ b/secure/usr.bin/openssl/Makefile
@@ -15,13 +15,6 @@ CFLAGS+= -DMONOLITH -DNO_IDEA -I${.CURDIR}
WITH_RSA?= YES
.if ${WITH_RSA} == NO
CFLAGS+= -DNO_RSA -DNO_SSL2
-.else
-.if !defined(USA_RESIDENT) || ${USA_RESIDENT} != NO
-RSAREF= YES
-.endif
-.endif
-.if (defined(RSAREF) && ${RSAREF} == YES) || !exists(${LCRYPTO_SRC}/rsa/rsa_eay.c)
-CFLAGS+= -DRSAref
.endif
SRCS= apps.c asn1pars.c ca.c ciphers.c crl.c crl2p7.c dgst.c dh.c \
OpenPOWER on IntegriCloud