diff options
-rw-r--r-- | regress/unittests/Makefile.inc | 16 | ||||
-rw-r--r-- | regress/unittests/bitmap/Makefile | 6 | ||||
-rw-r--r-- | regress/unittests/conversion/Makefile | 7 | ||||
-rw-r--r-- | regress/unittests/hostkeys/Makefile | 15 | ||||
-rw-r--r-- | regress/unittests/kex/Makefile | 19 | ||||
-rw-r--r-- | regress/unittests/sshbuf/Makefile | 12 | ||||
-rw-r--r-- | regress/unittests/sshkey/Makefile | 15 | ||||
-rw-r--r-- | regress/unittests/sshkey/test_fuzz.c | 6 | ||||
-rw-r--r-- | regress/unittests/sshkey/test_sshkey.c | 8 | ||||
-rw-r--r-- | regress/unittests/utf8/Makefile | 6 |
10 files changed, 82 insertions, 28 deletions
diff --git a/regress/unittests/Makefile.inc b/regress/unittests/Makefile.inc index 36d1ff42c..b509f4452 100644 --- a/regress/unittests/Makefile.inc +++ b/regress/unittests/Makefile.inc | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile.inc,v 1.11 2017/04/30 23:33:48 djm Exp $ | 1 | # $OpenBSD: Makefile.inc,v 1.12 2017/12/21 00:41:22 djm Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
4 | .include <bsd.obj.mk> | 4 | .include <bsd.obj.mk> |
@@ -30,8 +30,8 @@ CDIAGFLAGS+= -Wswitch | |||
30 | CDIAGFLAGS+= -Wtrigraphs | 30 | CDIAGFLAGS+= -Wtrigraphs |
31 | CDIAGFLAGS+= -Wuninitialized | 31 | CDIAGFLAGS+= -Wuninitialized |
32 | CDIAGFLAGS+= -Wunused | 32 | CDIAGFLAGS+= -Wunused |
33 | CDIAGFLAGS+= -Wno-unused-parameter | ||
33 | .if ${COMPILER_VERSION:L} != "gcc3" | 34 | .if ${COMPILER_VERSION:L} != "gcc3" |
34 | CDIAGFLAGS+= -Wpointer-sign | ||
35 | CDIAGFLAGS+= -Wold-style-definition | 35 | CDIAGFLAGS+= -Wold-style-definition |
36 | .endif | 36 | .endif |
37 | 37 | ||
@@ -47,17 +47,7 @@ LDADD+=-L${.CURDIR}/../test_helper -ltest_helper | |||
47 | DPADD+=${.CURDIR}/../test_helper/libtest_helper.a | 47 | DPADD+=${.CURDIR}/../test_helper/libtest_helper.a |
48 | .endif | 48 | .endif |
49 | 49 | ||
50 | .if exists(${.CURDIR}/${SSHREL}/lib/${__objdir}) | 50 | .PATH: ${.CURDIR}/${SSHREL} |
51 | LDADD+=-L${.CURDIR}/${SSHREL}/lib/${__objdir} -lssh | ||
52 | LIBSSH=${.CURDIR}/${SSHREL}/lib/${__objdir}/libssh.a | ||
53 | .else | ||
54 | LDADD+=-L${.CURDIR}/${SSHREL}/lib -lssh | ||
55 | LIBSSH=${.CURDIR}/${SSHREL}/lib/libssh.a | ||
56 | .endif | ||
57 | DPADD+=${LIBSSH} | ||
58 | ${PROG}: ${LIBSSH} | ||
59 | ${LIBSSH}: | ||
60 | cd ${.CURDIR}/${SSHREL} && ${MAKE} lib | ||
61 | 51 | ||
62 | LDADD+= -lcrypto | 52 | LDADD+= -lcrypto |
63 | DPADD+= ${LIBCRYPTO} | 53 | DPADD+= ${LIBCRYPTO} |
diff --git a/regress/unittests/bitmap/Makefile b/regress/unittests/bitmap/Makefile index bd21949f8..fe30acc77 100644 --- a/regress/unittests/bitmap/Makefile +++ b/regress/unittests/bitmap/Makefile | |||
@@ -1,7 +1,11 @@ | |||
1 | # $OpenBSD: Makefile,v 1.3 2016/11/01 13:43:27 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.4 2017/12/21 00:41:22 djm Exp $ |
2 | 2 | ||
3 | PROG=test_bitmap | 3 | PROG=test_bitmap |
4 | SRCS=tests.c | 4 | SRCS=tests.c |
5 | |||
6 | # From usr.sbin/ssh | ||
7 | SRCS+=bitmap.c atomicio.c | ||
8 | |||
5 | REGRESS_TARGETS=run-regress-${PROG} | 9 | REGRESS_TARGETS=run-regress-${PROG} |
6 | 10 | ||
7 | run-regress-${PROG}: ${PROG} | 11 | run-regress-${PROG}: ${PROG} |
diff --git a/regress/unittests/conversion/Makefile b/regress/unittests/conversion/Makefile index cde97dc28..8b2a09cc3 100644 --- a/regress/unittests/conversion/Makefile +++ b/regress/unittests/conversion/Makefile | |||
@@ -1,7 +1,12 @@ | |||
1 | # $OpenBSD: Makefile,v 1.1 2017/03/14 01:20:29 dtucker Exp $ | 1 | # $OpenBSD: Makefile,v 1.2 2017/12/21 00:41:22 djm Exp $ |
2 | 2 | ||
3 | PROG=test_conversion | 3 | PROG=test_conversion |
4 | SRCS=tests.c | 4 | SRCS=tests.c |
5 | |||
6 | # From usr.bin/ssh | ||
7 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c | ||
8 | SRCS+=atomicio.c misc.c xmalloc.c log.c uidswap.c cleanup.c fatal.c ssherr.c | ||
9 | |||
5 | REGRESS_TARGETS=run-regress-${PROG} | 10 | REGRESS_TARGETS=run-regress-${PROG} |
6 | 11 | ||
7 | run-regress-${PROG}: ${PROG} | 12 | run-regress-${PROG}: ${PROG} |
diff --git a/regress/unittests/hostkeys/Makefile b/regress/unittests/hostkeys/Makefile index ae3c342bd..336885122 100644 --- a/regress/unittests/hostkeys/Makefile +++ b/regress/unittests/hostkeys/Makefile | |||
@@ -1,7 +1,20 @@ | |||
1 | # $OpenBSD: Makefile,v 1.3 2016/11/01 13:43:27 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.4 2017/12/21 00:41:22 djm Exp $ |
2 | 2 | ||
3 | PROG=test_hostkeys | 3 | PROG=test_hostkeys |
4 | SRCS=tests.c test_iterate.c | 4 | SRCS=tests.c test_iterate.c |
5 | |||
6 | # From usr.bin/ssh | ||
7 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c | ||
8 | SRCS+=atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c ssh-dss.c | ||
9 | SRCS+=ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c | ||
10 | SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c | ||
11 | SRCS+=addrmatch.c bitmap.c hostfile.c | ||
12 | SRCS+=ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c | ||
13 | SRCS+=cipher-chachapoly.c chacha.c poly1305.c | ||
14 | |||
15 | SRCS+=digest-openssl.c | ||
16 | #SRCS+=digest-libc.c | ||
17 | |||
5 | REGRESS_TARGETS=run-regress-${PROG} | 18 | REGRESS_TARGETS=run-regress-${PROG} |
6 | 19 | ||
7 | run-regress-${PROG}: ${PROG} | 20 | run-regress-${PROG}: ${PROG} |
diff --git a/regress/unittests/kex/Makefile b/regress/unittests/kex/Makefile index 7ed312675..5c61307a3 100644 --- a/regress/unittests/kex/Makefile +++ b/regress/unittests/kex/Makefile | |||
@@ -1,7 +1,24 @@ | |||
1 | # $OpenBSD: Makefile,v 1.4 2016/11/01 13:43:27 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.5 2017/12/21 00:41:22 djm Exp $ |
2 | 2 | ||
3 | PROG=test_kex | 3 | PROG=test_kex |
4 | SRCS=tests.c test_kex.c | 4 | SRCS=tests.c test_kex.c |
5 | |||
6 | # From usr.bin/ssh | ||
7 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c | ||
8 | SRCS+=atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c ssh-dss.c | ||
9 | SRCS+=ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c | ||
10 | SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c | ||
11 | SRCS+=addrmatch.c bitmap.c packet.c dispatch.c canohost.c ssh_api.c | ||
12 | SRCS+=kex.c kexc25519.c kexc25519c.c kexc25519s.c kexdh.c kexdhc.c kexdhs.c | ||
13 | SRCS+=kexecdh.c kexecdhc.c kexecdhs.c kexgex.c kexgexc.c kexgexs.c | ||
14 | SRCS+=dh.c compat.c | ||
15 | SRCS+=ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c | ||
16 | SRCS+=cipher-chachapoly.c chacha.c poly1305.c | ||
17 | SRCS+=smult_curve25519_ref.c | ||
18 | |||
19 | SRCS+=digest-openssl.c | ||
20 | #SRCS+=digest-libc.c | ||
21 | |||
5 | REGRESS_TARGETS=run-regress-${PROG} | 22 | REGRESS_TARGETS=run-regress-${PROG} |
6 | 23 | ||
7 | run-regress-${PROG}: ${PROG} | 24 | run-regress-${PROG}: ${PROG} |
diff --git a/regress/unittests/sshbuf/Makefile b/regress/unittests/sshbuf/Makefile index 69b27566b..81d4f27a6 100644 --- a/regress/unittests/sshbuf/Makefile +++ b/regress/unittests/sshbuf/Makefile | |||
@@ -1,4 +1,6 @@ | |||
1 | # $OpenBSD: Makefile,v 1.5 2016/11/01 13:43:27 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.6 2017/12/21 00:41:22 djm Exp $ |
2 | |||
3 | .include <bsd.regress.mk> | ||
2 | 4 | ||
3 | PROG=test_sshbuf | 5 | PROG=test_sshbuf |
4 | SRCS=tests.c | 6 | SRCS=tests.c |
@@ -10,5 +12,11 @@ SRCS+=test_sshbuf_fuzz.c | |||
10 | SRCS+=test_sshbuf_getput_fuzz.c | 12 | SRCS+=test_sshbuf_getput_fuzz.c |
11 | SRCS+=test_sshbuf_fixed.c | 13 | SRCS+=test_sshbuf_fixed.c |
12 | 14 | ||
13 | .include <bsd.regress.mk> | 15 | # From usr.bin/ssh |
16 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c | ||
17 | SRCS+=atomicio.c | ||
18 | |||
19 | run-regress-${PROG}: ${PROG} | ||
20 | env ${TEST_ENV} ./${PROG} | ||
21 | |||
14 | 22 | ||
diff --git a/regress/unittests/sshkey/Makefile b/regress/unittests/sshkey/Makefile index cfbfcf8f1..1c940bec6 100644 --- a/regress/unittests/sshkey/Makefile +++ b/regress/unittests/sshkey/Makefile | |||
@@ -1,7 +1,20 @@ | |||
1 | # $OpenBSD: Makefile,v 1.4 2016/11/01 13:43:27 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.5 2017/12/21 00:41:22 djm Exp $ |
2 | 2 | ||
3 | PROG=test_sshkey | 3 | PROG=test_sshkey |
4 | SRCS=tests.c test_sshkey.c test_file.c test_fuzz.c common.c | 4 | SRCS=tests.c test_sshkey.c test_file.c test_fuzz.c common.c |
5 | |||
6 | # From usr.bin/ssh | ||
7 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c | ||
8 | SRCS+=atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c ssh-dss.c | ||
9 | SRCS+=ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c | ||
10 | SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c | ||
11 | SRCS+=addrmatch.c bitmap.c | ||
12 | SRCS+=ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c | ||
13 | SRCS+=cipher-chachapoly.c chacha.c poly1305.c | ||
14 | |||
15 | SRCS+=digest-openssl.c | ||
16 | #SRCS+=digest-libc.c | ||
17 | |||
5 | REGRESS_TARGETS=run-regress-${PROG} | 18 | REGRESS_TARGETS=run-regress-${PROG} |
6 | 19 | ||
7 | run-regress-${PROG}: ${PROG} | 20 | run-regress-${PROG}: ${PROG} |
diff --git a/regress/unittests/sshkey/test_fuzz.c b/regress/unittests/sshkey/test_fuzz.c index 6706045d5..d3b0c92b4 100644 --- a/regress/unittests/sshkey/test_fuzz.c +++ b/regress/unittests/sshkey/test_fuzz.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: test_fuzz.c,v 1.7 2017/04/30 23:33:48 djm Exp $ */ | 1 | /* $OpenBSD: test_fuzz.c,v 1.8 2017/12/21 00:41:22 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Fuzz tests for key parsing | 3 | * Fuzz tests for key parsing |
4 | * | 4 | * |
@@ -83,7 +83,7 @@ sig_fuzz(struct sshkey *k, const char *sig_alg) | |||
83 | fuzz = fuzz_begin(FUZZ_1_BIT_FLIP | /* too slow FUZZ_2_BIT_FLIP | */ | 83 | fuzz = fuzz_begin(FUZZ_1_BIT_FLIP | /* too slow FUZZ_2_BIT_FLIP | */ |
84 | FUZZ_1_BYTE_FLIP | FUZZ_2_BYTE_FLIP | | 84 | FUZZ_1_BYTE_FLIP | FUZZ_2_BYTE_FLIP | |
85 | FUZZ_TRUNCATE_START | FUZZ_TRUNCATE_END, sig, l); | 85 | FUZZ_TRUNCATE_START | FUZZ_TRUNCATE_END, sig, l); |
86 | ASSERT_INT_EQ(sshkey_verify(k, sig, l, c, sizeof(c), 0), 0); | 86 | ASSERT_INT_EQ(sshkey_verify(k, sig, l, c, sizeof(c), NULL, 0), 0); |
87 | free(sig); | 87 | free(sig); |
88 | TEST_ONERROR(onerror, fuzz); | 88 | TEST_ONERROR(onerror, fuzz); |
89 | for(; !fuzz_done(fuzz); fuzz_next(fuzz)) { | 89 | for(; !fuzz_done(fuzz); fuzz_next(fuzz)) { |
@@ -91,7 +91,7 @@ sig_fuzz(struct sshkey *k, const char *sig_alg) | |||
91 | if (fuzz_matches_original(fuzz)) | 91 | if (fuzz_matches_original(fuzz)) |
92 | continue; | 92 | continue; |
93 | ASSERT_INT_NE(sshkey_verify(k, fuzz_ptr(fuzz), fuzz_len(fuzz), | 93 | ASSERT_INT_NE(sshkey_verify(k, fuzz_ptr(fuzz), fuzz_len(fuzz), |
94 | c, sizeof(c), 0), 0); | 94 | c, sizeof(c), NULL, 0), 0); |
95 | } | 95 | } |
96 | fuzz_cleanup(fuzz); | 96 | fuzz_cleanup(fuzz); |
97 | } | 97 | } |
diff --git a/regress/unittests/sshkey/test_sshkey.c b/regress/unittests/sshkey/test_sshkey.c index 0a73322a3..1aa608f92 100644 --- a/regress/unittests/sshkey/test_sshkey.c +++ b/regress/unittests/sshkey/test_sshkey.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: test_sshkey.c,v 1.12 2017/05/08 06:08:42 djm Exp $ */ | 1 | /* $OpenBSD: test_sshkey.c,v 1.13 2017/12/21 00:41:22 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Regress test for sshkey.h key management API | 3 | * Regress test for sshkey.h key management API |
4 | * | 4 | * |
@@ -121,11 +121,11 @@ signature_test(struct sshkey *k, struct sshkey *bad, const char *sig_alg, | |||
121 | ASSERT_INT_EQ(sshkey_sign(k, &sig, &len, d, l, sig_alg, 0), 0); | 121 | ASSERT_INT_EQ(sshkey_sign(k, &sig, &len, d, l, sig_alg, 0), 0); |
122 | ASSERT_SIZE_T_GT(len, 8); | 122 | ASSERT_SIZE_T_GT(len, 8); |
123 | ASSERT_PTR_NE(sig, NULL); | 123 | ASSERT_PTR_NE(sig, NULL); |
124 | ASSERT_INT_EQ(sshkey_verify(k, sig, len, d, l, 0), 0); | 124 | ASSERT_INT_EQ(sshkey_verify(k, sig, len, d, l, NULL, 0), 0); |
125 | ASSERT_INT_NE(sshkey_verify(bad, sig, len, d, l, 0), 0); | 125 | ASSERT_INT_NE(sshkey_verify(bad, sig, len, d, l, NULL, 0), 0); |
126 | /* Fuzz test is more comprehensive, this is just a smoke test */ | 126 | /* Fuzz test is more comprehensive, this is just a smoke test */ |
127 | sig[len - 5] ^= 0x10; | 127 | sig[len - 5] ^= 0x10; |
128 | ASSERT_INT_NE(sshkey_verify(k, sig, len, d, l, 0), 0); | 128 | ASSERT_INT_NE(sshkey_verify(k, sig, len, d, l, NULL, 0), 0); |
129 | free(sig); | 129 | free(sig); |
130 | } | 130 | } |
131 | 131 | ||
diff --git a/regress/unittests/utf8/Makefile b/regress/unittests/utf8/Makefile index a975264fc..f8eec0484 100644 --- a/regress/unittests/utf8/Makefile +++ b/regress/unittests/utf8/Makefile | |||
@@ -1,7 +1,11 @@ | |||
1 | # $OpenBSD: Makefile,v 1.4 2016/11/01 13:43:27 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.5 2017/12/21 00:41:22 djm Exp $ |
2 | 2 | ||
3 | PROG=test_utf8 | 3 | PROG=test_utf8 |
4 | SRCS=tests.c | 4 | SRCS=tests.c |
5 | |||
6 | # From usr.bin/ssh | ||
7 | SRCS+=utf8.c atomicio.c | ||
8 | |||
5 | REGRESS_TARGETS=run-regress-${PROG} | 9 | REGRESS_TARGETS=run-regress-${PROG} |
6 | 10 | ||
7 | run-regress-${PROG}: ${PROG} | 11 | run-regress-${PROG}: ${PROG} |