diff options
Diffstat (limited to 'regress')
-rw-r--r-- | regress/misc/kexfuzz/Makefile | 4 | ||||
-rw-r--r-- | regress/misc/kexfuzz/kexfuzz.c | 8 | ||||
-rw-r--r-- | regress/unittests/authopt/Makefile | 6 | ||||
-rw-r--r-- | regress/unittests/hostkeys/Makefile | 6 | ||||
-rw-r--r-- | regress/unittests/kex/Makefile | 6 | ||||
-rw-r--r-- | regress/unittests/sshbuf/Makefile | 4 | ||||
-rw-r--r-- | regress/unittests/sshkey/Makefile | 6 | ||||
-rw-r--r-- | regress/unittests/sshkey/common.c | 11 |
8 files changed, 22 insertions, 29 deletions
diff --git a/regress/misc/kexfuzz/Makefile b/regress/misc/kexfuzz/Makefile index 9cac412dc..9eb86931c 100644 --- a/regress/misc/kexfuzz/Makefile +++ b/regress/misc/kexfuzz/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.6 2019/12/15 18:58:33 djm Exp $ | 1 | # $OpenBSD: Makefile,v 1.7 2020/01/26 00:09:50 djm Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
4 | .include <bsd.obj.mk> | 4 | .include <bsd.obj.mk> |
@@ -20,7 +20,7 @@ SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c | |||
20 | SRCS+=addrmatch.c bitmap.c packet.c dispatch.c canohost.c ssh_api.c | 20 | SRCS+=addrmatch.c bitmap.c packet.c dispatch.c canohost.c ssh_api.c |
21 | SRCS+=compat.c ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c | 21 | SRCS+=compat.c ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c |
22 | SRCS+=cipher-chachapoly.c chacha.c poly1305.c | 22 | SRCS+=cipher-chachapoly.c chacha.c poly1305.c |
23 | SRCS+=ssh-ecdsa-sk.c ssh-ed25519-sk.c msg.c ssh-sk-client.c | 23 | SRCS+=sshbuf-io.c ssh-ecdsa-sk.c ssh-ed25519-sk.c msg.c ssh-sk-client.c |
24 | 24 | ||
25 | SRCS+= kex.c | 25 | SRCS+= kex.c |
26 | SRCS+= dh.c | 26 | SRCS+= dh.c |
diff --git a/regress/misc/kexfuzz/kexfuzz.c b/regress/misc/kexfuzz/kexfuzz.c index 7051e87b1..56697c918 100644 --- a/regress/misc/kexfuzz/kexfuzz.c +++ b/regress/misc/kexfuzz/kexfuzz.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: kexfuzz.c,v 1.5 2019/01/21 12:50:12 djm Exp $ */ | 1 | /* $OpenBSD: kexfuzz.c,v 1.6 2020/01/26 00:09:50 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Fuzz harness for KEX code | 3 | * Fuzz harness for KEX code |
4 | * | 4 | * |
@@ -424,12 +424,8 @@ main(int argc, char **argv) | |||
424 | if (packet_index == -1 || direction == -1 || data_path == NULL) | 424 | if (packet_index == -1 || direction == -1 || data_path == NULL) |
425 | badusage("Replace (-r) mode must specify direction " | 425 | badusage("Replace (-r) mode must specify direction " |
426 | "(-D) packet index (-i) and data path (-f)"); | 426 | "(-D) packet index (-i) and data path (-f)"); |
427 | if ((fd = open(data_path, O_RDONLY)) == -1) | 427 | if ((r = sshbuf_load_file(data_path, &replace_data)) != 0) |
428 | err(1, "open %s", data_path); | ||
429 | replace_data = sshbuf_new(); | ||
430 | if ((r = sshkey_load_file(fd, replace_data)) != 0) | ||
431 | errx(1, "read %s: %s", data_path, ssh_err(r)); | 428 | errx(1, "read %s: %s", data_path, ssh_err(r)); |
432 | close(fd); | ||
433 | } | 429 | } |
434 | 430 | ||
435 | /* Dump mode */ | 431 | /* Dump mode */ |
diff --git a/regress/unittests/authopt/Makefile b/regress/unittests/authopt/Makefile index dfec25174..492092fc6 100644 --- a/regress/unittests/authopt/Makefile +++ b/regress/unittests/authopt/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.3 2019/11/25 10:32:35 djm Exp $ | 1 | # $OpenBSD: Makefile,v 1.4 2020/01/26 00:09:50 djm Exp $ |
2 | 2 | ||
3 | PROG=test_authopt | 3 | PROG=test_authopt |
4 | SRCS=tests.c | 4 | SRCS=tests.c |
@@ -7,8 +7,8 @@ SRCS+=auth-options.c | |||
7 | 7 | ||
8 | # From usr.bin/ssh | 8 | # From usr.bin/ssh |
9 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c | 9 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c |
10 | SRCS+=atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c ssh-dss.c | 10 | SRCS+=sshbuf-io.c atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c |
11 | SRCS+=ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c | 11 | SRCS+=ssh-dss.c ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c |
12 | SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c | 12 | SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c |
13 | SRCS+=addrmatch.c bitmap.c | 13 | SRCS+=addrmatch.c bitmap.c |
14 | SRCS+=ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c | 14 | SRCS+=ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c |
diff --git a/regress/unittests/hostkeys/Makefile b/regress/unittests/hostkeys/Makefile index e3632c43d..c0a893135 100644 --- a/regress/unittests/hostkeys/Makefile +++ b/regress/unittests/hostkeys/Makefile | |||
@@ -1,12 +1,12 @@ | |||
1 | # $OpenBSD: Makefile,v 1.6 2019/11/25 10:32:35 djm Exp $ | 1 | # $OpenBSD: Makefile,v 1.7 2020/01/26 00:09:50 djm Exp $ |
2 | 2 | ||
3 | PROG=test_hostkeys | 3 | PROG=test_hostkeys |
4 | SRCS=tests.c test_iterate.c | 4 | SRCS=tests.c test_iterate.c |
5 | 5 | ||
6 | # From usr.bin/ssh | 6 | # From usr.bin/ssh |
7 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c | 7 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c |
8 | SRCS+=atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c ssh-dss.c | 8 | SRCS+=sshbuf-io.c atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c |
9 | SRCS+=ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c | 9 | SRCS+=ssh-dss.c ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c |
10 | SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c | 10 | SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c |
11 | SRCS+=addrmatch.c bitmap.c hostfile.c | 11 | SRCS+=addrmatch.c bitmap.c hostfile.c |
12 | SRCS+=ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c | 12 | SRCS+=ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c |
diff --git a/regress/unittests/kex/Makefile b/regress/unittests/kex/Makefile index c897a7ef5..648006c78 100644 --- a/regress/unittests/kex/Makefile +++ b/regress/unittests/kex/Makefile | |||
@@ -1,12 +1,12 @@ | |||
1 | # $OpenBSD: Makefile,v 1.8 2019/11/25 10:32:35 djm Exp $ | 1 | # $OpenBSD: Makefile,v 1.9 2020/01/26 00:09:50 djm Exp $ |
2 | 2 | ||
3 | PROG=test_kex | 3 | PROG=test_kex |
4 | SRCS=tests.c test_kex.c | 4 | SRCS=tests.c test_kex.c |
5 | 5 | ||
6 | # From usr.bin/ssh | 6 | # From usr.bin/ssh |
7 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c | 7 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c |
8 | SRCS+=atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c ssh-dss.c | 8 | SRCS+=sshbuf-io.c atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c |
9 | SRCS+=ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c | 9 | SRCS+=ssh-dss.c ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c |
10 | SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c | 10 | SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c |
11 | SRCS+=addrmatch.c bitmap.c packet.c dispatch.c canohost.c ssh_api.c | 11 | SRCS+=addrmatch.c bitmap.c packet.c dispatch.c canohost.c ssh_api.c |
12 | SRCS+=compat.c ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c | 12 | SRCS+=compat.c ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c |
diff --git a/regress/unittests/sshbuf/Makefile b/regress/unittests/sshbuf/Makefile index 0e8e9fd10..388cb5a78 100644 --- a/regress/unittests/sshbuf/Makefile +++ b/regress/unittests/sshbuf/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.7 2018/10/17 23:28:05 djm Exp $ | 1 | # $OpenBSD: Makefile,v 1.8 2020/01/26 00:09:50 djm Exp $ |
2 | 2 | ||
3 | .include <bsd.regress.mk> | 3 | .include <bsd.regress.mk> |
4 | 4 | ||
@@ -14,7 +14,7 @@ SRCS+=test_sshbuf_fixed.c | |||
14 | 14 | ||
15 | # From usr.bin/ssh | 15 | # From usr.bin/ssh |
16 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c | 16 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c |
17 | SRCS+=atomicio.c | 17 | SRCS+=sshbuf-io.c atomicio.c misc.c xmalloc.c log.c fatal.c ssherr.c cleanup.c |
18 | 18 | ||
19 | run-regress-${PROG}: ${PROG} | 19 | run-regress-${PROG}: ${PROG} |
20 | env ${TEST_ENV} ./${PROG} ${UNITTEST_ARGS} | 20 | env ${TEST_ENV} ./${PROG} ${UNITTEST_ARGS} |
diff --git a/regress/unittests/sshkey/Makefile b/regress/unittests/sshkey/Makefile index 607a6d3fd..78b2cf0ce 100644 --- a/regress/unittests/sshkey/Makefile +++ b/regress/unittests/sshkey/Makefile | |||
@@ -1,12 +1,12 @@ | |||
1 | # $OpenBSD: Makefile,v 1.8 2019/11/25 10:32:35 djm Exp $ | 1 | # $OpenBSD: Makefile,v 1.9 2020/01/26 00:09:50 djm Exp $ |
2 | 2 | ||
3 | PROG=test_sshkey | 3 | PROG=test_sshkey |
4 | SRCS=tests.c test_sshkey.c test_file.c test_fuzz.c common.c | 4 | SRCS=tests.c test_sshkey.c test_file.c test_fuzz.c common.c |
5 | 5 | ||
6 | # From usr.bin/ssh | 6 | # From usr.bin/ssh |
7 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c | 7 | SRCS+=sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf-misc.c sshbuf.c |
8 | SRCS+=atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c ssh-dss.c | 8 | SRCS+=sshbuf-io.c atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c |
9 | SRCS+=ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c | 9 | SRCS+=ssh-dss.c ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c |
10 | SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c | 10 | SRCS+=ssherr.c uidswap.c cleanup.c xmalloc.c match.c krl.c fatal.c |
11 | SRCS+=addrmatch.c bitmap.c | 11 | SRCS+=addrmatch.c bitmap.c |
12 | SRCS+=ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c | 12 | SRCS+=ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c |
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 @@ | |||
43 | struct sshbuf * | 43 | struct sshbuf * |
44 | load_file(const char *name) | 44 | load_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 | ||