summaryrefslogtreecommitdiff
path: root/regress/unittests/sshkey/common.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2020-02-21 11:57:14 +0000
committerColin Watson <cjwatson@debian.org>2020-02-21 14:27:02 +0000
commit886e47e745586c34e81cfd5c5fb9b5dbc8e84d04 (patch)
treedd6c3b4dc64a17c520af7aaf213163f8a0a63e56 /regress/unittests/sshkey/common.c
parentac2b4c0697fcac554041ab95f81736887eadf6ec (diff)
parenta2dabf35ce0228c86a288d11cc847a9d9801604f (diff)
New upstream release (8.2p1)
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