Lines Matching refs:ssh

54 static int input_kex_dh_gex_group(int, u_int32_t, struct ssh *);
55 static int input_kex_dh_gex_reply(int, u_int32_t, struct ssh *);
58 kexgex_client(struct ssh *ssh) in kexgex_client() argument
60 struct kex *kex = ssh->kex; in kexgex_client()
69 if (ssh->compat & SSH_BUG_DHGEX_LARGE) in kexgex_client()
72 if ((r = sshpkt_start(ssh, SSH2_MSG_KEX_DH_GEX_REQUEST)) != 0 || in kexgex_client()
73 (r = sshpkt_put_u32(ssh, kex->min)) != 0 || in kexgex_client()
74 (r = sshpkt_put_u32(ssh, kex->nbits)) != 0 || in kexgex_client()
75 (r = sshpkt_put_u32(ssh, kex->max)) != 0 || in kexgex_client()
76 (r = sshpkt_send(ssh)) != 0) in kexgex_client()
85 ssh_dispatch_set(ssh, SSH2_MSG_KEX_DH_GEX_GROUP, in kexgex_client()
93 input_kex_dh_gex_group(int type, u_int32_t seq, struct ssh *ssh) in input_kex_dh_gex_group() argument
95 struct kex *kex = ssh->kex; in input_kex_dh_gex_group()
101 ssh_dispatch_set(ssh, SSH2_MSG_KEX_DH_GEX_GROUP, &kex_protocol_error); in input_kex_dh_gex_group()
103 if ((r = sshpkt_get_bignum2(ssh, &p)) != 0 || in input_kex_dh_gex_group()
104 (r = sshpkt_get_bignum2(ssh, &g)) != 0 || in input_kex_dh_gex_group()
105 (r = sshpkt_get_end(ssh)) != 0) in input_kex_dh_gex_group()
122 if ((r = sshpkt_start(ssh, SSH2_MSG_KEX_DH_GEX_INIT)) != 0 || in input_kex_dh_gex_group()
123 (r = sshpkt_put_bignum2(ssh, pub_key)) != 0 || in input_kex_dh_gex_group()
124 (r = sshpkt_send(ssh)) != 0) in input_kex_dh_gex_group()
134 ssh_dispatch_set(ssh, SSH2_MSG_KEX_DH_GEX_REPLY, &input_kex_dh_gex_reply); in input_kex_dh_gex_group()
143 input_kex_dh_gex_reply(int type, u_int32_t seq, struct ssh *ssh) in input_kex_dh_gex_reply() argument
145 struct kex *kex = ssh->kex; in input_kex_dh_gex_reply()
157 ssh_dispatch_set(ssh, SSH2_MSG_KEX_DH_GEX_REPLY, &kex_protocol_error); in input_kex_dh_gex_reply()
160 if ((r = sshpkt_getb_froms(ssh, &server_host_key_blob)) != 0) in input_kex_dh_gex_reply()
168 (r = kex_verify_host_key(ssh, server_host_key)) != 0) in input_kex_dh_gex_reply()
171 if ((r = sshpkt_get_bignum2(ssh, &dh_server_pub)) != 0 || in input_kex_dh_gex_reply()
172 (r = sshpkt_get_string(ssh, &signature, &slen)) != 0 || in input_kex_dh_gex_reply()
173 (r = sshpkt_get_end(ssh)) != 0) in input_kex_dh_gex_reply()
181 if (ssh->compat & SSH_OLD_DHGEX) in input_kex_dh_gex_reply()
204 hashlen, kex->hostkey_alg, ssh->compat, NULL)) != 0) in input_kex_dh_gex_reply()
207 if ((r = kex_derive_keys(ssh, hash, hashlen, shared_secret)) != 0 || in input_kex_dh_gex_reply()
208 (r = kex_send_newkeys(ssh)) != 0) in input_kex_dh_gex_reply()