]> git.meshlink.io Git - meshlink/commitdiff
Allow sptps_force_kex() in all situations.
authorGuus Sliepen <guus@meshlink.io>
Thu, 10 Sep 2020 21:18:26 +0000 (23:18 +0200)
committerGuus Sliepen <guus@meshlink.io>
Thu, 10 Sep 2020 21:18:26 +0000 (23:18 +0200)
Also allow sptps_force_kex() during the initial key exchange.

src/sptps.c

index 267a47f1f30f2484cbab4a6830f2bff06f4ebd0f..fab2e9d9b8a87a05dba12cb00e0cacc910d5a419 100644 (file)
@@ -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;
        }