diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-02-04 13:17:00 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-02-04 13:17:00 -0800 |
| commit | 3587aa1ea7573198168422be55511b16470fb33f (patch) | |
| tree | 645853d1cd6cd9d98218d28455efa981d5f6ccf5 /node/Peer.cpp | |
| parent | beb642faa58bb3c2c283a068e6de942bfad2c314 (diff) | |
| download | infinitytier-3587aa1ea7573198168422be55511b16470fb33f.tar.gz infinitytier-3587aa1ea7573198168422be55511b16470fb33f.zip | |
Add and send certificates of representation to tell people what our valid upstreams are. These are not used yet but will be needed for future privacy modes, etc. Also some cleanup.
Diffstat (limited to 'node/Peer.cpp')
| -rw-r--r-- | node/Peer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp index 129c2437..bb6b945d 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -38,6 +38,7 @@ namespace ZeroTier { Peer::Peer(const RuntimeEnvironment *renv,const Identity &myIdentity,const Identity &peerIdentity) : + RR(renv), _lastReceive(0), _lastNontrivialReceive(0), _lastTriedMemorizedPath(0), @@ -50,7 +51,6 @@ Peer::Peer(const RuntimeEnvironment *renv,const Identity &myIdentity,const Ident _lastComRequestSent(0), _lastCredentialsReceived(0), _lastTrustEstablishedPacketReceived(0), - RR(renv), _remoteClusterOptimal4(0), _vProto(0), _vMajor(0), @@ -365,6 +365,11 @@ void Peer::sendHELLO(const InetAddress &localAddr,const InetAddress &atAddress,u outp.append((uint64_t)m->timestamp()); } + const unsigned int corSizeAt = outp.size(); + outp.addSize(2); + RR->topology->appendCertificateOfRepresentation(outp); + outp.setAt(corSizeAt,(uint16_t)((outp.size() - corSizeAt) - 2)); + RR->node->expectReplyTo(outp.packetId()); if (atAddress) { |
