diff options
Diffstat (limited to 'kexdhs.c')
-rw-r--r-- | kexdhs.c | 16 |
1 files changed, 3 insertions, 13 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: kexdhs.c,v 1.34 2019/01/21 10:03:37 djm Exp $ */ | 1 | /* $OpenBSD: kexdhs.c,v 1.35 2019/01/21 10:05:09 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2001 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -81,19 +81,9 @@ input_kex_dh_init(int type, u_int32_t seq, struct ssh *ssh) | |||
81 | size_t hashlen; | 81 | size_t hashlen; |
82 | int r; | 82 | int r; |
83 | 83 | ||
84 | if (kex->load_host_public_key == NULL || | 84 | if ((r = kex_load_hostkey(ssh, &server_host_private, |
85 | kex->load_host_private_key == NULL) { | 85 | &server_host_public)) != 0) |
86 | r = SSH_ERR_INVALID_ARGUMENT; | ||
87 | goto out; | 86 | goto out; |
88 | } | ||
89 | server_host_public = kex->load_host_public_key(kex->hostkey_type, | ||
90 | kex->hostkey_nid, ssh); | ||
91 | server_host_private = kex->load_host_private_key(kex->hostkey_type, | ||
92 | kex->hostkey_nid, ssh); | ||
93 | if (server_host_public == NULL) { | ||
94 | r = SSH_ERR_NO_HOSTKEY_LOADED; | ||
95 | goto out; | ||
96 | } | ||
97 | 87 | ||
98 | /* key, cert */ | 88 | /* key, cert */ |
99 | if ((r = sshpkt_get_bignum2(ssh, &dh_client_pub)) != 0 || | 89 | if ((r = sshpkt_get_bignum2(ssh, &dh_client_pub)) != 0 || |