1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00

GSSAPI kex: don't call dh_is_gex() on ECDH algorithms.

dh_is_gex() expects to find a 'struct dh_extra' in the 'extra' field
of the kex_alg you pass in, and won't look kindly on finding an
instance of some totally different structure type. We were being
careful about that everywhere in the GSSAPI kex code except for the
final free step.
This commit is contained in:
Simon Tatham 2022-09-13 20:53:03 +01:00
parent 2fbc122e0e
commit c1a4eda9f6

View File

@ -559,10 +559,10 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s, bool *aborted)
dh_cleanup(s->dh_ctx);
s->dh_ctx = NULL;
mp_free(s->f); s->f = NULL;
}
if (dh_is_gex(s->kex_alg)) {
mp_free(s->g); s->g = NULL;
mp_free(s->p); s->p = NULL;
if (dh_is_gex(s->kex_alg)) {
mp_free(s->g); s->g = NULL;
mp_free(s->p); s->p = NULL;
}
}
#endif
} else {