remove nonce transmission from protocol

This commit is contained in:
Matthias Radestock committed 2015-04-30 14:47:16 +01:00
1 parent b365c3806b
commit e223899982
4 files changed
+1 -17

No files matched your search

-5
View File
@@ -489,11 +489,6 @@ func (conn *LocalConnection) handleProtocolMsg(tag ProtocolTag, payload []byte)
nil) nil)
case ProtocolFragmentationReceived: case ProtocolFragmentationReceived:
conn.setStackFrag(true) conn.setStackFrag(true)
case ProtocolNonce:
if conn.SessionKey == nil {
return fmt.Errorf("unexpected nonce on unencrypted connection")
}
conn.Decryptor.ReceiveNonce(payload)
case ProtocolPMTUVerified: case ProtocolPMTUVerified:
conn.pmtuVerified(int(binary.BigEndian.Uint16(payload))) conn.pmtuVerified(int(binary.BigEndian.Uint16(payload)))
case ProtocolGossipUnicast, ProtocolGossipBroadcast, ProtocolGossip: case ProtocolGossipUnicast, ProtocolGossipBroadcast, ProtocolGossip:
-1
View File
@@ -13,7 +13,6 @@ const (
DefaultPMTU = 65535 DefaultPMTU = 65535
MaxUDPPacketSize = 65536 MaxUDPPacketSize = 65536
ChannelSize = 16 ChannelSize = 16
UDPNonceSendAt = 8192
FragTestSize = 60001 FragTestSize = 60001
PMTUDiscoverySize = 60000 PMTUDiscoverySize = 60000
TCPHeartbeat = 30 * time.Second TCPHeartbeat = 30 * time.Second
-9
View File
@@ -9,7 +9,6 @@ import (
"encoding/binary" "encoding/binary"
"encoding/gob" "encoding/gob"
"fmt" "fmt"
"log"
"sync" "sync"
) )
@@ -153,7 +152,6 @@ type FrameConsumer func(src []byte, dst []byte, frame []byte)
type Decryptor interface { type Decryptor interface {
IterateFrames([]byte, FrameConsumer) error IterateFrames([]byte, FrameConsumer) error
ReceiveNonce([]byte)
Shutdown() Shutdown()
} }
@@ -214,10 +212,6 @@ func (nd *NonDecryptor) IterateFrames(packet []byte, consumer FrameConsumer) err
func (nd *NonDecryptor) Shutdown() { func (nd *NonDecryptor) Shutdown() {
} }
func (nd *NonDecryptor) ReceiveNonce(msg []byte) {
log.Println("Received Nonce on non-encrypted channel. Ignoring.")
}
func NewNaClDecryptor(sessionKey *[32]byte, outbound bool) *NaClDecryptor { func NewNaClDecryptor(sessionKey *[32]byte, outbound bool) *NaClDecryptor {
return &NaClDecryptor{ return &NaClDecryptor{
NonDecryptor: *NewNonDecryptor(), NonDecryptor: *NewNonDecryptor(),
@@ -229,9 +223,6 @@ func NewNaClDecryptor(sessionKey *[32]byte, outbound bool) *NaClDecryptor {
func (nd *NaClDecryptor) Shutdown() { func (nd *NaClDecryptor) Shutdown() {
} }
func (nd *NaClDecryptor) ReceiveNonce(msg []byte) {
}
func (nd *NaClDecryptor) IterateFrames(packet []byte, consumer FrameConsumer) error { func (nd *NaClDecryptor) IterateFrames(packet []byte, consumer FrameConsumer) error {
if len(packet) < 8 { if len(packet) < 8 {
return PacketDecodingError{Desc: fmt.Sprintf("encrypted UDP packet too short; expected length >= 8, got %d", len(packet))} return PacketDecodingError{Desc: fmt.Sprintf("encrypted UDP packet too short; expected length >= 8, got %d", len(packet))}
+1 -2
View File
@@ -2,7 +2,7 @@ package router
const ( const (
Protocol = "weave" Protocol = "weave"
ProtocolVersion = 15 ProtocolVersion = 16
) )
type ProtocolTag byte type ProtocolTag byte
@@ -12,7 +12,6 @@ const (
ProtocolConnectionEstablished ProtocolConnectionEstablished
ProtocolFragmentationReceived ProtocolFragmentationReceived
ProtocolStartFragmentationTest ProtocolStartFragmentationTest
ProtocolNonce
ProtocolPMTUVerified ProtocolPMTUVerified
ProtocolGossip ProtocolGossip
ProtocolGossipUnicast ProtocolGossipUnicast