From 293ede2713cffbe21ca94f7b5b90f15b948f706d Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 8 Feb 2019 17:36:33 +0400 Subject: [PATCH] swarm/pss: transition to whisper v.6 --- swarm/pss/client/client_test.go | 2 +- swarm/pss/forwarding_test.go | 2 +- swarm/pss/notify/notify_test.go | 2 +- swarm/pss/pss.go | 6 +++--- swarm/pss/pss_test.go | 2 +- swarm/pss/types.go | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/swarm/pss/client/client_test.go b/swarm/pss/client/client_test.go index 0d6788d679..1c6f2e522d 100644 --- a/swarm/pss/client/client_test.go +++ b/swarm/pss/client/client_test.go @@ -38,7 +38,7 @@ import ( "github.com/ethereum/go-ethereum/swarm/network" "github.com/ethereum/go-ethereum/swarm/pss" "github.com/ethereum/go-ethereum/swarm/state" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv5" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" ) type protoCtrl struct { diff --git a/swarm/pss/forwarding_test.go b/swarm/pss/forwarding_test.go index 2502977945..746d4dc404 100644 --- a/swarm/pss/forwarding_test.go +++ b/swarm/pss/forwarding_test.go @@ -12,7 +12,7 @@ import ( "github.com/ethereum/go-ethereum/p2p/protocols" "github.com/ethereum/go-ethereum/swarm/network" "github.com/ethereum/go-ethereum/swarm/pot" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv5" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" ) type testCase struct { diff --git a/swarm/pss/notify/notify_test.go b/swarm/pss/notify/notify_test.go index 95121b1d8f..cda069b9e1 100644 --- a/swarm/pss/notify/notify_test.go +++ b/swarm/pss/notify/notify_test.go @@ -19,7 +19,7 @@ import ( "github.com/ethereum/go-ethereum/swarm/network" "github.com/ethereum/go-ethereum/swarm/pss" "github.com/ethereum/go-ethereum/swarm/state" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv5" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" ) var ( diff --git a/swarm/pss/pss.go b/swarm/pss/pss.go index ee942303c5..158ae4095d 100644 --- a/swarm/pss/pss.go +++ b/swarm/pss/pss.go @@ -38,7 +38,7 @@ import ( "github.com/ethereum/go-ethereum/swarm/network" "github.com/ethereum/go-ethereum/swarm/pot" "github.com/ethereum/go-ethereum/swarm/storage" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv5" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" "golang.org/x/crypto/sha3" ) @@ -686,7 +686,7 @@ func (p *Pss) processSym(envelope *whisper.Envelope) (*whisper.ReceivedMessage, if err != nil { continue } - if !recvmsg.Validate() { + if !recvmsg.ValidateAndParse() { return nil, "", nil, fmt.Errorf("symmetrically encrypted message has invalid signature or is corrupt") } p.symKeyPoolMu.Lock() @@ -713,7 +713,7 @@ func (p *Pss) processAsym(envelope *whisper.Envelope) (*whisper.ReceivedMessage, return nil, "", nil, fmt.Errorf("could not decrypt message: %s", err) } // check signature (if signed), strip padding - if !recvmsg.Validate() { + if !recvmsg.ValidateAndParse() { return nil, "", nil, fmt.Errorf("invalid message") } pubkeyid := common.ToHex(crypto.FromECDSAPub(recvmsg.Src)) diff --git a/swarm/pss/pss_test.go b/swarm/pss/pss_test.go index 0fb87be2c6..675b4cfcd6 100644 --- a/swarm/pss/pss_test.go +++ b/swarm/pss/pss_test.go @@ -50,7 +50,7 @@ import ( "github.com/ethereum/go-ethereum/swarm/network" "github.com/ethereum/go-ethereum/swarm/pot" "github.com/ethereum/go-ethereum/swarm/state" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv5" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" ) var ( diff --git a/swarm/pss/types.go b/swarm/pss/types.go index ba963067cb..2ce1f5cfb0 100644 --- a/swarm/pss/types.go +++ b/swarm/pss/types.go @@ -26,7 +26,7 @@ import ( "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/swarm/storage" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv5" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" ) const (