summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-09-08 14:33:12 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-09-08 14:33:12 -0400
commitea0f836ef178fb4b6d0841cbd612a7a3abfdfff4 (patch)
tree251bb52ba9196a6a3060de1fe5d4df1ad5086aa5
parentb8729de9daa925f45705e72861b4986b328e65e9 (diff)
downloadinfinitytier-ea0f836ef178fb4b6d0841cbd612a7a3abfdfff4.tar.gz
infinitytier-ea0f836ef178fb4b6d0841cbd612a7a3abfdfff4.zip
Turns out we do want to propagate packets unauthenticated in the supernode case. This is fine.
-rw-r--r--node/PacketDecoder.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/node/PacketDecoder.cpp b/node/PacketDecoder.cpp
index 9fa9d93c..82199a4e 100644
--- a/node/PacketDecoder.cpp
+++ b/node/PacketDecoder.cpp
@@ -610,13 +610,12 @@ bool PacketDecoder::_doMULTICAST_FRAME(const RuntimeEnvironment *_r,const Shared
}
}
- // Check the multicast frame's signature to verify that its original sender is
- // who it claims to be.
- if ((!network)||(network->authenticateMulticasts())) {
- // Note that right now we authenticate multicasts if we aren't a member of a
- // network... have to think about whether this is mandatory. It mostly only
- // matters for supernodes though, since ordinary peers are unlikely ever to
- // see multicasts for networks they don't belong to.
+ // Authenticate multicasts for networks that require this -- note that the only
+ // nodes that will ever see multicasts for networks they don't belong to are
+ // supernodes, and in this case not authenticating is not a big deal. When nodes
+ // that are members see packets with failed authentication they will drop them
+ // and they will no longer propagate.
+ if ((network)&&(network->authenticateMulticasts())) {
const unsigned int signedPartLen = (ZT_PROTO_VERB_MULTICAST_FRAME_IDX_FRAME - ZT_PROTO_VERB_MULTICAST_FRAME_IDX__START_OF_SIGNED_PORTION) + frameLen;
if (!originPeer->identity().verify(field(ZT_PROTO_VERB_MULTICAST_FRAME_IDX__START_OF_SIGNED_PORTION,signedPartLen),signedPartLen,signature,signatureLen)) {
LOG("dropped MULTICAST_FRAME from %s(%s): failed signature verification, claims to be from %s",source().toString().c_str(),_remoteAddress.toString().c_str(),origin.toString().c_str());