summaryrefslogtreecommitdiff
path: root/kexgexc.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2017-10-04 11:23:58 +0100
committerColin Watson <cjwatson@debian.org>2017-10-05 23:58:12 +0100
commit0556ea972b15607b7e13ff31bc05840881c91dd3 (patch)
treed6b8d48062d0278b5ae0eeff42d0e9afa9f26860 /kexgexc.c
parentdb2122d97eb1ecdd8d99b7bf79b0dd2b5addfd92 (diff)
parent801a62eedaaf47b20dbf4b426dc3e084bf0c8d49 (diff)
New upstream release (7.6p1)
Diffstat (limited to 'kexgexc.c')
-rw-r--r--kexgexc.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/kexgexc.c b/kexgexc.c
index ad0d1c8c0..cd1128752 100644
--- a/kexgexc.c
+++ b/kexgexc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kexgexc.c,v 1.23 2016/09/12 01:22:38 deraadt Exp $ */ 1/* $OpenBSD: kexgexc.c,v 1.25 2017/05/30 14:23:52 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Niels Provos. All rights reserved. 3 * Copyright (c) 2000 Niels Provos. All rights reserved.
4 * Copyright (c) 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -51,8 +51,8 @@
51#include "sshbuf.h" 51#include "sshbuf.h"
52#include "misc.h" 52#include "misc.h"
53 53
54static int input_kex_dh_gex_group(int, u_int32_t, void *); 54static int input_kex_dh_gex_group(int, u_int32_t, struct ssh *);
55static int input_kex_dh_gex_reply(int, u_int32_t, void *); 55static int input_kex_dh_gex_reply(int, u_int32_t, struct ssh *);
56 56
57int 57int
58kexgex_client(struct ssh *ssh) 58kexgex_client(struct ssh *ssh)
@@ -89,9 +89,8 @@ kexgex_client(struct ssh *ssh)
89} 89}
90 90
91static int 91static int
92input_kex_dh_gex_group(int type, u_int32_t seq, void *ctxt) 92input_kex_dh_gex_group(int type, u_int32_t seq, struct ssh *ssh)
93{ 93{
94 struct ssh *ssh = ctxt;
95 struct kex *kex = ssh->kex; 94 struct kex *kex = ssh->kex;
96 BIGNUM *p = NULL, *g = NULL; 95 BIGNUM *p = NULL, *g = NULL;
97 int r, bits; 96 int r, bits;
@@ -143,9 +142,8 @@ out:
143} 142}
144 143
145static int 144static int
146input_kex_dh_gex_reply(int type, u_int32_t seq, void *ctxt) 145input_kex_dh_gex_reply(int type, u_int32_t seq, struct ssh *ssh)
147{ 146{
148 struct ssh *ssh = ctxt;
149 struct kex *kex = ssh->kex; 147 struct kex *kex = ssh->kex;
150 BIGNUM *dh_server_pub = NULL, *shared_secret = NULL; 148 BIGNUM *dh_server_pub = NULL, *shared_secret = NULL;
151 struct sshkey *server_host_key = NULL; 149 struct sshkey *server_host_key = NULL;
@@ -165,10 +163,6 @@ input_kex_dh_gex_reply(int type, u_int32_t seq, void *ctxt)
165 (r = sshkey_from_blob(server_host_key_blob, sbloblen, 163 (r = sshkey_from_blob(server_host_key_blob, sbloblen,
166 &server_host_key)) != 0) 164 &server_host_key)) != 0)
167 goto out; 165 goto out;
168 if (server_host_key->type != kex->hostkey_type) {
169 r = SSH_ERR_KEY_TYPE_MISMATCH;
170 goto out;
171 }
172 if (server_host_key->type != kex->hostkey_type || 166 if (server_host_key->type != kex->hostkey_type ||
173 (kex->hostkey_type == KEY_ECDSA && 167 (kex->hostkey_type == KEY_ECDSA &&
174 server_host_key->ecdsa_nid != kex->hostkey_nid)) { 168 server_host_key->ecdsa_nid != kex->hostkey_nid)) {