summaryrefslogtreecommitdiff
path: root/regress/unittests/sshkey/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'regress/unittests/sshkey/common.c')
-rw-r--r--regress/unittests/sshkey/common.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/regress/unittests/sshkey/common.c b/regress/unittests/sshkey/common.c
index e21638093..effea578c 100644
--- a/regress/unittests/sshkey/common.c
+++ b/regress/unittests/sshkey/common.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: common.c,v 1.3 2018/09/13 09:03:20 djm Exp $ */ 1/* $OpenBSD: common.c,v 1.4 2020/01/26 00:09:50 djm Exp $ */
2/* 2/*
3 * Helpers for key API tests 3 * Helpers for key API tests
4 * 4 *
@@ -43,13 +43,10 @@
43struct sshbuf * 43struct sshbuf *
44load_file(const char *name) 44load_file(const char *name)
45{ 45{
46 int fd; 46 struct sshbuf *ret = NULL;
47 struct sshbuf *ret;
48 47
49 ASSERT_PTR_NE(ret = sshbuf_new(), NULL); 48 ASSERT_INT_EQ(sshbuf_load_file(test_data_file(name), &ret), 0);
50 ASSERT_INT_NE(fd = open(test_data_file(name), O_RDONLY), -1); 49 ASSERT_PTR_NE(ret, NULL);
51 ASSERT_INT_EQ(sshkey_load_file(fd, ret), 0);
52 close(fd);
53 return ret; 50 return ret;
54} 51}
55 52