1#	$OpenBSD: Makefile,v 1.8 2020/04/03 04:07:48 djm Exp $
2
3.include <bsd.own.mk>
4.include <bsd.obj.mk>
5
6# XXX detect from ssh binary?
7SSH1?=		no
8OPENSSL?=	yes
9
10PROG=	kexfuzz
11SRCS=	kexfuzz.c
12
13SSHREL=../../../../../usr.bin/ssh
14.PATH: ${.CURDIR}/${SSHREL}
15# From usr.bin/ssh
16SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c
17SRCS+=atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c ssh-dss.c
18SRCS+=ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c
19SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c
20SRCS+=addrmatch.c bitmap.c packet.c dispatch.c canohost.c ssh_api.c
21SRCS+=compat.c ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c
22SRCS+=cipher-chachapoly.c chacha.c poly1305.c utf8.c
23SRCS+=sshbuf-io.c ssh-ecdsa-sk.c ssh-ed25519-sk.c msg.c ssh-sk-client.c
24
25SRCS+=	kex.c
26SRCS+=	dh.c
27SRCS+=	kexdh.c
28SRCS+=	kexecdh.c
29SRCS+=	kexgex.c
30SRCS+=	kexgexc.c
31SRCS+=	kexgexs.c
32SRCS+=	kexc25519.c
33SRCS+=	smult_curve25519_ref.c
34SRCS+=	kexgen.c
35SRCS+=	kexsntrup4591761x25519.c
36SRCS+=	sntrup4591761.c
37
38SRCS+=digest-openssl.c
39#SRCS+=digest-libc.c
40
41NOMAN=	1
42
43.if (${OPENSSL:L} == "yes")
44CFLAGS+=	-DWITH_OPENSSL
45.else
46# SSH v.1 requires OpenSSL.
47SSH1=		no
48.endif
49
50.if (${SSH1:L} == "yes")
51CFLAGS+=	-DWITH_SSH1
52.endif
53
54LDADD+= -lfido2 -lcbor -lusbhid
55DPADD+= ${LIBFIDO2} ${LIBCBOR} ${LIBUSBHID}
56
57# enable warnings
58WARNINGS=Yes
59
60DEBUG=-g
61CFLAGS+=	-fstack-protector-all
62CDIAGFLAGS=	-Wall
63CDIAGFLAGS+=	-Wextra
64CDIAGFLAGS+=	-Werror
65CDIAGFLAGS+=	-Wchar-subscripts
66CDIAGFLAGS+=	-Wcomment
67CDIAGFLAGS+=	-Wformat
68CDIAGFLAGS+=	-Wformat-security
69CDIAGFLAGS+=	-Wimplicit
70CDIAGFLAGS+=	-Winline
71CDIAGFLAGS+=	-Wmissing-declarations
72CDIAGFLAGS+=	-Wmissing-prototypes
73CDIAGFLAGS+=	-Wparentheses
74CDIAGFLAGS+=	-Wpointer-arith
75CDIAGFLAGS+=	-Wreturn-type
76CDIAGFLAGS+=	-Wshadow
77CDIAGFLAGS+=	-Wsign-compare
78CDIAGFLAGS+=	-Wstrict-aliasing
79CDIAGFLAGS+=	-Wstrict-prototypes
80CDIAGFLAGS+=	-Wswitch
81CDIAGFLAGS+=	-Wtrigraphs
82CDIAGFLAGS+=	-Wuninitialized
83CDIAGFLAGS+=	-Wunused
84CDIAGFLAGS+=	-Wno-unused-parameter
85.if ${COMPILER_VERSION:L} != "gcc3"
86CDIAGFLAGS+=	-Wold-style-definition
87.endif
88
89
90CFLAGS+=-I${.CURDIR}/${SSHREL}
91
92LDADD+= -lutil -lz
93DPADD+= ${LIBUTIL} ${LIBZ}
94
95.if (${OPENSSL:L} == "yes")
96LDADD+= -lcrypto
97DPADD+= ${LIBCRYPTO}
98.endif
99
100.include <bsd.prog.mk>
101
102