summaryrefslogtreecommitdiff
path: root/regress/unittests/kex/test_kex.c
diff options
context:
space:
mode:
Diffstat (limited to 'regress/unittests/kex/test_kex.c')
-rw-r--r--regress/unittests/kex/test_kex.c13
1 files changed, 5 insertions, 8 deletions
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
27struct ssh *active_state = NULL; /* XXX - needed for linking */
28
29void kex_tests(void); 27void kex_tests(void);
30static int do_debug = 0; 28static 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;