summaryrefslogtreecommitdiffstats
path: root/regress/usr.bin/ssh/unittests/sshkey/common.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2020-01-26 00:09:50 +0000
committerdjm <djm@openbsd.org>2020-01-26 00:09:50 +0000
commit0ad1e263397325ab8b0450a01a518d38a70accb0 (patch)
tree567052855005ae2755e74a2c8f649168837a7bde /regress/usr.bin/ssh/unittests/sshkey/common.c
parentIn nexthop_update() only add a nexthop to the nexthop_runners queue if (diff)
downloadwireguard-openbsd-0ad1e263397325ab8b0450a01a518d38a70accb0.tar.xz
wireguard-openbsd-0ad1e263397325ab8b0450a01a518d38a70accb0.zip
unbreak unittests for recent API / source file changes
Diffstat (limited to 'regress/usr.bin/ssh/unittests/sshkey/common.c')
-rw-r--r--regress/usr.bin/ssh/unittests/sshkey/common.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/regress/usr.bin/ssh/unittests/sshkey/common.c b/regress/usr.bin/ssh/unittests/sshkey/common.c
index 2c579b127ee..6b2ccdbf88a 100644
--- a/regress/usr.bin/ssh/unittests/sshkey/common.c
+++ b/regress/usr.bin/ssh/unittests/sshkey/common.c
@@ -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
*
@@ -33,13 +33,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;
}