summaryrefslogtreecommitdiff
path: root/kexgexs.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2019-01-21 10:05:09 +0000
committerDamien Miller <djm@mindrot.org>2019-01-21 21:47:28 +1100
commitbb39bafb6dc520cc097780f4611a52da7f19c3e2 (patch)
treeb5721488b62d4e8cc1ffa322ae659e5265a0c707 /kexgexs.c
parentdec5e9d33891e3bc3f1395d7db0e56fdc7f86dfc (diff)
downloadopenssh-git-bb39bafb6dc520cc097780f4611a52da7f19c3e2.tar.gz
upstream: factor out kex_load_hostkey() - this is duplicated in
both the client and server implementations for most KEX methods. from markus@ ok djm@ OpenBSD-Commit-ID: 8232fa7c21fbfbcaf838313b0c166dc6c8762f3c
Diffstat (limited to 'kexgexs.c')
-rw-r--r--kexgexs.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/kexgexs.c b/kexgexs.c
index f8eb3654..a617d445 100644
--- a/kexgexs.c
+++ b/kexgexs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kexgexs.c,v 1.40 2019/01/21 10:03:37 djm Exp $ */
+/* $OpenBSD: kexgexs.c,v 1.41 2019/01/21 10:05:09 djm Exp $ */
/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -136,19 +136,9 @@ input_kex_dh_gex_init(int type, u_int32_t seq, struct ssh *ssh)
size_t hashlen;
int r;
- if (kex->load_host_public_key == NULL ||
- kex->load_host_private_key == NULL) {
- r = SSH_ERR_INVALID_ARGUMENT;
+ if ((r = kex_load_hostkey(ssh, &server_host_private,
+ &server_host_public)) != 0)
goto out;
- }
- server_host_public = kex->load_host_public_key(kex->hostkey_type,
- kex->hostkey_nid, ssh);
- server_host_private = kex->load_host_private_key(kex->hostkey_type,
- kex->hostkey_nid, ssh);
- if (server_host_public == NULL) {
- r = SSH_ERR_NO_HOSTKEY_LOADED;
- goto out;
- }
/* key, cert */
if ((r = sshpkt_get_bignum2(ssh, &dh_client_pub)) != 0 ||