From cef54614e60952e50f98b810838e9a0872b9ab0d Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 10 Sep 2020 23:18:26 +0200 Subject: [PATCH] Allow sptps_force_kex() in all situations. Also allow sptps_force_kex() during the initial key exchange. --- src/sptps.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sptps.c b/src/sptps.c index 267a47f1..fab2e9d9 100644 --- a/src/sptps.c +++ b/src/sptps.c @@ -374,12 +374,12 @@ static bool receive_sig(sptps_t *s, const char *data, uint16_t len) { // Force another Key EXchange (for testing purposes). bool sptps_force_kex(sptps_t *s) { - if(!s->outstate || s->state < SPTPS_SECONDARY_KEX) { + if(!s->outstate) { return error(s, EINVAL, "Cannot force KEX in current state"); } - if(s->state > SPTPS_SECONDARY_KEX) { - // We are already in the middle of a secondary key exchange + if(s->state != SPTPS_SECONDARY_KEX) { + // We are already in the middle of a key exchange return true; } -- 2.39.2