summaryrefslogtreecommitdiff
path: root/kexgssc.c
diff options
context:
space:
mode:
Diffstat (limited to 'kexgssc.c')
-rw-r--r--kexgssc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/kexgssc.c b/kexgssc.c
index 953c0a248..3c8ae08dd 100644
--- a/kexgssc.c
+++ b/kexgssc.c
@@ -56,6 +56,7 @@ kexgss_client(struct ssh *ssh) {
56 DH *dh; 56 DH *dh;
57 BIGNUM *dh_server_pub = NULL; 57 BIGNUM *dh_server_pub = NULL;
58 BIGNUM *shared_secret = NULL; 58 BIGNUM *shared_secret = NULL;
59 const BIGNUM *pub_key, *dh_p, *dh_g;
59 BIGNUM *p = NULL; 60 BIGNUM *p = NULL;
60 BIGNUM *g = NULL; 61 BIGNUM *g = NULL;
61 u_char *kbuf; 62 u_char *kbuf;
@@ -120,6 +121,8 @@ kexgss_client(struct ssh *ssh) {
120 121
121 /* Step 1 - e is dh->pub_key */ 122 /* Step 1 - e is dh->pub_key */
122 dh_gen_key(dh, ssh->kex->we_need * 8); 123 dh_gen_key(dh, ssh->kex->we_need * 8);
124 DH_get0_key(dh, &pub_key, NULL);
125 DH_get0_pqg(dh, &dh_p, NULL, &dh_g);
123 126
124 /* This is f, we initialise it now to make life easier */ 127 /* This is f, we initialise it now to make life easier */
125 dh_server_pub = BN_new(); 128 dh_server_pub = BN_new();
@@ -167,7 +170,7 @@ kexgss_client(struct ssh *ssh) {
167 packet_start(SSH2_MSG_KEXGSS_INIT); 170 packet_start(SSH2_MSG_KEXGSS_INIT);
168 packet_put_string(send_tok.value, 171 packet_put_string(send_tok.value,
169 send_tok.length); 172 send_tok.length);
170 packet_put_bignum2(dh->pub_key); 173 packet_put_bignum2(pub_key);
171 first = 0; 174 first = 0;
172 } else { 175 } else {
173 packet_start(SSH2_MSG_KEXGSS_CONTINUE); 176 packet_start(SSH2_MSG_KEXGSS_CONTINUE);
@@ -276,7 +279,7 @@ kexgss_client(struct ssh *ssh) {
276 sshbuf_ptr(ssh->kex->my), sshbuf_len(ssh->kex->my), 279 sshbuf_ptr(ssh->kex->my), sshbuf_len(ssh->kex->my),
277 sshbuf_ptr(ssh->kex->peer), sshbuf_len(ssh->kex->peer), 280 sshbuf_ptr(ssh->kex->peer), sshbuf_len(ssh->kex->peer),
278 (serverhostkey ? serverhostkey : empty), slen, 281 (serverhostkey ? serverhostkey : empty), slen,
279 dh->pub_key, /* e */ 282 pub_key, /* e */
280 dh_server_pub, /* f */ 283 dh_server_pub, /* f */
281 shared_secret, /* K */ 284 shared_secret, /* K */
282 hash, &hashlen 285 hash, &hashlen
@@ -291,8 +294,8 @@ kexgss_client(struct ssh *ssh) {
291 sshbuf_ptr(ssh->kex->peer), sshbuf_len(ssh->kex->peer), 294 sshbuf_ptr(ssh->kex->peer), sshbuf_len(ssh->kex->peer),
292 (serverhostkey ? serverhostkey : empty), slen, 295 (serverhostkey ? serverhostkey : empty), slen,
293 min, nbits, max, 296 min, nbits, max,
294 dh->p, dh->g, 297 dh_p, dh_g,
295 dh->pub_key, 298 pub_key,
296 dh_server_pub, 299 dh_server_pub,
297 shared_secret, 300 shared_secret,
298 hash, &hashlen 301 hash, &hashlen