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 11:57:14 +0000
commitf0de78bd4f29fa688c5df116f3f9cd43543a76d0 (patch)
tree856b0dee3f2764c13a32dad5ffe2424fab7fef41 /regress/unittests/sshkey/common.c
parent4213eec74e74de6310c27a40c3e9759a08a73996 (diff)
parent8aa3455b16fddea4c0144a7c4a1edb10ec67dcc8 (diff)
Import openssh_8.2p1.orig.tar.gz
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