mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 12:28:42 +00:00
network: forget the peer ephemeral key on plaintext key advertisement
A peer only advertises its key in plaintext when it doesn't know ours, e.g. after a restart: it lost our session, so answer with an Initial envelope.
This commit is contained in:
1 parent
d23cb42b27
commit
fbff1eced4
1 file changed
+4
@@ -678,6 +678,10 @@ NetworkEngine::process(std::unique_ptr<ParsedMessage>&& msg, const SockAddr& fro
|
||||
node = cache.getNode(msg->id, from, now, true, msg->is_client);
|
||||
if (msg->peer)
|
||||
attachPeer(*node, msg->peer);
|
||||
// Advertising its key in plaintext, the peer shows it lost our session, e.g. after a restart
|
||||
if (trusted and not msg->encrypted and msg->transport_key)
|
||||
if (const auto& peer = node->getTransport())
|
||||
peer->ephemeral.reset();
|
||||
|
||||
if (msg->type == MessageType::ValueUpdate) {
|
||||
if (not trusted)
|
||||
|
||||
Reference in new issue
Block a user