Skip to content

Commit

Permalink
upstream: unbreak unittests for recent API / source file changes
Browse files Browse the repository at this point in the history
OpenBSD-Regress-ID: 075a899a01bbf7781d38bf0b33d8366faaf6d3c0
  • Loading branch information
djmdjm authored and daztucker committed Jan 26, 2020
1 parent 0373f9e commit f73ab8a
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 29 deletions.
4 changes: 2 additions & 2 deletions regress/misc/kexfuzz/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.6 2019/12/15 18:58:33 djm Exp $
# $OpenBSD: Makefile,v 1.7 2020/01/26 00:09:50 djm Exp $

.include <bsd.own.mk>
.include <bsd.obj.mk>
Expand All @@ -20,7 +20,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
SRCS+=ssh-ecdsa-sk.c ssh-ed25519-sk.c msg.c ssh-sk-client.c
SRCS+=sshbuf-io.c ssh-ecdsa-sk.c ssh-ed25519-sk.c msg.c ssh-sk-client.c

SRCS+= kex.c
SRCS+= dh.c
Expand Down
8 changes: 2 additions & 6 deletions regress/misc/kexfuzz/kexfuzz.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: kexfuzz.c,v 1.5 2019/01/21 12:50:12 djm Exp $ */
/* $OpenBSD: kexfuzz.c,v 1.6 2020/01/26 00:09:50 djm Exp $ */
/*
* Fuzz harness for KEX code
*
Expand Down Expand Up @@ -424,12 +424,8 @@ main(int argc, char **argv)
if (packet_index == -1 || direction == -1 || data_path == NULL)
badusage("Replace (-r) mode must specify direction "
"(-D) packet index (-i) and data path (-f)");
if ((fd = open(data_path, O_RDONLY)) == -1)
err(1, "open %s", data_path);
replace_data = sshbuf_new();
if ((r = sshkey_load_file(fd, replace_data)) != 0)
if ((r = sshbuf_load_file(data_path, &replace_data)) != 0)
errx(1, "read %s: %s", data_path, ssh_err(r));
close(fd);
}

/* Dump mode */
Expand Down
6 changes: 3 additions & 3 deletions regress/unittests/authopt/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.3 2019/11/25 10:32:35 djm Exp $
# $OpenBSD: Makefile,v 1.4 2020/01/26 00:09:50 djm Exp $

PROG=test_authopt
SRCS=tests.c
Expand All @@ -7,8 +7,8 @@ SRCS+=auth-options.c

# From usr.bin/ssh
SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c
SRCS+=atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c ssh-dss.c
SRCS+=ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c
SRCS+=sshbuf-io.c atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c
SRCS+=ssh-dss.c ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c
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
Expand Down
6 changes: 3 additions & 3 deletions regress/unittests/hostkeys/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# $OpenBSD: Makefile,v 1.6 2019/11/25 10:32:35 djm Exp $
# $OpenBSD: Makefile,v 1.7 2020/01/26 00:09:50 djm Exp $

PROG=test_hostkeys
SRCS=tests.c test_iterate.c

# From usr.bin/ssh
SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c
SRCS+=atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c ssh-dss.c
SRCS+=ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c
SRCS+=sshbuf-io.c atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c
SRCS+=ssh-dss.c ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c
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
Expand Down
6 changes: 3 additions & 3 deletions regress/unittests/kex/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# $OpenBSD: Makefile,v 1.8 2019/11/25 10:32:35 djm Exp $
# $OpenBSD: Makefile,v 1.9 2020/01/26 00:09:50 djm Exp $

PROG=test_kex
SRCS=tests.c test_kex.c

# From usr.bin/ssh
SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c
SRCS+=atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c ssh-dss.c
SRCS+=ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c
SRCS+=sshbuf-io.c atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c
SRCS+=ssh-dss.c ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c
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
Expand Down
4 changes: 2 additions & 2 deletions regress/unittests/sshbuf/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.7 2018/10/17 23:28:05 djm Exp $
# $OpenBSD: Makefile,v 1.8 2020/01/26 00:09:50 djm Exp $

.include <bsd.regress.mk>

Expand All @@ -14,7 +14,7 @@ SRCS+=test_sshbuf_fixed.c

# From usr.bin/ssh
SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c
SRCS+=atomicio.c
SRCS+=sshbuf-io.c atomicio.c misc.c xmalloc.c log.c fatal.c ssherr.c cleanup.c

run-regress-${PROG}: ${PROG}
env ${TEST_ENV} ./${PROG} ${UNITTEST_ARGS}
Expand Down
6 changes: 3 additions & 3 deletions regress/unittests/sshkey/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# $OpenBSD: Makefile,v 1.8 2019/11/25 10:32:35 djm Exp $
# $OpenBSD: Makefile,v 1.9 2020/01/26 00:09:50 djm Exp $

PROG=test_sshkey
SRCS=tests.c test_sshkey.c test_file.c test_fuzz.c common.c

# From usr.bin/ssh
SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c
SRCS+=atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c ssh-dss.c
SRCS+=ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c
SRCS+=sshbuf-io.c atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c
SRCS+=ssh-dss.c ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c
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
Expand Down
11 changes: 4 additions & 7 deletions regress/unittests/sshkey/common.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: common.c,v 1.3 2018/09/13 09:03:20 djm Exp $ */
/* $OpenBSD: common.c,v 1.4 2020/01/26 00:09:50 djm Exp $ */
/*
* Helpers for key API tests
*
Expand Down Expand Up @@ -43,13 +43,10 @@
struct sshbuf *
load_file(const char *name)
{
int fd;
struct sshbuf *ret;
struct sshbuf *ret = NULL;

ASSERT_PTR_NE(ret = sshbuf_new(), NULL);
ASSERT_INT_NE(fd = open(test_data_file(name), O_RDONLY), -1);
ASSERT_INT_EQ(sshkey_load_file(fd, ret), 0);
close(fd);
ASSERT_INT_EQ(sshbuf_load_file(test_data_file(name), &ret), 0);
ASSERT_PTR_NE(ret, NULL);
return ret;
}

Expand Down

0 comments on commit f73ab8a

Please sign in to comment.