upstream: unbreak tests for recent security key changes

OpenBSD-Regress-ID: 2cdf2fcae9962ca4d711338f3ceec3c1391bdf95
This commit is contained in:
djm@openbsd.org 2019-11-25 10:32:35 +00:00 committed by Damien Miller
parent 6498826682
commit c5f1cc9935
7 changed files with 19 additions and 12 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile.inc,v 1.13 2018/10/17 23:28:05 djm Exp $
# $OpenBSD: Makefile.inc,v 1.14 2019/11/25 10:32:35 djm Exp $
REGRESS_FAIL_EARLY?= yes
@ -74,6 +74,9 @@ LDADD+= -lcrypto
DPADD+= ${LIBCRYPTO}
.endif
LDADD+= -lfido2 -lcbor -lusbhid
DPADD+= ${LIBFIDO2} ${LIBCBOR} ${LIBUSBHID}
UNITTEST_ARGS?=
.if (${UNITTEST_VERBOSE:L} != "no")

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.2 2019/11/01 02:06:52 djm Exp $
# $OpenBSD: Makefile,v 1.3 2019/11/25 10:32:35 djm Exp $
PROG=test_authopt
SRCS=tests.c
@ -13,6 +13,7 @@ SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c
SRCS+=addrmatch.c bitmap.c
SRCS+=ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c
SRCS+=cipher-chachapoly.c chacha.c poly1305.c ssh-ecdsa-sk.c ssh-sk.c
SRCS+=ssh-ed25519-sk.c sk-usbhid.c
SRCS+=digest-openssl.c
#SRCS+=digest-libc.c

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.5 2019/11/01 02:04:25 djm Exp $
# $OpenBSD: Makefile,v 1.6 2019/11/25 10:32:35 djm Exp $
PROG=test_hostkeys
SRCS=tests.c test_iterate.c
@ -11,6 +11,7 @@ SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c
SRCS+=addrmatch.c bitmap.c hostfile.c
SRCS+=ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c
SRCS+=cipher-chachapoly.c chacha.c poly1305.c ssh-ecdsa-sk.c ssh-sk.c
SRCS+=ssh-ed25519-sk.c sk-usbhid.c
SRCS+=digest-openssl.c
#SRCS+=digest-libc.c

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.7 2019/11/01 02:03:27 djm Exp $
# $OpenBSD: Makefile,v 1.8 2019/11/25 10:32:35 djm Exp $
PROG=test_kex
SRCS=tests.c test_kex.c
@ -11,6 +11,7 @@ SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c
SRCS+=addrmatch.c bitmap.c packet.c dispatch.c canohost.c ssh_api.c
SRCS+=compat.c ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c
SRCS+=cipher-chachapoly.c chacha.c poly1305.c ssh-ecdsa-sk.c ssh-sk.c
SRCS+=ssh-ed25519-sk.c sk-usbhid.c
SRCS+= kex.c
SRCS+= dh.c

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.7 2019/11/01 01:57:59 djm Exp $
# $OpenBSD: Makefile,v 1.8 2019/11/25 10:32:35 djm Exp $
PROG=test_sshkey
SRCS=tests.c test_sshkey.c test_file.c test_fuzz.c common.c
@ -11,6 +11,7 @@ SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c
SRCS+=addrmatch.c bitmap.c
SRCS+=ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c
SRCS+=cipher-chachapoly.c chacha.c poly1305.c ssh-ecdsa-sk.c ssh-sk.c
SRCS+=ssh-ed25519-sk.c sk-usbhid.c
SRCS+=digest-openssl.c
#SRCS+=digest-libc.c

View File

@ -1,4 +1,4 @@
/* $OpenBSD: test_fuzz.c,v 1.10 2019/11/01 01:57:59 djm Exp $ */
/* $OpenBSD: test_fuzz.c,v 1.11 2019/11/25 10:32:35 djm Exp $ */
/*
* Fuzz tests for key parsing
*
@ -91,7 +91,7 @@ sig_fuzz(struct sshkey *k, const char *sig_alg)
sig_alg, NULL, 0), 0);
ASSERT_SIZE_T_GT(l, 0);
fuzz = fuzz_begin(fuzzers, sig, l);
ASSERT_INT_EQ(sshkey_verify(k, sig, l, c, sizeof(c), NULL, 0), 0);
ASSERT_INT_EQ(sshkey_verify(k, sig, l, c, sizeof(c), NULL, 0, NULL), 0);
free(sig);
TEST_ONERROR(onerror, fuzz);
for(; !fuzz_done(fuzz); fuzz_next(fuzz)) {
@ -99,7 +99,7 @@ sig_fuzz(struct sshkey *k, const char *sig_alg)
if (fuzz_matches_original(fuzz))
continue;
ASSERT_INT_NE(sshkey_verify(k, fuzz_ptr(fuzz), fuzz_len(fuzz),
c, sizeof(c), NULL, 0), 0);
c, sizeof(c), NULL, 0, NULL), 0);
}
fuzz_cleanup(fuzz);
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: test_sshkey.c,v 1.19 2019/11/01 01:57:59 djm Exp $ */
/* $OpenBSD: test_sshkey.c,v 1.20 2019/11/25 10:32:35 djm Exp $ */
/*
* Regress test for sshkey.h key management API
*
@ -123,11 +123,11 @@ signature_test(struct sshkey *k, struct sshkey *bad, const char *sig_alg,
ASSERT_INT_EQ(sshkey_sign(k, &sig, &len, d, l, sig_alg, NULL, 0), 0);
ASSERT_SIZE_T_GT(len, 8);
ASSERT_PTR_NE(sig, NULL);
ASSERT_INT_EQ(sshkey_verify(k, sig, len, d, l, NULL, 0), 0);
ASSERT_INT_NE(sshkey_verify(bad, sig, len, d, l, NULL, 0), 0);
ASSERT_INT_EQ(sshkey_verify(k, sig, len, d, l, NULL, 0, NULL), 0);
ASSERT_INT_NE(sshkey_verify(bad, sig, len, d, l, NULL, 0, NULL), 0);
/* Fuzz test is more comprehensive, this is just a smoke test */
sig[len - 5] ^= 0x10;
ASSERT_INT_NE(sshkey_verify(k, sig, len, d, l, NULL, 0), 0);
ASSERT_INT_NE(sshkey_verify(k, sig, len, d, l, NULL, 0, NULL), 0);
free(sig);
}