X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_packet.c;h=63809aee613f3a86d770100e9facef01bf8c7873;hb=3b6d366005b6fc23c705b3156e365316f6ab776c;hp=7bb182db22822c03b66cefd1b842c13234421a84;hpb=914d1be411229c28e6e8e4a0df99afa076a8b448;p=tinc diff --git a/src/net_packet.c b/src/net_packet.c index 7bb182db..63809aee 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -55,10 +55,6 @@ #include "route.h" #include "utils.h" -#ifndef MAX -#define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - /* The minimum size of a probe is 14 bytes, but since we normally use CBC mode encryption, we can add a few extra random bytes without increasing the resulting packet size. */ @@ -967,8 +963,8 @@ bool send_sptps_data(node_t *to, node_t *from, int type, const void *data, size_ return send_sptps_tcppacket(to->nexthop->connection, buf, sizeof(buf)); } - char buf[len * 4 / 3 + 5]; - b64encode(data, buf, len); + char buf[B64_SIZE(len)]; + b64encode_tinc(data, buf, len); /* If this is a handshake packet, use ANS_KEY instead of REQ_KEY, for two reasons: - We don't want intermediate nodes to switch to UDP to relay these packets;