Switch base to use private LibreSSL libaries
authorJohn Marino <draco@marino.st>
Wed, 7 Sep 2016 22:33:17 +0000 (17:33 -0500)
committerJohn Marino <draco@marino.st>
Wed, 7 Sep 2016 22:33:17 +0000 (17:33 -0500)
All base users of the OpenSSL libraries (libssl.so and libcrypto.so) have
been modified to link against the new LibreSSL versions instead.

The OpenSSL libraries are still built by default, but nothing in base will
use them.  However, its certain that a myriad of dports link to OpenSSL
although this may change in the future.

The OpenSSL library building can be suppressed by putting NO_OPENSSL in
/etc/make.conf.  The existing OpenSSL libraries and headers are not (yet)
removed, however, even with that setting.

49 files changed:
bin/ed/Makefile
etc/Makefile
games/factor/Makefile
gnu/sbin/Makefile
gnu/sbin/cryptsetup/Makefile
lib/libfetch/Makefile
lib/libradius/Makefile
lib/libtelnet/Makefile
lib/pam_module/Makefile
lib/pam_module/pam_ssh/Makefile
libexec/dma/Makefile
libexec/dma/dma/Makefile
libexec/telnetd/Makefile
sbin/Makefile
sbin/cryptdisks/Makefile
sbin/hammer2/Makefile
sbin/tcplay/Makefile
secure/Makefile.ssh.common
secure/lib/Makefile
secure/libexec/Makefile
secure/usr.bin/Makefile
secure/usr.bin/bdes/Makefile
secure/usr.bin/openssl/Makefile
secure/usr.bin/sftp/Makefile
secure/usr.bin/ssh/Makefile
secure/usr.sbin/Makefile
secure/usr.sbin/sshd/Makefile
share/initrd/bin/Makefile
share/initrd/sbin.libcrypto/Makefile
tools/tools/crypto/Makefile
tools/tools/net80211/Makefile
tools/tools/net80211/w00t/Makefile.inc
usr.bin/Makefile
usr.bin/chkey/Makefile
usr.bin/dc/Makefile
usr.bin/drill/Makefile
usr.bin/fetch/Makefile
usr.bin/ftp/Makefile
usr.bin/newkey/Makefile
usr.bin/telnet/Makefile
usr.sbin/802_11/Makefile
usr.sbin/802_11/Makefile.crypto
usr.sbin/Makefile
usr.sbin/keyserv/Makefile
usr.sbin/ppp/Makefile
usr.sbin/ppp/chap_ms.c
usr.sbin/pppd/Makefile
usr.sbin/pppd/chap_ms.c
usr.sbin/tcpdump/Makefile

index 33b2f93..556b1d5 100644 (file)
@@ -6,10 +6,11 @@ SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
 LINKS= ${BINDIR}/ed ${BINDIR}/red
 MLINKS=        ed.1 red.1
 
-.if !defined(NO_CRYPT) && !defined(NO_OPENSSL)
-CFLAGS+=-DDES
-DPADD= ${LIBCRYPTO}
-LDADD= -lcrypto
+.if !defined(NO_CRYPT) && !defined(NO_LIBRESSL)
+CFLAGS+=       -DDES -I${.CURDIR}/../../crypto/libressl/include
+DPADD=         ${LIBRECRYPTO}
+LDADD=         -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 .endif
 
 .include <bsd.prog.mk>
index 781b8b3..5379c11 100644 (file)
@@ -39,7 +39,7 @@ BIN1+=        manpath.config
 BIN1+= ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config
 .endif
 
-.if exists(${.CURDIR}/../crypto) && !defined(NO_OPENSSL)
+.if !defined(NO_LIBRESSL)
 DIRS+= secure/lib/libssh \
        secure/usr.bin/ssh \
        secure/usr.sbin/sshd \
index 486ba32..588542f 100644 (file)
@@ -1,15 +1,15 @@
 #      @(#)Makefile    8.1 (Berkeley) 5/31/93
 # $FreeBSD: src/games/factor/Makefile,v 1.2.6.2 2002/10/23 14:59:14 fanf Exp $
-# $DragonFly: src/games/factor/Makefile,v 1.4 2006/10/08 16:22:35 pavalos Exp $
 
 PROG=  factor
 SRCS=  factor.c pr_tbl.c
 CFLAGS+=-I${.CURDIR}/../primes
 
-.if exists(${.CURDIR}/../../crypto) && !defined(NO_OPENSSL)
-CFLAGS+=-DHAVE_OPENSSL
-LDADD+=        -lcrypto
-DPADD+=        ${LIBCRYPTO}
+.if !defined(NO_CRYPT) && !defined(NO_LIBRESSL)
+CFLAGS+=       -DHAVE_OPENSSL -I${.CURDIR}/../../crypto/libressl/include
+LDADD=         -lprivate_crypto
+DPADD=         ${LIBRECRYPTO}
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 .endif
 
 MAN=   factor.6
index 4e24336..cbdc273 100644 (file)
@@ -1,6 +1,13 @@
 # $FreeBSD: src/gnu/usr.bin/Makefile,v 1.51 2000/01/16 00:11:34 obrien Exp $
-# $DragonFly: src/gnu/usr.bin/Makefile,v 1.32 2007/09/05 21:40:10 pavalos Exp $
 
-SUBDIR= cryptsetup dmsetup lvm
+SUBDIR= dmsetup lvm
+
+.if !defined(NO_LIBRESSL)
+SUBDIR+= cryptsetup
+.endif
+
+# maximum parallelism
+#
+SUBDIR_ORDERED=
 
 .include <bsd.subdir.mk>
index 11a38a3..8c365e1 100644 (file)
@@ -21,8 +21,13 @@ MAN=         cryptsetup.8
 CFLAGS+=       -I${CRYPTSETUP_SRCDIR} -I${CRYPTSETUP_LIBDIR} \
                -I${CRYPTSETUP_LUKSDIR} -I. -I${CRYPTSETUP_DIR} -D_BSD_SOURCE
 
-LDADD+=                -ldm -lprop -lcrypto
-DPADD+=                ${LIBDM} ${LIBPROP} ${LIBCRYPTO}
+DPADD+=                ${LIBDM} ${LIBPROP}
+LDADD+=                -ldm -lprop
+
+DPADD+=                ${LIBRECRYPTO}
+LDADD+=                -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../../crypto/libressl/include
 
 .PATH: ${CRYPTSETUP_SRCDIR}
 .PATH: ${CRYPTSETUP_LUKSDIR}
index e33eecb..a4b8347 100644 (file)
@@ -10,10 +10,11 @@ MAN=                fetch.3
 CLEANFILES=    ftperr.h httperr.h
 NO_STRICT_ALIASING=
 
-.if !defined(NO_CRYPT) && !defined(NO_OPENSSL)
-CFLAGS+=       -DWITH_SSL
-DPADD=         ${LIBSSL} ${LIBCRYPTO}
-LDADD=         -lssl -lcrypto
+.if !defined(NO_CRYPT) && !defined(NO_LIBRESSL)
+CFLAGS+=       -DWITH_SSL -I${.CURDIR}/../../crypto/libressl/include
+DPADD=         ${LIBRESSL} ${LIBRECRYPTO}
+LDADD=         -lprivate_ssl -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 .else
 DPADD=         ${LIBMD}
 LDADD=         -lmd
index ba1cf5b..b1d6b6c 100644 (file)
@@ -28,10 +28,11 @@ LIB=                radius
 SRCS=          radlib.c
 INCS=          radlib.h radlib_vs.h
 
-.if !defined(NO_CRYPT) && !defined(NO_OPENSSL)
-DPADD=         ${LIBCRYPTO}
-LDADD=         -lcrypto
-CFLAGS+=       -DWITH_SSL
+.if !defined(NO_CRYPT) && !defined(NO_LIBRESSL)
+DPADD=         ${LIBRECRYPTO}
+LDADD=         -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -DWITH_SSL -I${.CURDIR}/../../crypto/libressl/include
 .else
 DPADD=         ${LIBMD}
 LDADD=         -lmd
index 3256a7d..7b3feaf 100644 (file)
@@ -1,6 +1,5 @@
 #      From: @(#)Makefile      8.2 (Berkeley) 12/15/93
 # $FreeBSD: src/lib/libtelnet/Makefile,v 1.25 2009/02/26 21:43:15 ed Exp $
-# $DragonFly: src/lib/libtelnet/Makefile,v 1.3 2005/04/20 20:07:19 joerg Exp $
 
 LIB=           telnet
 
@@ -10,7 +9,7 @@ SRCS=          genget.c getent.c misc.c
 
 WARNS?=                2
 
-.if !defined(NO_OPENSSL)
+.if !defined(NO_LIBRESSL)
 SRCS+=         encrypt.c auth.c enc_des.c sra.c pk.c
 CFLAGS+=       -DENCRYPTION -DAUTHENTICATION -DSRA
 .endif
index b5196f9..cee147f 100644 (file)
@@ -19,8 +19,15 @@ SUBDIR=      pam_chroot \
        pam_rootok \
        pam_securetty \
        pam_self \
-       pam_ssh \
        pam_tacplus \
        pam_unix
 
+.if !defined(NO_LIBRESSL)
+SUBDIR+= pam_ssh
+.endif
+
+# maximum parallelism
+#
+SUBDIR_ORDERED=
+
 .include <bsd.subdir.mk>
index 750a0f2..6512979 100644 (file)
@@ -1,15 +1,13 @@
-# $DragonFly: src/lib/pam_module/pam_ssh/Makefile,v 1.3 2008/04/07 01:20:18 pavalos Exp $
-
 LIB=   pam_ssh
 SRCS=  pam_ssh.c
 MAN=   pam_ssh.8
+WARNS?=        4
 
-LDADD= -lprivate_ssh -lcrypto -lcrypt
-DPADD= ${LIBSSH} ${LIBCRYPTO} ${LIBCRYPT}
+LDADD=         -lprivate_ssh -lprivate_crypto -lcrypt
+DPADD=         ${LIBSSH} ${LIBRECRYPTO} ${LIBCRYPT}
 
-WARNS?=        4
-SSHDIR=                ${.CURDIR}/../../../crypto/openssh
-CFLAGS+=       -I${SSHDIR}
-LDFLAGS+=      -rpath /usr/lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../../crypto/openssh
+CFLAGS+=       -I${.CURDIR}/../../../crypto/libressl/include
+LDFLAGS+=      -rpath /lib/priv:/usr/lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 
 .include <bsd.lib.mk>
index 6760740..3afcfbe 100644 (file)
@@ -1,3 +1,11 @@
-SUBDIR=        dma dma-mbox-create default-conf mailer-conf
+SUBDIR=        dma-mbox-create default-conf mailer-conf
+
+.if !defined(NO_LIBRESSL)
+SUBDIR+= dma
+.endif
+
+# maximum parallelism
+#
+SUBDIR_ORDERED=
 
 .include <bsd.subdir.mk>
index 6c26cf0..b318d76 100644 (file)
@@ -1,18 +1,20 @@
 .PATH: ${.CURDIR}/..
 
-CFLAGS+=-I${.CURDIR}/..
-CFLAGS+= -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME
-CFLAGS+=-DCONF_PATH='"/etc/dma"'
-CFLAGS+=-DLIBEXEC_PATH='"/usr/libexec"' -DDMA_VERSION='"v0.9+"'
-
-DPADD=  ${LIBSSL} ${LIBCRYPTO}
-LDADD=  -lssl -lcrypto
-
 PROG=  dma
 SRCS=  aliases_parse.y aliases_scan.l base64.c conf.c crypto.c
 SRCS+= dma.c dns.c local.c mail.c net.c spool.c util.c
 MAN=   dma.8
 
+CFLAGS+=       -I${.CURDIR}/..
+CFLAGS+=       -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME
+CFLAGS+=       -DCONF_PATH='"/etc/dma"'
+CFLAGS+=       -DLIBEXEC_PATH='"/usr/libexec"' -DDMA_VERSION='"v0.9+"'
+
+DPADD=         ${LIBRESSL} ${LIBRECRYPTO}
+LDADD=         -lprivate_ssl -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../../crypto/libressl/include
+
 BINOWN= root
 BINGRP= mail
 BINMODE=2555
index ba7c9c3..c4b3203 100644 (file)
@@ -24,11 +24,12 @@ DPADD=              ${LIBUTIL} ${LIBNCURSES} ${LIBTELNET}
 LDADD=         -lutil -lprivate_ncurses ${LIBTELNET}
 LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 
-.if !defined(NO_OPENSSL)
+.if !defined(NO_LIBRESSL)
 SRCS+=         authenc.c
 CFLAGS+=       -DAUTHENTICATION -DENCRYPTION
-DPADD+=                ${LIBCRYPTO} ${LIBCRYPT} ${LIBPAM}
-LDADD+=                -lcrypto -lcrypt ${MINUSLPAM}
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+DPADD+=                ${LIBRECRYPTO} ${LIBCRYPT} ${LIBPAM}
+LDADD+=                -lprivate_crypto -lcrypt ${MINUSLPAM}
 .endif
 
 .include <bsd.prog.mk>
index c6c5808..9653b25 100644 (file)
@@ -9,7 +9,6 @@ SUBDIR= adjkerntz \
        ccdconfig \
        clri \
        comcontrol \
-       cryptdisks \
        devattr \
        devd \
        devfsctl \
@@ -96,7 +95,6 @@ SUBDIR=       adjkerntz \
        swapon \
        sysctl \
        svc \
-       tcplay \
        tunefs \
        udevd \
        umount \
@@ -117,12 +115,17 @@ SUBDIR+= ${MACHINE}
 SUBDIR+= ${MACHINE_ARCH}
 .endif
 
-# include hammer2 utilities
+.if !defined(NO_LIBRESSL)
+SUBDIR+=cryptdisks \
+       tcplay
+
+# include hammer2 utilities (requires LibreSSL)
 #
-.if defined(WANT_HAMMER2)
+.  if defined(WANT_HAMMER2)
 _mount_hammer2= mount_hammer2
 _newfs_hammer2=        newfs_hammer2
 _hammer2=      hammer2
+.  endif
 .endif
 
 # maximum parallelism
index 1ec09af..48e5a9e 100644 (file)
@@ -4,8 +4,13 @@ NOSHARED=      YES
 
 SRCS+=         cryptdisks.c safe_mem.c
 
-LDADD+=                -lcryptsetup -lluks -ldm -ltcplay -lprop -lcrypto -lutil
-DPADD+=                ${LIBCRYPTSETUP} ${LIBLUKS} ${LIBDM} ${LIBTCPLAY}
-DPADD+=                ${LIBPROP} ${LIBCRYPTO} ${LIBUTIL}
+LDADD=         -lcryptsetup -lluks -ldm -ltcplay -lprop -lutil
+DPADD=         ${LIBCRYPTSETUP} ${LIBLUKS} ${LIBDM} ${LIBTCPLAY}
+DPADD+=                ${LIBPROP} ${LIBUTIL}
+
+DPADD+=                ${LIBRECRYPTO}
+LDADD+=                -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
 
 .include <bsd.prog.mk>
index 029396b..6b318d2 100644 (file)
@@ -12,8 +12,13 @@ DEBUG_FLAGS=-g
 CFLAGS+= -DXXH_NAMESPACE=h2_
 CFLAGS+= -I${.CURDIR}/../../sys
 CFLAGS+= -pthread
-LDADD= -ldmsg -lm -lutil -lmd -lcrypto
-DPADD= ${LIBDMSG} ${LIBM} ${LIBUTIL} ${LIBMD} ${LIBCRYPTO}
+LDADD= -ldmsg -lm -lutil -lmd
+DPADD= ${LIBDMSG} ${LIBM} ${LIBUTIL} ${LIBMD}
+
+DPADD+=                ${LIBRECRYPTO}
+LDADD+=                -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
 
 #.PATH: ${.CURDIR}/../../sys/libkern
 #SRCS+= crc32.c
index 5ccca30..388abed 100644 (file)
@@ -12,8 +12,13 @@ SRCS+=               crypto.c generic_xts.c
 SRCS+=         crypto-dev.c pbkdf2-openssl.c
 SRCS+=         main.c
 
-LDADD= -lcrypto -ldm -lprop -lutil
-DPADD= ${LIBCRYPTO} ${LIBDM} ${LIBPROP} ${LIBUTIL}
+LDADD=         -ldm -lprop -lutil
+DPADD=         ${LIBDM} ${LIBPROP} ${LIBUTIL}
+
+DPADD+=                ${LIBRECRYPTO}
+LDADD+=                -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
 
 CFLAGS+=       -I${TCPLAY_DIR}
 CFLAGS+=       -DMAJ_VER=${MAJ_VER} -DMIN_VER=${MIN_VER}
index a56da4c..7922bf4 100644 (file)
@@ -2,12 +2,13 @@ SSHDIR=               ${.CURDIR}/../../../crypto/openssh
 
 XAUTH_PATH?=   /usr/local/bin/xauth
 CFLAGS+=       -DXAUTH_PATH=\"${XAUTH_PATH}\"
+CFLAGS+=       -I${.CURDIR}/../../../crypto/libressl/include
 CFLAGS+=       -I${.CURDIR}/../../lib/libssh -I${SSHDIR}
 
 .if ${.CURDIR:T} != "libssh"
-DPADD+=        ${LIBSSH} ${LIBCRYPTO} ${LIBUTIL} ${LIBZ} ${LIBPTHREAD}
-LDADD+=        -lprivate_ssh -lcrypto -lutil -lz -lpthread
-LDFLAGS+=      -rpath /usr/lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+DPADD+=                ${LIBSSH} ${LIBRECRYPTO} ${LIBUTIL} ${LIBZ} ${LIBPTHREAD}
+LDADD+=                -lprivate_ssh -lprivate_crypto -lutil -lz -lpthread
+LDFLAGS+=      -rpath /lib/priv:/usr/lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 .endif
 
 .PATH: ${SSHDIR} ${SSHDIR}/openbsd-compat
index 20a34cd..c5931f5 100644 (file)
@@ -3,10 +3,9 @@
 SUBDIR= libcipher
 .if !defined(NO_OPENSSL)
 SUBDIR+=libcrypto libssl
-SUBDIR+=libssh # slated to move to !NO_LIBRESSL block
 .endif
 .if !defined(NO_LIBRESSL)
-SUBDIR+=librecrypto libressl
+SUBDIR+=librecrypto libressl libssh
 .endif
 
 # maximum parallelism
index 1823496..be6bf87 100644 (file)
@@ -1,7 +1,8 @@
 # $FreeBSD: src/secure/libexec/Makefile,v 1.4.2.6 2002/07/05 11:10:51 des Exp $
 
-.if !defined(NO_OPENSSL)
-SUBDIR+=sftp-server ssh-keysign ssh-pkcs11-helper
+SUBDIR=
+.if !defined(NO_LIBRESSL)
+SUBDIR+=       sftp-server ssh-keysign ssh-pkcs11-helper
 .endif
 
 .include <bsd.subdir.mk>
index 41a5b99..17192ff 100644 (file)
@@ -1,6 +1,6 @@
-SUBDIR= bdes
-.if !defined(NO_OPENSSL)
-SUBDIR+=openssl scp sftp ssh ssh-add ssh-agent ssh-keygen ssh-keyscan
+SUBDIR=
+.if !defined(NO_LIBRESSL)
+SUBDIR+=bdes openssl scp sftp ssh ssh-add ssh-agent ssh-keygen ssh-keyscan
 .endif
 
 .include <bsd.subdir.mk>
index d60cff6..3568bd0 100644 (file)
@@ -5,7 +5,8 @@ PROG=   bdes
 
 WARNS?=        2
 
-DPADD= ${LIBCRYPTO}
-LDADD= -lcrypto
+DPADD=         ${LIBRECRYPTO}
+LDADD=         -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 
 .include <bsd.prog.mk>
index ddc08db..22e0f83 100644 (file)
@@ -1,29 +1,27 @@
 # $FreeBSD: src/secure/usr.bin/openssl/Makefile,v 1.11.2.6 2003/02/14 22:38:22 nectar Exp $
-# $DragonFly: src/secure/usr.bin/openssl/Makefile,v 1.6 2005/07/07 12:18:30 corecode Exp $
 
 PROG=  openssl
 WARNS?=        2
 
-DPADD= ${LIBSSL} ${LIBCRYPTO}
-LDADD= -lssl -lcrypto
-
-.if exists(Makefile.man)
 .include "Makefile.man"
-.endif
-.include "../../lib/libcrypto/Makefile.inc"
+.include "${.CURDIR}/../../lib/librecrypto/Makefile.inc"
 
-CFLAGS+= -DMONOLITH -I${.CURDIR}
+DPADD+=                ${LIBRESSL} ${LIBRECRYPTO}
+LDADD+=                -lprivate_ssl -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../../crypto/libressl/include
+CFLAGS+=       -DMONOLITH -I${.CURDIR}
 
-SRCS=  openssl.c
-SRCS+= verify.c asn1pars.c req.c dgst.c dh.c dhparam.c enc.c passwd.c gendh.c errstr.c \
-       ca.c pkcs7.c crl2p7.c crl.c \
-       rsa.c rsautl.c dsa.c dsaparam.c ec.c ecparam.c \
-       x509.c genrsa.c gendsa.c genpkey.c s_server.c s_client.c speed.c \
-       s_time.c apps.c s_cb.c s_socket.c app_rand.c version.c sess_id.c \
-       ciphers.c nseq.c pkcs12.c pkcs8.c pkey.c pkeyparam.c pkeyutl.c \
-       spkac.c smime.c cms.c rand.c engine.c ocsp.c prime.c ts.c srp.c
+SRCS=  apps.c apps_posix.c asn1pars.c ca.c certhash.c ciphers.c cms.c crl.c \
+       crl2p7.c dgst.c dh.c dhparam.c dsa.c dsaparam.c ec.c ecparam.c enc.c \
+       errstr.c gendh.c gendsa.c genpkey.c genrsa.c nseq.c ocsp.c \
+       openssl.c passwd.c pkcs12.c pkcs7.c pkcs8.c pkey.c pkeyparam.c \
+       pkeyutl.c prime.c rand.c req.c rsa.c rsautl.c s_cb.c s_client.c \
+       s_server.c s_socket.c s_time.c sess_id.c smime.c speed.c spkac.c ts.c \
+       verify.c version.c x509.c
 
 .include <bsd.prog.mk>
 
-.PATH: ${LCRYPTO_SRC}/apps \
+.PATH: ${LIBRESSL_SRC}/apps/openssl \
        ${.CURDIR}/man
+
index dfc9ab0..0bd86df 100644 (file)
@@ -9,7 +9,8 @@ SRCS+=  fmt_scaled.c
 
 DPADD+=        ${LIBEDIT} ${LIBNCURSES}
 LDADD+=        -lprivate_edit -lprivate_ncurses
-LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+# LDFLAGS is set to same value by Makefile.ssh.common so avoid duplication
+#LDFLAGS+=     -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 
 .include "../../Makefile.ssh.common"
 .include <bsd.prog.mk>
index e321712..50e168a 100644 (file)
@@ -10,5 +10,8 @@ SRCS= ssh.c readconf.c clientloop.c sshtty.c \
        sshconnect.c sshconnect1.c sshconnect2.c mux.c
 SRCS+= fmt_scaled.c
 
+XAUTH_PATH?=   /usr/local/bin/xauth
+CFLAGS+=       -DXAUTH_PATH=\"${XAUTH_PATH}\"
+
 .include "../../Makefile.ssh.common"
 .include <bsd.prog.mk>
index 9a07f2c..a5bc62e 100644 (file)
@@ -1,7 +1,7 @@
 # $FreeBSD: src/secure/usr.sbin/Makefile,v 1.1.2.1 2000/07/30 22:26:29 kris Exp $
 
-SUBDIR= 
-.if !defined(NO_OPENSSL)
+SUBDIR=
+.if !defined(NO_LIBRESSL)
 SUBDIR+=sshd
 .endif
 
index b1c2b7a..e2d4b87 100644 (file)
@@ -34,5 +34,8 @@ DPADD+=       ${LIBOPIE}
 LDADD+=        -lcrypt -lwrap ${MINUSLPAM}
 DPADD+=        ${LIBCRYPT} ${LIBWRAP} ${LIBPAM}
 
+XAUTH_PATH?=   /usr/local/bin/xauth
+CFLAGS+=       -DXAUTH_PATH=\"${XAUTH_PATH}\"
+
 .include "../../Makefile.ssh.common"
 .include <bsd.prog.mk>
index c5040ba..f9665f0 100644 (file)
@@ -63,7 +63,7 @@ CRUNCH_ALIAS_ssh= scp
 
 CRUNCH_KEEP_ssh= roaming_write roaming_read add_recv_bytes
 
-CRUNCH_LIBS+=  -lprivate_ssh -lcrypto -lz -lpthread \
+CRUNCH_LIBS+=  -lprivate_ssh -lprivate_crypto -lz -lpthread \
                -rpath /lib/priv:/usr/lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 
 .include <bsd.crunchgen.mk>
index a4b86ef..542a39d 100644 (file)
@@ -18,7 +18,8 @@ CRUNCH_LIBS+= -ldm -lprop -lutil
 
 CRUNCH_SRCDIRS+= usr.sbin/802_11
 CRUNCH_PROGS_usr.sbin/802_11= wpa_supplicant
-CRUNCH_LIBS+= -lpcap -lssl -lcrypto
+CRUNCH_LIBS+= -lpcap -lprivate_ssl -lprivate_crypto
+CRUNCH_LIBS+= -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 
 .include <bsd.crunchgen.mk>
 .include <bsd.prog.mk>
index 2915599..c9e90a7 100644 (file)
@@ -33,7 +33,9 @@ all:  ${ALL}
 
 # program to test asymmetric crypto functions
 cryptokeytest: cryptokeytest.c
-       ${CC} -o cryptokeytest cryptokeytest.c -lcrypto
+       ${CC} -o cryptokeytest cryptokeytest.c \
+        -rpath /lib/priv:/usr/lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv \
+        -lprivate_crypto
 
 # program to dump statistics kept by the core crypto code
 cryptostats: cryptostats.c
index ad10956..f2a9db4 100644 (file)
@@ -1,5 +1,13 @@
 #      $FreeBSD: src/tools/tools/net80211/Makefile,v 1.6 2009/01/12 22:50:55 sam Exp $
 
-SUBDIR=        stumbler w00t wesside wlaninject wlanstats wlantxtime wlanwatch wlanwds
+SUBDIR=        stumbler wesside wlaninject wlanstats wlantxtime wlanwatch wlanwds
+
+.if !defined(NO_LIBRESSL)
+SUBDIR+= w00t
+.endif
+
+# maximum parallelism
+#
+SUBDIR_ORDERED=
 
 .include <bsd.subdir.mk>
index 43aa299..c7bb6d8 100644 (file)
@@ -1,12 +1,17 @@
 # $FreeBSD: src/tools/tools/net80211/w00t/Makefile.inc,v 1.2 2010/02/25 14:42:26 ru Exp $
 
-W00T=  ../libw00t
+W00T=  ${.CURDIR}/../libw00t
 # NB: we get crc32 from -lz
-DPADD= ${W00T}/libw00t.a ${LIBCRYPTO} ${LIBZ}
-LDFLAGS= -L${W00T}
-LDADD= -lw00t  -lcrypto -lz
+DPADD=         ${W00T}/libw00t.a ${LIBZ}
+LDADD=         -lw00t -lz
+LDFLAGS=       -L${W00T}
+
+DPADD+=                ${LIBRECRYPTO}
+LDADD+=                -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../../../../crypto/libressl/include
 
 BINDIR=        /usr/local/bin
-CFLAGS       -g -I${W00T}
+CFLAGS+=       -g -I${W00T}
 
 NOMAN=
index 0952f8c..2dd2aaf 100644 (file)
@@ -19,6 +19,7 @@ SUBDIR=       alias \
        awk \
        banner \
        basename \
+       bc \
        biff \
        bmake \
        brandelf \
@@ -35,7 +36,6 @@ SUBDIR=       alias \
        checknr \
        checkpt \
        chflags \
-       chkey \
        chpass \
        cksum \
        cmp \
@@ -52,7 +52,6 @@ SUBDIR=       alias \
        cut \
        dfregress \
        dirname \
-       drill \
        du \
        ee \
        enigma \
@@ -60,7 +59,6 @@ SUBDIR=       alias \
        evtranalyze \
        expand \
        false \
-       fetch \
        file \
        file2c \
        find \
@@ -71,7 +69,6 @@ SUBDIR=       alias \
        from \
        fstat \
        fsync \
-       ftp \
        gcore \
        gencat \
        getconf \
@@ -133,7 +130,6 @@ SUBDIR=     alias \
        ncal \
        netstat \
        newgrp \
-       newkey \
        nfsstat \
        nice \
        nl \
@@ -192,7 +188,6 @@ SUBDIR=     alias \
        tar \
        tcopy \
        tee \
-       telnet \
        tftp \
        time \
        tic \
@@ -252,9 +247,16 @@ SUBDIR=    alias \
 SUBDIR+=hesinfo
 .endif
 
-.if !defined(NO_OPENSSL)
-SUBDIR+=bc \
-       dc
+# Uses LibreSSL but can build without it
+SUBDIR+=ftp \
+       telnet
+
+.if !defined(NO_LIBRESSL)
+SUBDIR+=chkey \
+       dc \
+       drill \
+       fetch \
+       newkey
 .endif
 
 .include <bsd.subdir.mk>
index 957e4c1..9b66abe 100644 (file)
@@ -1,12 +1,16 @@
 # $FreeBSD: src/usr.bin/chkey/Makefile,v 1.3.2.1 2001/08/02 01:18:09 obrien Exp $
-# $DragonFly: src/usr.bin/chkey/Makefile,v 1.5 2007/08/27 16:50:52 pavalos Exp $
 
 .PATH: ${.CURDIR}/../newkey
 
 PROG=  chkey
 SRCS=  chkey.c generic.c update.c
 CFLAGS+=-DYP -I${.CURDIR}/../newkey
-DPADD= ${LIBRPCSVC} ${LIBCRYPTO}
-LDADD= -lrpcsvc -lcrypto
+DPADD= ${LIBRPCSVC}
+LDADD= -lrpcsvc
+
+DPADD+=                ${LIBRECRYPTO}
+LDADD+=                -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
 
 .include <bsd.prog.mk>
index e05e057..7b68ba3 100644 (file)
@@ -1,10 +1,12 @@
 #      $OpenBSD: Makefile,v 1.1 2003/09/19 17:58:25 otto Exp $
-#      $DragonFly: src/usr.bin/dc/Makefile,v 1.3 2007/08/27 16:50:52 pavalos Exp $
 
 PROG=  dc
 SRCS=  dc.c bcode.c inout.c mem.c stack.c
 WARNS?=        2
-DPADD= ${LIBCRYPTO}
-LDADD= -lcrypto
+
+DPADD=         ${LIBRECRYPTO}
+LDADD=         -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
 
 .include <bsd.prog.mk>
index b2efb03..d922606 100644 (file)
@@ -1,15 +1,17 @@
-PROG=  drill
-LDNS=  ${.CURDIR}/../../contrib/ldns
+PROG=          drill
+LDNS=          ${.CURDIR}/../../contrib/ldns
 LDNSBASE=      ${.CURDIR}/../../lib/libldns
-SRCS=  chasetrace.c dnssec.c drill.c drill_util.c \
-       error.c root.c securetrace.c work.c
+SRCS=          chasetrace.c dnssec.c drill.c drill_util.c \
+               error.c root.c securetrace.c work.c
 WARNS?= 2
 
 .PATH: ${.CURDIR}/../../contrib/ldns/drill
 
-LDADD+=        -lprivate_ldns -lcrypto
-DPADD+=        ${LIBLDNS} ${LIBCRYPTO}
-CFLAGS+=-I${.CURDIR} -I${LDNS} -I${LDNS}/drill -I${LDNSBASE}
-LDFLAGS+=      -rpath /usr/lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+LDADD=         -lprivate_ldns -lprivate_crypto
+DPADD=         ${LIBLDNS} ${LIBRECRYPTO}
+CFLAGS+=       -I${.CURDIR} -I${LDNS} -I${LDNS}/drill -I${LDNSBASE}
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+LDFLAGS+=      -rpath /lib/priv:/usr/lib/priv -L \
+               ${_SHLIBDIRPREFIX}/usr/lib/priv
 
 .include <bsd.prog.mk>
index 04bb39c..26a7f64 100644 (file)
@@ -3,9 +3,10 @@
 PROG=          fetch
 DPADD=         ${LIBFETCH}
 LDADD=         -lfetch
-.if !defined(NO_CRYPT) && !defined(NO_OPENSSL)
-DPADD+=                ${LIBSSL} ${LIBCRYPTO}
-LDADD+=                -lssl -lcrypto
-.endif
+
+DPADD+=                ${LIBRESSL} ${LIBRECRYPTO}
+LDADD+=                -lprivate_ssl -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
 
 .include <bsd.prog.mk>
index 3016afc..438d8b3 100644 (file)
@@ -20,11 +20,11 @@ LDADD=      -lprivate_edit -lprivate_ncurses -lutil
 DPADD= ${LIBEDIT} ${LIBNCURSES} ${LIBUTIL}
 LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 
-.if !defined(NO_OPENSSL)
-SRCS+= ssl.c
-CFLAGS+=-DWITH_SSL
-LDADD+=        -lssl -lcrypto
-DPADD+=        ${LIBSSL} ${LIBCRYPTO}
+.if !defined(NO_LIBRESSL)
+SRCS+=         ssl.c
+CFLAGS+=       -DWITH_SSL -I${.CURDIR}/../../crypto/libressl/include
+LDADD+=                -lprivate_ssl -lprivate_crypto
+DPADD+=                ${LIBRESSL} ${LIBRECRYPTO}
 .endif
 
 LINKS= ${BINDIR}/ftp ${BINDIR}/pftp \
index ac19573..0c04cce 100644 (file)
@@ -1,5 +1,4 @@
 # $FreeBSD: src/usr.bin/newkey/Makefile,v 1.3.2.1 2001/04/25 11:29:30 ru Exp $
-# $DragonFly: src/usr.bin/newkey/Makefile,v 1.5 2007/08/27 16:50:57 pavalos Exp $
 
 PROG= newkey
 SRCS= newkey.c update.c generic.c
@@ -8,7 +7,12 @@ MAN= newkey.8
 # Later
 #CFLAGS+= -DYP
 
-DPADD= ${LIBRPCSVC} ${LIBCRYPTO}
-LDADD= -lrpcsvc -lcrypto
+DPADD= ${LIBRPCSVC}
+LDADD= -lrpcsvc
+
+DPADD+=                ${LIBRECRYPTO}
+LDADD+=                -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
 
 .include <bsd.prog.mk>
index ca2f61b..d89cb3e 100644 (file)
@@ -24,11 +24,13 @@ CFLAGS+=    -DIPSEC
 DPADD+=                ${LIBIPSEC}
 LDADD+=                -lipsec
 
-.if !defined(NO_OPENSSL)
+.if !defined(NO_LIBRESSL)
 SRCS+=         authenc.c
 CFLAGS+=       -DENCRYPTION -DAUTHENTICATION
-DPADD+=                ${LIBCRYPTO} ${LIBCRYPT} ${LIBPAM}
-LDADD+=                -lcrypto -lcrypt ${MINUSLPAM}
+DPADD+=                ${LIBRECRYPTO} ${LIBCRYPT} ${LIBPAM}
+LDADD+=                -lprivate_crypto -lcrypt ${MINUSLPAM}
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
 .endif
 
 .include <bsd.prog.mk>
index 68be828..629ebef 100644 (file)
@@ -1,4 +1,8 @@
-SUBDIR=        ndis_events wpa_cli wpa_passphrase wpa_supplicant
+SUBDIR=        ndis_events wpa_cli wpa_passphrase
+
+.if !defined(NO_LIBRESSL)
+SUBDIR+= wpa_supplicant
+.endif
 
 SUBDIR_ORDERED=                # maximum parallelism
 
index 09608d3..7c0ce62 100644 (file)
@@ -1,26 +1,10 @@
 # $FreeBSD: head/usr.sbin/wpa/Makefile.crypto 252726 2013-07-04 21:12:58Z rpaulo $
 
-#.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH)
-SRCS+= crypto_openssl.c random.c sha1-prf.c sha256-prf.c
-DPADD+=        ${LIBSSL} ${LIBCRYPTO}
-LDADD+=        -lssl -lcrypto
-CFLAGS+= -DCONFIG_SHA256
-#.else
-#CFLAGS+=-DCONFIG_CRYPTO_INTERNAL
-#SRCS+=        crypto_internal.c random.c
-#CONFIG_INTERNAL_AES=y
-#CONFIG_INTERNAL_DES=y
-#CONFIG_INTERNAL_MD4=y
-#CONFIG_INTERNAL_MD5=y
-#CONFIG_INTERNAL_RC4=y
-#CONFIG_INTERNAL_SHA1=y
-#NEED_SHA256=y
-#CONFIG_INTERNAL_SHA256=y
-#CONFIG_INTERNAL_TLS=y
-#CONFIG_INTERNAL_DH5=y
-#CONFIG_INTERNAL_DH=y
-#NEED_AES_ENC=true
-#.endif
+SRCS+=         crypto_openssl.c random.c sha1-prf.c sha256-prf.c
+DPADD+=                ${LIBRESSL} ${LIBRECRYPTO}
+LDADD+=                -lprivate_ssl -lprivate_crypto
+CFLAGS+=       -DCONFIG_SHA256 -I${.CURDIR}/../../crypto/libressl/include
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 
 .if defined(TLS_FUNCS)
 NEED_TLS_PRF=y
index 6ccbc10..e7d71cc 100644 (file)
@@ -50,7 +50,6 @@ SUBDIR= 802_11 \
        kbdcontrol \
        kbdmap \
        kernbb \
-       keyserv \
        lastlogin \
        mailwrapper \
        makewhatis \
@@ -76,9 +75,7 @@ SUBDIR= 802_11 \
        pfctl \
        pflogd \
        powerd \
-       ppp \
        pppctl \
-       pppd \
        pppstats \
        prefix \
        procctl \
@@ -122,7 +119,6 @@ SUBDIR= 802_11 \
        tcpdchk \
        tcpdmatch \
        tcpdrop \
-       tcpdump \
        timed \
        traceroute \
        traceroute6 \
@@ -145,6 +141,15 @@ SUBDIR= 802_11 \
        ypset \
        zic
 
+# Uses LibreSSL but can build without it
+SUBDIR+=ppp \
+       pppd \
+       tcpdump
+
+.if !defined(NO_LIBRESSL)
+SUBDIR+=keyserv
+.endif
+
 .if !defined(NO_LPR)
 SUBDIR+=lpr
 .endif
index ddb6468..fa0abca 100644 (file)
@@ -8,8 +8,13 @@ MAN=   keyserv.8
 
 CFLAGS+= -DKEYSERV_RANDOM -DBROKEN_DES -I.
 
-DPADD= ${LIBCRYPTO} ${LIBRPCSVC}
-LDADD= -lcrypto -lrpcsvc
+DPADD= ${LIBRPCSVC}
+LDADD= -lrpcsvc
+
+DPADD+=                ${LIBRECRYPTO}
+LDADD+=                -lprivate_crypto
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
 
 RPCDIR=        ${DESTDIR}/usr/include/rpcsvc
 
index d955c26..31efc02 100644 (file)
@@ -54,12 +54,14 @@ CFLAGS+=-DNOSUID
 SRCS+= id.c
 .endif
 
-.if !exists(${.CURDIR}/../../secure) || defined(NO_CRYPT) || defined(NO_OPENSSL) || defined(NODES)
+.if defined(NO_CRYPT) || defined(NO_LIBRESSL) || defined(NODES)
 CFLAGS+=-DNODES
 .else
-SRCS+= chap_ms.c mppe.c
-LDADD+= -lcrypto
-DPADD+= ${LIBCRYPTO}
+SRCS+=         chap_ms.c mppe.c
+LDADD+=        -lprivate_crypto
+DPADD+=        ${LIBRECRYPTO}
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
 .endif
 
 .if defined(NORADIUS)
index 89f1ee3..4ccb5dc 100644 (file)
@@ -27,7 +27,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/usr.sbin/ppp/chap_ms.c,v 1.9.2.6 2002/09/01 02:12:23 brian Exp $
- * $DragonFly: src/usr.sbin/ppp/chap_ms.c,v 1.4 2004/03/27 01:39:13 cpressey Exp $
  */
 
 #include <ctype.h>
@@ -104,18 +103,18 @@ MakeKey(u_char *key, u_char *des_key)
     des_key[6] = Get7Bits(key, 42);
     des_key[7] = Get7Bits(key, 49);
 
-    des_set_odd_parity((des_cblock *)des_key);
+    DES_set_odd_parity((DES_cblock *)des_key);
 }
 
 static void /* IN 8 octets IN 7 octest OUT 8 octets */
 DesEncrypt(u_char *clear, u_char *key, u_char *cipher)
 {
-    des_cblock         des_key;
-    des_key_schedule   key_schedule;
+    DES_cblock         des_key;
+    DES_key_schedule   key_schedule;
 
     MakeKey(key, des_key);
-    des_set_key(&des_key, key_schedule);
-    des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher, key_schedule, 1);
+    DES_set_key(&des_key, &key_schedule);
+    DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher, &key_schedule, 1);
 }
 
 static void      /* IN 8 octets      IN 16 octets     OUT 24 octets */
index 88a1e8b..3bac4da 100644 (file)
@@ -25,11 +25,13 @@ LDADD+=     -lpcap
 DPADD+=        ${LIBPCAP}
 
 # MS-CHAP support.  Requires the DES library.
-.if exists(${.CURDIR}/../../secure) && !defined(NO_CRYPT)  && !defined(NO_OPENSSL)
-CFLAGS+=-DCHAPMS
-SRCS+= chap_ms.c
-LDADD+=        -lcrypto
-DPADD+=        ${LIBCRYPTO}
+.if !defined(NO_CRYPT) && !defined(NO_LIBRESSL)
+CFLAGS+=       -DCHAPMS
+SRCS+=         chap_ms.c
+LDADD+=                -lprivate_crypto
+DPADD+=                ${LIBRECRYPTO}
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
 .endif
 
 .include <bsd.prog.mk>
index a7e5b0f..52af75d 100644 (file)
@@ -152,19 +152,19 @@ DesEncrypt(u_char *clear, u_char *key, u_char *cipher)
 static void
 DesEncrypt(u_char *clear, u_char *key, u_char *cipher)
 {
-    des_cblock         des_key;
-    des_key_schedule   key_schedule;
+    DES_cblock         des_key;
+    DES_key_schedule   key_schedule;
 
     MakeKey(key, des_key);
 
-    des_set_key(&des_key, key_schedule);
+    DES_set_key(&des_key, &key_schedule);
 
 #if 0
     CHAPDEBUG((LOG_INFO, "DesEncrypt: 8 octet input : %02X%02X%02X%02X%02X%02X%02X%02X",
               clear[0], clear[1], clear[2], clear[3], clear[4], clear[5], clear[6], clear[7]));
 #endif
 
-    des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher, key_schedule, 1);
+    DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher, &key_schedule, 1);
 
 #if 0
     CHAPDEBUG((LOG_INFO, "DesEncrypt: 8 octet output: %02X%02X%02X%02X%02X%02X%02X%02X",
@@ -244,7 +244,7 @@ MakeKey(u_char *key, u_char *des_key)
     des_key[7] = Get7Bits(key, 49);
 
 #ifndef USE_CRYPT
-    des_set_odd_parity((des_cblock *)des_key);
+    DES_set_odd_parity((DES_cblock *)des_key);
 #endif
 
 #if 0
index 682cdf7..d84fe18 100644 (file)
@@ -51,10 +51,12 @@ CFLAGS+=    -DINET6 -DHAVE_GETNAMEINFO
 
 DPADD= ${LIBL} ${LIBPCAP}
 LDADD= -ll -lpcap
-.if exists(../../secure) && !defined(NO_CRYPT) && !defined(NO_OPENSSL)
-DPADD+= ${LIBCRYPTO}
-LDADD+= -lcrypto
-CFLAGS+= -I${DESTDIR}/usr/include/openssl -DHAVE_LIBCRYPTO -DHAVE_OPENSSL_EVP_H
+.if !defined(NO_CRYPT) && !defined(NO_LIBRESSL)
+DPADD+=                ${LIBRECRYPTO}
+LDADD+=                -lprivate_crypto
+CFLAGS+=       -DHAVE_LIBCRYPTO -DHAVE_OPENSSL_EVP_H
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 .endif
 WARNS?=        2
 NO_STRICT_ALIASING=