diff options
author | Colin Watson <cjwatson@debian.org> | 2019-06-05 06:41:44 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2019-06-05 06:41:44 +0100 |
commit | 102062f825fb26a74295a1c089c00c4c4c76b68a (patch) | |
tree | 3db66bc8c8483cce66516dff36f6ef56065143d9 /regress/unittests/kex | |
parent | 3d246f10429fc9a37b98eabef94fe8dc7c61002b (diff) | |
parent | fd0fa130ecf06d7d092932adcd5d77f1549bfc8d (diff) |
Import openssh_8.0p1.orig.tar.gz
Diffstat (limited to 'regress/unittests/kex')
-rw-r--r-- | regress/unittests/kex/Makefile | 21 | ||||
-rw-r--r-- | regress/unittests/kex/test_kex.c | 13 |
2 files changed, 20 insertions, 14 deletions
diff --git a/regress/unittests/kex/Makefile b/regress/unittests/kex/Makefile index 5c61307a3..7b4c644e5 100644 --- a/regress/unittests/kex/Makefile +++ b/regress/unittests/kex/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.5 2017/12/21 00:41:22 djm Exp $ | 1 | # $OpenBSD: Makefile,v 1.6 2019/01/21 12:35:20 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 |
@@ -9,12 +9,21 @@ SRCS+=atomicio.c sshkey.c authfile.c cipher.c log.c ssh-rsa.c ssh-dss.c | |||
9 | SRCS+=ssh-ecdsa.c ssh-ed25519.c mac.c umac.c umac128.c hmac.c misc.c | 9 | SRCS+=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+=kex.c kexc25519.c kexc25519c.c kexc25519s.c kexdh.c kexdhc.c kexdhs.c | 12 | SRCS+=compat.c ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c |
13 | SRCS+=kexecdh.c kexecdhc.c kexecdhs.c kexgex.c kexgexc.c kexgexs.c | ||
14 | SRCS+=dh.c compat.c | ||
15 | SRCS+=ed25519.c hash.c ge25519.c fe25519.c sc25519.c verify.c | ||
16 | SRCS+=cipher-chachapoly.c chacha.c poly1305.c | 13 | SRCS+=cipher-chachapoly.c chacha.c poly1305.c |
17 | SRCS+=smult_curve25519_ref.c | 14 | |
15 | SRCS+= kex.c | ||
16 | SRCS+= dh.c | ||
17 | SRCS+= kexdh.c | ||
18 | SRCS+= kexecdh.c | ||
19 | SRCS+= kexgex.c | ||
20 | SRCS+= kexgexc.c | ||
21 | SRCS+= kexgexs.c | ||
22 | SRCS+= kexc25519.c | ||
23 | SRCS+= smult_curve25519_ref.c | ||
24 | SRCS+= kexgen.c | ||
25 | SRCS+= kexsntrup4591761x25519.c | ||
26 | SRCS+= sntrup4591761.c | ||
18 | 27 | ||
19 | SRCS+=digest-openssl.c | 28 | SRCS+=digest-openssl.c |
20 | #SRCS+=digest-libc.c | 29 | #SRCS+=digest-libc.c |
diff --git a/regress/unittests/kex/test_kex.c b/regress/unittests/kex/test_kex.c index 6e5999bb9..a860efc02 100644 --- a/regress/unittests/kex/test_kex.c +++ b/regress/unittests/kex/test_kex.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: test_kex.c,v 1.2 2015/07/10 06:23:25 markus Exp $ */ | 1 | /* $OpenBSD: test_kex.c,v 1.4 2019/01/21 12:35:20 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Regress test KEX | 3 | * Regress test KEX |
4 | * | 4 | * |
@@ -24,8 +24,6 @@ | |||
24 | #include "packet.h" | 24 | #include "packet.h" |
25 | #include "myproposal.h" | 25 | #include "myproposal.h" |
26 | 26 | ||
27 | struct ssh *active_state = NULL; /* XXX - needed for linking */ | ||
28 | |||
29 | void kex_tests(void); | 27 | void kex_tests(void); |
30 | static int do_debug = 0; | 28 | static int do_debug = 0; |
31 | 29 | ||
@@ -139,20 +137,19 @@ do_kex_with_key(char *kex, int keytype, int bits) | |||
139 | ASSERT_INT_EQ(ssh_init(&server2, 1, NULL), 0); | 137 | ASSERT_INT_EQ(ssh_init(&server2, 1, NULL), 0); |
140 | ASSERT_PTR_NE(server2, NULL); | 138 | ASSERT_PTR_NE(server2, NULL); |
141 | ASSERT_INT_EQ(ssh_add_hostkey(server2, private), 0); | 139 | ASSERT_INT_EQ(ssh_add_hostkey(server2, private), 0); |
142 | kex_free(server2->kex); /* XXX or should ssh_packet_set_state()? */ | ||
143 | ASSERT_INT_EQ(ssh_packet_set_state(server2, state), 0); | 140 | ASSERT_INT_EQ(ssh_packet_set_state(server2, state), 0); |
144 | ASSERT_INT_EQ(sshbuf_len(state), 0); | 141 | ASSERT_INT_EQ(sshbuf_len(state), 0); |
145 | sshbuf_free(state); | 142 | sshbuf_free(state); |
146 | ASSERT_PTR_NE(server2->kex, NULL); | 143 | ASSERT_PTR_NE(server2->kex, NULL); |
147 | /* XXX we need to set the callbacks */ | 144 | /* XXX we need to set the callbacks */ |
148 | server2->kex->kex[KEX_DH_GRP1_SHA1] = kexdh_server; | 145 | server2->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_server; |
149 | server2->kex->kex[KEX_DH_GRP14_SHA1] = kexdh_server; | 146 | server2->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_server; |
150 | server2->kex->kex[KEX_DH_GEX_SHA1] = kexgex_server; | 147 | server2->kex->kex[KEX_DH_GEX_SHA1] = kexgex_server; |
151 | server2->kex->kex[KEX_DH_GEX_SHA256] = kexgex_server; | 148 | server2->kex->kex[KEX_DH_GEX_SHA256] = kexgex_server; |
152 | #ifdef OPENSSL_HAS_ECC | 149 | #ifdef OPENSSL_HAS_ECC |
153 | server2->kex->kex[KEX_ECDH_SHA2] = kexecdh_server; | 150 | server2->kex->kex[KEX_ECDH_SHA2] = kex_gen_server; |
154 | #endif | 151 | #endif |
155 | server2->kex->kex[KEX_C25519_SHA256] = kexc25519_server; | 152 | server2->kex->kex[KEX_C25519_SHA256] = kex_gen_server; |
156 | server2->kex->load_host_public_key = server->kex->load_host_public_key; | 153 | server2->kex->load_host_public_key = server->kex->load_host_public_key; |
157 | server2->kex->load_host_private_key = server->kex->load_host_private_key; | 154 | server2->kex->load_host_private_key = server->kex->load_host_private_key; |
158 | server2->kex->sign = server->kex->sign; | 155 | server2->kex->sign = server->kex->sign; |