X-Git-Url: http://git.meshlink.io/?p=meshlink;a=blobdiff_plain;f=src%2Fsptps.c;fp=src%2Fsptps.c;h=fab2e9d9b8a87a05dba12cb00e0cacc910d5a419;hp=267a47f1f30f2484cbab4a6830f2bff06f4ebd0f;hb=cef54614e60952e50f98b810838e9a0872b9ab0d;hpb=38d695b115920c9fb78b596acde817244d0519a6 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; }