1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 11:32:48 -05:00

Revert KEX_MAX_CONF system from the GSS kex patch.

Commit d515e4f1a went through a lot of very different shapes before it
was finally pushed. In some of them, GSS kex had its own value in the
kex enumeration, but it was used in ssh.c but not in config.c
(because, as in the final version, it wasn't configured by the same
drag-list system as the rest of them). So we had to distinguish the
set of key exchange ids known to the program as a whole from the set
controllable in the configuration.

In the final version, GSS kex ended up even more separated from the
kex enumeration than that: the enum value KEX_GSS_SHA1_K5 isn't used
at all. Instead, GSS key exchange appears in the list at the point of
translation from the list of enum values into the list of pointers to
data structures full of kex methods.

But after all the changes, everyone involved forgot to revert the part
of the patch which split KEX_MAX in two and introduced the pointless
value KEX_GSS_SHA1_K5! Better late than never: I'm reverting it now,
to avoid confusion, and because I don't have any reason to think the
distinction will be useful for any other purpose.
This commit is contained in:
Simon Tatham
2018-05-01 07:41:01 +01:00
parent d6bdcfa75c
commit 839ed84e59
4 changed files with 8 additions and 16 deletions

4
ssh.c
View File

@ -6534,7 +6534,7 @@ static void do_ssh2_transport(Ssh ssh, const void *vin, int inlen,
int can_gssapi_keyex;
int need_gss_transient_hostkey;
int warned_about_no_gss_transient_hostkey;
const struct ssh_kexes *preferred_kex[KEX_MAX];
const struct ssh_kexes *preferred_kex[KEX_MAX + 1]; /* +1 for GSSAPI */
int n_preferred_hk;
int preferred_hk[HK_MAX];
int n_preferred_ciphers;
@ -6645,7 +6645,7 @@ static void do_ssh2_transport(Ssh ssh, const void *vin, int inlen,
s->n_preferred_kex = 0;
if (s->can_gssapi_keyex)
s->preferred_kex[s->n_preferred_kex++] = &ssh_gssk5_sha1_kex;
for (i = 0; i < KEX_MAX_CONF; i++) {
for (i = 0; i < KEX_MAX; i++) {
switch (conf_get_int_int(ssh->conf, CONF_ssh_kexlist, i)) {
case KEX_DHGEX:
s->preferred_kex[s->n_preferred_kex++] =