… | |
… | |
724 | { |
724 | { |
725 | if (!ictx |
725 | if (!ictx |
726 | && conf != THISNODE |
726 | && conf != THISNODE |
727 | && connectmode != conf_node::C_NEVER |
727 | && connectmode != conf_node::C_NEVER |
728 | && connectmode != conf_node::C_DISABLED |
728 | && connectmode != conf_node::C_DISABLED |
729 | && w.at <= NOW) |
729 | && NOW > w.at) |
730 | { |
730 | { |
731 | double retry_int = double (retry_cnt & 3 ? (retry_cnt & 3) : 1 << (retry_cnt >> 2)) * 0.6; |
731 | double retry_int = double (retry_cnt & 3 ? (retry_cnt & 3) : 1 << (retry_cnt >> 2)) * 0.6; |
732 | |
732 | |
733 | if (retry_int < 3600 * 8) |
733 | if (retry_int < 3600 * 8) |
734 | retry_cnt++; |
734 | retry_cnt++; |
… | |
… | |
960 | crypto_ctx *cctx = new crypto_ctx (chg, 0); |
960 | crypto_ctx *cctx = new crypto_ctx (chg, 0); |
961 | |
961 | |
962 | if (!p->hmac_chk (cctx)) |
962 | if (!p->hmac_chk (cctx)) |
963 | { |
963 | { |
964 | slog (L_ERR, _("%s(%s): hmac authentication error on auth response, received invalid packet\n" |
964 | slog (L_ERR, _("%s(%s): hmac authentication error on auth response, received invalid packet\n" |
965 | "could be an attack, or just corruption or an synchronization error"), |
965 | "could be an attack, or just corruption or a synchronization error"), |
966 | conf->nodename, (const char *)rsi); |
966 | conf->nodename, (const char *)rsi); |
967 | break; |
967 | break; |
968 | } |
968 | } |
969 | else |
969 | else |
970 | { |
970 | { |
… | |
… | |
1019 | { |
1019 | { |
1020 | vpndata_packet *p = (vpndata_packet *)pkt; |
1020 | vpndata_packet *p = (vpndata_packet *)pkt; |
1021 | |
1021 | |
1022 | if (!p->hmac_chk (ictx)) |
1022 | if (!p->hmac_chk (ictx)) |
1023 | slog (L_ERR, _("%s(%s): hmac authentication error, received invalid packet\n" |
1023 | slog (L_ERR, _("%s(%s): hmac authentication error, received invalid packet\n" |
1024 | "could be an attack, or just corruption or an synchronization error"), |
1024 | "could be an attack, or just corruption or a synchronization error"), |
1025 | conf->nodename, (const char *)rsi); |
1025 | conf->nodename, (const char *)rsi); |
1026 | else |
1026 | else |
1027 | { |
1027 | { |
1028 | u32 seqno; |
1028 | u32 seqno; |
1029 | tap_packet *d = p->unpack (this, seqno); |
1029 | tap_packet *d = p->unpack (this, seqno); |