From 25f00c1c7a2165223a52ff69af0d77bd7cb1b17c Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sat, 17 Feb 2018 20:30:59 -0600 Subject: [PATCH] disable keys in link protocol traffic, since these are already known, *breaks backwards compat* --- src/yggdrasil/peer.go | 16 ++++++++-------- src/yggdrasil/wire.go | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/yggdrasil/peer.go b/src/yggdrasil/peer.go index 98f9cfb2..d42430a5 100644 --- a/src/yggdrasil/peer.go +++ b/src/yggdrasil/peer.go @@ -204,8 +204,8 @@ func (p *peer) sendPacket(packet []byte) { func (p *peer) sendLinkPacket(packet []byte) { bs, nonce := boxSeal(&p.shared, packet, nil) linkPacket := wire_linkProtoTrafficPacket{ - toKey: p.box, - fromKey: p.core.boxPub, + //toKey: p.box, + //fromKey: p.core.boxPub, nonce: *nonce, payload: bs, } @@ -218,12 +218,12 @@ func (p *peer) handleLinkTraffic(bs []byte) { if !packet.decode(bs) { return } - if packet.toKey != p.core.boxPub { - return - } - if packet.fromKey != p.box { - return - } + //if packet.toKey != p.core.boxPub { + // return + //} + //if packet.fromKey != p.box { + // return + //} payload, isOK := boxOpen(&p.shared, packet.payload, &packet.nonce) if !isOK { return diff --git a/src/yggdrasil/wire.go b/src/yggdrasil/wire.go index 6d574541..f50ec431 100644 --- a/src/yggdrasil/wire.go +++ b/src/yggdrasil/wire.go @@ -380,16 +380,16 @@ func (p *wire_protoTrafficPacket) decode(bs []byte) bool { } type wire_linkProtoTrafficPacket struct { - toKey boxPubKey - fromKey boxPubKey + //toKey boxPubKey + //fromKey boxPubKey nonce boxNonce payload []byte } func (p *wire_linkProtoTrafficPacket) encode() []byte { bs := wire_encode_uint64(wire_LinkProtocolTraffic) - bs = append(bs, p.toKey[:]...) - bs = append(bs, p.fromKey[:]...) + //bs = append(bs, p.toKey[:]...) + //bs = append(bs, p.fromKey[:]...) bs = append(bs, p.nonce[:]...) bs = append(bs, p.payload...) return bs @@ -402,10 +402,10 @@ func (p *wire_linkProtoTrafficPacket) decode(bs []byte) bool { return false case pType != wire_LinkProtocolTraffic: return false - case !wire_chop_slice(p.toKey[:], &bs): - return false - case !wire_chop_slice(p.fromKey[:], &bs): - return false + //case !wire_chop_slice(p.toKey[:], &bs): + // return false + //case !wire_chop_slice(p.fromKey[:], &bs): + // return false case !wire_chop_slice(p.nonce[:], &bs): return false }