group shared source files (e.g. SRCS_KEX) and allow compilation w/o OPENSSL
authormarkus <markus@openbsd.org>
Mon, 8 Jan 2018 15:37:21 +0000 (15:37 +0000)
committermarkus <markus@openbsd.org>
Mon, 8 Jan 2018 15:37:21 +0000 (15:37 +0000)
ok djm@

12 files changed:
usr.bin/ssh/Makefile.inc
usr.bin/ssh/scp/Makefile
usr.bin/ssh/sftp-server/Makefile
usr.bin/ssh/sftp/Makefile
usr.bin/ssh/ssh-add/Makefile
usr.bin/ssh/ssh-agent/Makefile
usr.bin/ssh/ssh-keygen/Makefile
usr.bin/ssh/ssh-keyscan/Makefile
usr.bin/ssh/ssh-keysign/Makefile
usr.bin/ssh/ssh-pkcs11-helper/Makefile
usr.bin/ssh/ssh/Makefile
usr.bin/ssh/sshd/Makefile

index 4db9181..13dd9a0 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile.inc,v 1.56 2017/12/10 19:37:57 deraadt Exp $
+#      $OpenBSD: Makefile.inc,v 1.57 2018/01/08 15:37:21 markus Exp $
 
 .include <bsd.own.mk>
 
@@ -37,4 +37,89 @@ CFLAGS+=     -DENABLE_PKCS11
 CFLAGS+=       -DHAVE_DLOPEN
 .endif
 
+SRCS_BASE+=    sshbuf.c
+SRCS_BASE+=    sshbuf-getput-basic.c
+SRCS_BASE+=    ssherr.c
+SRCS_BASE+=    log.c
+SRCS_BASE+=    xmalloc.c
+SRCS_BASE+=    misc.c
+
+.if (${OPENSSL:L} == "yes")
+SRCS_KEX+=     dh.c
+SRCS_KEX+=     kexdh.c
+SRCS_KEX+=     kexecdh.c
+SRCS_KEX+=     kexgex.c
+SRCS_KEXC+=    kexdhc.c
+SRCS_KEXC+=    kexecdhc.c
+SRCS_KEXC+=    kexgexc.c
+SRCS_KEXS+=    kexdhs.c
+SRCS_KEXS+=    kexecdhs.c
+SRCS_KEXS+=    kexgexs.c
+.endif
+SRCS_KEX+=     kexc25519.c
+SRCS_KEX+=     smult_curve25519_ref.c
+SRCS_KEXC+=    kexc25519c.c
+SRCS_KEXS+=    kexc25519s.c
+
+SRCS_KEY+=     sshkey.c
+SRCS_KEY+=     sshbuf-misc.c
+SRCS_KEY+=     cipher.c
+SRCS_KEY+=     cipher-chachapoly.c
+SRCS_KEY+=     chacha.c
+SRCS_KEY+=     poly1305.c
+.if (${OPENSSL:L} == "yes")
+SRCS_KEY+=     ssh-dss.c
+SRCS_KEY+=     ssh-ecdsa.c
+SRCS_KEY+=     ssh-rsa.c
+SRCS_KEY+=     sshbuf-getput-crypto.c
+SRCS_KEY+=     digest-openssl.c
+.else
+SRCS_KEY+=     cipher-aesctr.c
+SRCS_KEY+=     rijndael.c
+SRCS_KEY+=     digest-libc.c
+.endif
+SRCS_KEY+=     ssh-ed25519.c
+# ed25519, from supercop
+SRCS_KEY+=     sc25519.c
+SRCS_KEY+=     ge25519.c
+SRCS_KEY+=     fe25519.c
+SRCS_KEY+=     ed25519.c
+SRCS_KEY+=     verify.c
+SRCS_KEY+=     hash.c
+
+SRCS_KEYP+=    authfile.c
+
+SRCS_KRL+=     bitmap.c
+SRCS_KRL+=     krl.c
+
+SRCS_PKT+=     canohost.c
+SRCS_PKT+=     dispatch.c
+SRCS_PKT+=     hmac.c
+SRCS_PKT+=     kex.c
+SRCS_PKT+=     mac.c
+SRCS_PKT+=     packet.c
+SRCS_PKT+=     umac.c
+SRCS_PKT+=     umac128.c
+
+.if (${OPENSSL:L} == "yes")
+SRCS_PROT+=    bufbn.c
+SRCS_PROT+=    bufec.c
+.endif
+SRCS_PROT+=    channels.c
+SRCS_PROT+=    crc32.c
+SRCS_PROT+=    monitor_fdpass.c
+SRCS_PROT+=    nchan.c
+SRCS_PROT+=    opacket.c
+SRCS_PROT+=    ttymodes.c
+
+SRCS_UTL+=     addrmatch.c
+SRCS_UTL+=     match.c
+SRCS_UTL+=     uidswap.c
+
+.if (${OPENSSL:L} == "yes")
+SRCS_PKCS11+=  ssh-pkcs11.c
+.else
+SRCS_PKCS11+=
+.endif
+
 .include <bsd.obj.mk>
index 0e5aaed..369bfa5 100644 (file)
@@ -1,10 +1,10 @@
-#      $OpenBSD: Makefile,v 1.19 2018/01/08 15:21:49 markus Exp $
+#      $OpenBSD: Makefile,v 1.20 2018/01/08 15:37:22 markus Exp $
 
 .PATH:         ${.CURDIR}/..
 
 SRCS=  scp.c
-SRCS+= atomicio.c cleanup.c fatal.c log.c misc.c progressmeter.c \
-       sshbuf-getput-basic.c sshbuf.c ssherr.c utf8.c xmalloc.c
+SRCS+= atomicio.c cleanup.c fatal.c progressmeter.c utf8.c
+SRCS+= ${SRCS_BASE}
 
 PROG=  scp
 BINOWN=        root
index 7a18d73..3db4d11 100644 (file)
@@ -1,10 +1,10 @@
-#      $OpenBSD: Makefile,v 1.10 2017/12/10 19:37:57 deraadt Exp $
+#      $OpenBSD: Makefile,v 1.11 2018/01/08 15:37:23 markus Exp $
 
 .PATH:         ${.CURDIR}/..
 
 SRCS=  sftp-server.c sftp-common.c sftp-server-main.c
-SRCS+= addrmatch.c fatal.c log.c match.c misc.c sshbuf-getput-basic.c \
-       sshbuf.c ssherr.c uidswap.c xmalloc.c
+SRCS+= fatal.c
+SRCS+= ${SRCS_BASE} ${SRCS_UTL}
 
 PROG=  sftp-server
 BINOWN=        root
index 4a1d597..d7b48be 100644 (file)
@@ -1,10 +1,10 @@
-#      $OpenBSD: Makefile,v 1.15 2018/01/08 15:21:49 markus Exp $
+#      $OpenBSD: Makefile,v 1.16 2018/01/08 15:37:24 markus Exp $
 
 .PATH:         ${.CURDIR}/..
 
 SRCS=  sftp.c sftp-client.c sftp-common.c sftp-glob.c
-SRCS+= atomicio.c cleanup.c fatal.c log.c misc.c progressmeter.c \
-       sshbuf-getput-basic.c sshbuf.c ssherr.c utf8.c xmalloc.c
+SRCS+= atomicio.c cleanup.c fatal.c progressmeter.c utf8.c
+SRCS+= ${SRCS_BASE}
 
 PROG=  sftp
 BINOWN=        root
index e28d711..a3fe494 100644 (file)
@@ -1,14 +1,10 @@
-#      $OpenBSD: Makefile,v 1.23 2017/12/14 21:07:39 naddy Exp $
+#      $OpenBSD: Makefile,v 1.24 2018/01/08 15:37:25 markus Exp $
 
 .PATH:         ${.CURDIR}/..
 
 SRCS=  ssh-add.c
-SRCS+= addrmatch.c atomicio.c authfd.c authfile.c bitmap.c chacha.c \
-       cipher-chachapoly.c cipher.c cleanup.c digest-openssl.c ed25519.c \
-       fatal.c fe25519.c ge25519.c hash.c krl.c log.c match.c misc.c \
-       poly1305.c readpass.c sc25519.c ssh-dss.c ssh-ecdsa.c ssh-ed25519.c \
-       ssh-rsa.c sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c \
-       sshbuf.c ssherr.c sshkey.c uidswap.c verify.c xmalloc.c
+SRCS+= atomicio.c authfd.c cleanup.c fatal.c readpass.c
+SRCS+= ${SRCS_BASE} ${SRCS_KEY} ${SRCS_KEYP} ${SRCS_KRL} ${SRCS_UTL}
 
 PROG=  ssh-add
 BINOWN=        root
index a5ffe2d..7c7d75d 100644 (file)
@@ -1,15 +1,10 @@
-#      $OpenBSD: Makefile,v 1.27 2017/12/14 21:07:39 naddy Exp $
+#      $OpenBSD: Makefile,v 1.28 2018/01/08 15:37:26 markus Exp $
 
 .PATH:         ${.CURDIR}/..
 
 SRCS=  ssh-agent.c ssh-pkcs11-client.c
-SRCS+= addrmatch.c atomicio.c authfile.c bitmap.c bufaux.c buffer.c \
-       chacha.c cipher-chachapoly.c cipher.c compat.c digest-openssl.c \
-       ed25519.c fatal.c fe25519.c ge25519.c hash.c key.c krl.c log.c match.c \
-       misc.c poly1305.c readpass.c sc25519.c ssh-dss.c ssh-ecdsa.c \
-       ssh-ed25519.c ssh-rsa.c sshbuf-getput-basic.c sshbuf-getput-crypto.c \
-       sshbuf-misc.c sshbuf.c ssherr.c sshkey.c uidswap.c verify.c xmalloc.c
-
+SRCS+= atomicio.c bufaux.c buffer.c compat.c fatal.c key.c readpass.c
+SRCS+= ${SRCS_BASE} ${SRCS_KEY} ${SRCS_KEYP} ${SRCS_KRL} ${SRCS_UTL}
 PROG=  ssh-agent
 BINOWN=        root
 BINGRP=        _sshagnt
index 43cc239..e7325fe 100644 (file)
@@ -1,15 +1,12 @@
-#      $OpenBSD: Makefile,v 1.25 2017/12/14 21:07:39 naddy Exp $
+#      $OpenBSD: Makefile,v 1.26 2018/01/08 15:37:27 markus Exp $
 
 .PATH:         ${.CURDIR}/..
 
-SRCS=  ssh-keygen.c moduli.c
-SRCS+= addrmatch.c atomicio.c authfd.c authfile.c bitmap.c chacha.c \
-       cipher-chachapoly.c cipher.c cleanup.c digest-openssl.c dns.c \
-       ed25519.c fatal.c fe25519.c ge25519.c hash.c hmac.c hostfile.c krl.c \
-       log.c match.c misc.c poly1305.c readpass.c sc25519.c ssh-dss.c \
-       ssh-ecdsa.c ssh-ed25519.c ssh-pkcs11.c ssh-rsa.c sshbuf-getput-basic.c \
-       sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c ssherr.c sshkey.c \
-       uidswap.c utf8.c uuencode.c verify.c xmalloc.c
+SRCS=  ssh-keygen.c moduli.c uuencode.c
+SRCS+= atomicio.c authfd.c cleanup.c dns.c fatal.c hmac.c hostfile.c \
+       readpass.c utf8.c
+SRCS+= ${SRCS_BASE} ${SRCS_KEY} ${SRCS_KEYP} ${SRCS_KRL} ${SRCS_UTL} \
+       ${SRCS_PKCS11}
 
 PROG=  ssh-keygen
 BINOWN=        root
index 1e78971..871ac91 100644 (file)
@@ -1,20 +1,11 @@
-#      $OpenBSD: Makefile,v 1.10 2017/12/14 21:07:39 naddy Exp $
+#      $OpenBSD: Makefile,v 1.11 2018/01/08 15:37:28 markus Exp $
 
 .PATH:         ${.CURDIR}/..
 
 SRCS=  ssh-keyscan.c
-
-SRCS+= addrmatch.c atomicio.c canohost.c chacha.c \
-       cipher-chachapoly.c cipher.c cleanup.c compat.c dh.c digest-openssl.c \
-       dispatch.c ed25519.c fe25519.c ge25519.c hash.c hmac.c hostfile.c \
-       kex.c kexc25519.c kexc25519c.c kexc25519s.c kexdh.c kexdhc.c kexdhs.c \
-       kexecdh.c kexecdhc.c kexecdhs.c kexgex.c kexgexc.c kexgexs.c log.c \
-       mac.c match.c misc.c packet.c poly1305.c sc25519.c \
-       smult_curve25519_ref.c ssh-dss.c ssh-ecdsa.c ssh-ed25519.c ssh-rsa.c \
-       ssh_api.c sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c \
-       sshbuf.c ssherr.c sshkey.c uidswap.c umac.c umac128.c verify.c \
-       xmalloc.c
-
+SRCS+= atomicio.c cleanup.c compat.c hostfile.c ssh_api.c
+SRCS+= ${SRCS_BASE} ${SRCS_KEX} ${SRCS_KEXC} ${SRCS_KEXS} ${SRCS_KEY} \
+       ${SRCS_PKT} ${SRCS_UTL}
 PROG=  ssh-keyscan
 BINOWN=        root
 
index 9a1e497..296fa44 100644 (file)
@@ -1,17 +1,11 @@
-#      $OpenBSD: Makefile,v 1.12 2017/12/14 21:07:39 naddy Exp $
+#      $OpenBSD: Makefile,v 1.13 2018/01/08 15:37:38 markus Exp $
 
 .PATH:         ${.CURDIR}/..
 
 SRCS=  ssh-keysign.c readconf.c
-
-SRCS+= addrmatch.c atomicio.c authfile.c bitmap.c canohost.c \
-       chacha.c cipher-chachapoly.c cipher.c cleanup.c digest-openssl.c \
-       dispatch.c ed25519.c fatal.c fe25519.c ge25519.c hash.c hmac.c kex.c \
-       krl.c log.c mac.c match.c misc.c msg.c packet.c poly1305.c sc25519.c \
-       ssh-dss.c ssh-ecdsa.c ssh-ed25519.c ssh-rsa.c sshbuf-getput-basic.c \
-       sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c ssherr.c sshkey.c \
-       uidswap.c umac.c umac128.c verify.c xmalloc.c
-
+SRCS+= atomicio.c cleanup.c fatal.c msg.c
+SRCS+= ${SRCS_BASE} ${SRCS_KEY} ${SRCS_KEYP} ${SRCS_KRL} ${SRCS_PKT} \
+       ${SRCS_UTL}
 PROG=  ssh-keysign
 BINOWN=        root
 
index a5e3627..2cd1b1d 100644 (file)
@@ -1,14 +1,10 @@
-#      $OpenBSD: Makefile,v 1.5 2018/01/08 15:18:46 markus Exp $
+#      $OpenBSD: Makefile,v 1.6 2018/01/08 15:37:38 markus Exp $
 
 .PATH:         ${.CURDIR}/..
 
 SRCS=  ssh-pkcs11-helper.c ssh-pkcs11.c
-SRCS+= addrmatch.c atomicio.c bufaux.c buffer.c \
-       chacha.c cipher-chachapoly.c cipher.c compat.c digest-openssl.c \
-       ed25519.c fatal.c fe25519.c ge25519.c hash.c log.c match.c \
-       misc.c poly1305.c readpass.c sc25519.c ssh-dss.c ssh-ecdsa.c \
-       ssh-ed25519.c ssh-rsa.c sshbuf-getput-basic.c sshbuf-getput-crypto.c \
-       sshbuf-misc.c sshbuf.c ssherr.c sshkey.c uidswap.c verify.c xmalloc.c
+SRCS+= atomicio.c bufaux.c buffer.c compat.c fatal.c readpass.c
+SRCS+= ${SRCS_KEY} ${SRCS_UTL} ${SRCS_BASE}
 
 PROG=  ssh-pkcs11-helper
 BINOWN=        root
@@ -22,4 +18,3 @@ MAN=  ssh-pkcs11-helper.8
 
 LDADD+=        -lcrypto -lutil
 DPADD+=        ${LIBCRYPTO} ${LIBUTIL}
-
index 71a3cc4..ec2de52 100644 (file)
@@ -1,21 +1,12 @@
-#      $OpenBSD: Makefile,v 1.71 2018/01/08 15:15:17 markus Exp $
+#      $OpenBSD: Makefile,v 1.72 2018/01/08 15:37:38 markus Exp $
 
 .PATH:         ${.CURDIR}/..
 
 SRCS=  ssh.c readconf.c clientloop.c sshtty.c sshconnect.c sshconnect2.c mux.c
-
-SRCS+= addrmatch.c atomicio.c authfd.c authfile.c bitmap.c bufaux.c \
-       bufbn.c bufec.c buffer.c canohost.c chacha.c channels.c \
-       cipher-chachapoly.c cipher.c compat.c crc32.c dh.c digest-openssl.c \
-       dispatch.c dns.c ed25519.c fatal.c fe25519.c ge25519.c hash.c hmac.c \
-       hostfile.c kex.c kexc25519.c kexc25519c.c kexdh.c \
-       kexdhc.c kexecdh.c kexecdhc.c kexgex.c kexgexc.c \
-       key.c krl.c log.c mac.c match.c misc.c monitor_fdpass.c msg.c nchan.c \
-       opacket.c packet.c poly1305.c readpass.c sc25519.c \
-       smult_curve25519_ref.c ssh-dss.c ssh-ecdsa.c ssh-ed25519.c \
-       ssh-pkcs11.c ssh-rsa.c sshbuf-getput-basic.c sshbuf-getput-crypto.c \
-       sshbuf-misc.c sshbuf.c ssherr.c sshkey.c ttymodes.c uidswap.c umac.c \
-       umac128.c utf8.c verify.c xmalloc.c
+SRCS+= atomicio.c authfd.c bufaux.c buffer.c compat.c dns.c fatal.c \
+       hostfile.c key.c msg.c readpass.c utf8.c
+SRCS+= ${SRCS_BASE} ${SRCS_KEX} ${SRCS_KEXC} ${SRCS_KEY} ${SRCS_KEYP} \
+       ${SRCS_KRL} ${SRCS_PROT} ${SRCS_PKT} ${SRCS_UTL} ${SRCS_PKCS11}
 
 PROG=  ssh
 BINOWN=        root
@@ -42,9 +33,9 @@ LDADD+=  -lwind -lroken -lcom_err -lpthread -lheimbase
 .endif # KERBEROS5
 
 .if (${OPENSSL:L} == "yes")
-LDADD+=        -lcrypto -lutil
-DPADD+=        ${LIBCRYPTO} ${LIBUTIL}
+LDADD+=        -lcrypto
+DPADD+=        ${LIBCRYPTO}
 .endif
 
-LDADD+=        -lz
-DPADD+=        ${LIBZ}
+LDADD+=        -lutil -lz
+DPADD+=        ${LIBUTIL} ${LIBZ}
index 310666f..f7b7cbb 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.94 2018/01/08 15:15:36 markus Exp $
+#      $OpenBSD: Makefile,v 1.95 2018/01/08 15:37:38 markus Exp $
 
 .PATH:         ${.CURDIR}/..
 
@@ -7,19 +7,10 @@ SRCS= sshd.c auth-rhosts.c auth-passwd.c sshpty.c sshlogin.c servconf.c \
        groupaccess.c auth-bsdauth.c auth2-hostbased.c auth2-kbdint.c \
        auth2-none.c auth2-passwd.c auth2-pubkey.c monitor.c monitor_wrap.c \
        sftp-server.c sftp-common.c sandbox-pledge.c
-
-SRCS+= addrmatch.c atomicio.c authfd.c authfile.c bitmap.c bufaux.c \
-       bufbn.c bufec.c buffer.c canohost.c chacha.c channels.c \
-       cipher-chachapoly.c cipher.c compat.c crc32.c dh.c digest-openssl.c \
-       dispatch.c dns.c ed25519.c fatal.c fe25519.c ge25519.c hash.c hmac.c \
-       hostfile.c kex.c kexc25519.c kexc25519s.c kexdh.c \
-       kexdhs.c kexecdh.c kexecdhs.c kexgex.c \
-       kexgexs.c key.c krl.c log.c mac.c match.c misc.c monitor_fdpass.c \
-       msg.c nchan.c opacket.c packet.c poly1305.c readpass.c \
-       sc25519.c smult_curve25519_ref.c ssh-dss.c ssh-ecdsa.c ssh-ed25519.c \
-       ssh-pkcs11.c ssh-rsa.c sshbuf-getput-basic.c sshbuf-getput-crypto.c \
-       sshbuf-misc.c sshbuf.c ssherr.c sshkey.c ttymodes.c uidswap.c umac.c \
-       umac128.c utf8.c verify.c xmalloc.c
+SRCS+= atomicio.c authfd.c bufaux.c buffer.c compat.c dns.c fatal.c \
+       hostfile.c key.c msg.c readpass.c utf8.c
+SRCS+= ${SRCS_BASE} ${SRCS_KEX} ${SRCS_KEXS} ${SRCS_KEY} ${SRCS_KEYP} \
+       ${SRCS_KRL} ${SRCS_PROT} ${SRCS_PKT} ${SRCS_UTL} ${SRCS_PKCS11}
 
 PROG=  sshd
 BINOWN=        root
@@ -45,9 +36,9 @@ DPADD+= ${LIBGSSAPI} ${LIBKRB5}
 .endif
 
 .if (${OPENSSL:L} == "yes")
-LDADD+=        -lcrypto -lutil
-DPADD+=        ${LIBCRYPTO} ${LIBUTIL}
+LDADD+=        -lcrypto
+DPADD+=        ${LIBCRYPTO}
 .endif
 
-LDADD+=        -lz
-DPADD+=        ${LIBZ}
+LDADD+=        -lutil -lz
+DPADD+=        ${LIBUTIL} ${LIBZ}