diff options
| author | tobtoht <tob@featherwallet.org> | 2025-01-14 14:26:47 +0000 |
|---|---|---|
| committer | tobtoht <tob@featherwallet.org> | 2025-01-14 14:26:47 +0000 |
| commit | 61702e015e55d4f2d396a9fb6af2f17244837b88 (patch) | |
| tree | 511ea1a8857350d16c0b33bede06707a19062e13 /src | |
| parent | 460412b10e5f277605f466e649a63d91e6a3d103 (diff) | |
| parent | e99ef92a18801a237e46ea6959a8bcc565db8ffe (diff) | |
| download | monzero-core-61702e015e55d4f2d396a9fb6af2f17244837b88.tar.gz monzero-core-61702e015e55d4f2d396a9fb6af2f17244837b88.tar.xz monzero-core-61702e015e55d4f2d396a9fb6af2f17244837b88.zip | |
Merge pull request #9633
e99ef92 Fix --anonymous-inbound data leak (Lee *!* Clagett)
Diffstat (limited to 'src')
| -rw-r--r-- | src/p2p/net_node.inl | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 08cd70cae..284de3c6d 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -2493,6 +2493,20 @@ namespace nodetool std::vector<peerlist_entry> local_peerlist_new; zone.m_peerlist.get_peerlist_head(local_peerlist_new, true, max_peerlist_size); + /* Tor/I2P nodes receiving connections via forwarding (from tor/i2p daemon) + do not know the address of the connecting peer. This is relayed to them, + iff the node has setup an inbound hidden service. + + \note Insert into `local_peerlist_new` so that it is only sent once like + the other peers. */ + if(outgoing_to_same_zone) + { + local_peerlist_new.insert( + local_peerlist_new.begin() + crypto::rand_range(std::size_t(0), local_peerlist_new.size()), + peerlist_entry{zone.m_our_address, zone.m_config.m_peer_id, 0} + ); + } + //only include out peers we did not already send rsp.local_peerlist_new.reserve(local_peerlist_new.size()); for (auto &pe: local_peerlist_new) @@ -2503,17 +2517,6 @@ namespace nodetool } m_payload_handler.get_payload_sync_data(rsp.payload_data); - /* Tor/I2P nodes receiving connections via forwarding (from tor/i2p daemon) - do not know the address of the connecting peer. This is relayed to them, - iff the node has setup an inbound hidden service. The other peer will have - to use the random peer_id value to link the two. My initial thought is that - the inbound peer should leave the other side marked as `<unknown tor host>`, - etc., because someone could give faulty addresses over Tor/I2P to get the - real peer with that identity banned/blacklisted. */ - - if(outgoing_to_same_zone) - rsp.local_peerlist_new.push_back(peerlist_entry{zone.m_our_address, zone.m_config.m_peer_id, std::time(nullptr)}); - LOG_DEBUG_CC(context, "COMMAND_TIMED_SYNC"); return 1; } |
