X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsptps.c;h=82e913eb29a67967318549b41918f6c877c165f0;hb=46f3eba7755089ff68fdc137b0754cae2fa523eb;hp=93a7ad3ff1e9037d9846ecbd56dfae66813589e5;hpb=f6e87ab476a0faf8b124ecaaa27f967d825e6457;p=tinc diff --git a/src/sptps.c b/src/sptps.c index 93a7ad3f..82e913eb 100644 --- a/src/sptps.c +++ b/src/sptps.c @@ -287,7 +287,11 @@ static bool receive_kex(sptps_t *s, const char *data, uint16_t len) { memcpy(s->hiskex, data, len); - return send_sig(s); + if(s->initiator) { + return send_sig(s); + } else { + return true; + } } // Receive a SIGnature record, verify it, if it passed, compute the shared secret and calculate the session keys. @@ -327,6 +331,10 @@ static bool receive_sig(sptps_t *s, const char *data, uint16_t len) { return false; } + if(!s->initiator && !send_sig(s)) { + return false; + } + free(s->mykex); free(s->hiskex);