summaryrefslogtreecommitdiff
path: root/regress/usr.bin/ssh/unittests/kex/test_kex.c
diff options
context:
space:
mode:
Diffstat (limited to 'regress/usr.bin/ssh/unittests/kex/test_kex.c')
-rw-r--r--regress/usr.bin/ssh/unittests/kex/test_kex.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/regress/usr.bin/ssh/unittests/kex/test_kex.c b/regress/usr.bin/ssh/unittests/kex/test_kex.c
index e906477639d..65bd97ebf9f 100644
--- a/regress/usr.bin/ssh/unittests/kex/test_kex.c
+++ b/regress/usr.bin/ssh/unittests/kex/test_kex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: test_kex.c,v 1.1 2015/01/15 23:41:29 markus Exp $ */
+/* $OpenBSD: test_kex.c,v 1.2 2015/07/10 06:23:25 markus Exp $ */
/*
* Regress test KEX
*
@@ -79,6 +79,7 @@ do_kex_with_key(char *kex, int keytype, int bits)
struct sshbuf *state;
struct kex_params kex_params;
char *myproposal[PROPOSAL_MAX] = { KEX_CLIENT };
+ char *keyname = NULL;
TEST_START("sshkey_generate");
ASSERT_INT_EQ(sshkey_generate(keytype, bits, &private), 0);
@@ -92,6 +93,9 @@ do_kex_with_key(char *kex, int keytype, int bits)
memcpy(kex_params.proposal, myproposal, sizeof(myproposal));
if (kex != NULL)
kex_params.proposal[PROPOSAL_KEX_ALGS] = kex;
+ keyname = strdup(sshkey_ssh_name(private));
+ ASSERT_PTR_NE(keyname, NULL);
+ kex_params.proposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = keyname;
ASSERT_INT_EQ(ssh_init(&client, 0, &kex_params), 0);
ASSERT_INT_EQ(ssh_init(&server, 1, &kex_params), 0);
ASSERT_PTR_NE(client, NULL);
@@ -159,6 +163,7 @@ do_kex_with_key(char *kex, int keytype, int bits)
ssh_free(client);
ssh_free(server);
ssh_free(server2);
+ free(keyname);
TEST_DONE();
}