… | |
… | |
50 | |
50 | |
51 | #if !HAVE_RAND_PSEUDO_BYTES |
51 | #if !HAVE_RAND_PSEUDO_BYTES |
52 | # define RAND_pseudo_bytes RAND_bytes |
52 | # define RAND_pseudo_bytes RAND_bytes |
53 | #endif |
53 | #endif |
54 | |
54 | |
55 | #define MAGIC "vped\xbd\xc6\xdb\x82" // 8 bytes of magic |
55 | #define MAGIC_OLD "vped\xbd\xc6\xdb\x82" // 8 bytes of magic (still used in the protocol) |
|
|
56 | #define MAGIC "gvpe\xbd\xc6\xdb\x82" // 8 bytes of magic (understood but not generated) |
56 | |
57 | |
57 | #define ULTRA_FAST 1 |
58 | #define ULTRA_FAST 1 |
58 | #define HLOG 15 |
59 | #define HLOG 15 |
59 | #include "lzf/lzf.h" |
60 | #include "lzf/lzf.h" |
60 | #include "lzf/lzf_c.c" |
61 | #include "lzf/lzf_c.c" |
… | |
… | |
613 | rsaencrdata encr; |
614 | rsaencrdata encr; |
614 | |
615 | |
615 | auth_req_packet (int dst, bool initiate_, u8 protocols_) |
616 | auth_req_packet (int dst, bool initiate_, u8 protocols_) |
616 | { |
617 | { |
617 | config_packet::setup (PT_AUTH_REQ, dst); |
618 | config_packet::setup (PT_AUTH_REQ, dst); |
618 | strncpy (magic, MAGIC, 8); |
619 | strncpy (magic, MAGIC_OLD, 8); |
619 | initiate = !!initiate_; |
620 | initiate = !!initiate_; |
620 | protocols = protocols_; |
621 | protocols = protocols_; |
621 | |
622 | |
622 | len = sizeof (*this) - sizeof (net_packet); |
623 | len = sizeof (*this) - sizeof (net_packet); |
623 | } |
624 | } |
… | |
… | |
1053 | { |
1054 | { |
1054 | auth_req_packet *p = (auth_req_packet *) pkt; |
1055 | auth_req_packet *p = (auth_req_packet *) pkt; |
1055 | |
1056 | |
1056 | slog (L_TRACE, "%s >> PT_AUTH_REQ(%s)", conf->nodename, p->initiate ? "initiate" : "reply"); |
1057 | slog (L_TRACE, "%s >> PT_AUTH_REQ(%s)", conf->nodename, p->initiate ? "initiate" : "reply"); |
1057 | |
1058 | |
1058 | if (p->chk_config () && !strncmp (p->magic, MAGIC, 8)) |
1059 | if (p->chk_config () |
|
|
1060 | && (!strncmp (p->magic, MAGIC_OLD, 8) || !strncmp (p->magic, MAGIC, 8))) |
1059 | { |
1061 | { |
1060 | if (p->prot_minor != PROTOCOL_MINOR) |
1062 | if (p->prot_minor != PROTOCOL_MINOR) |
1061 | slog (L_INFO, _("%s(%s): protocol minor version mismatch: ours is %d, %s's is %d."), |
1063 | slog (L_INFO, _("%s(%s): protocol minor version mismatch: ours is %d, %s's is %d."), |
1062 | conf->nodename, (const char *)rsi, |
1064 | conf->nodename, (const char *)rsi, |
1063 | PROTOCOL_MINOR, conf->nodename, p->prot_minor); |
1065 | PROTOCOL_MINOR, conf->nodename, p->prot_minor); |