Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
cde02e01
Commit
cde02e01
authored
Feb 08, 2019
by
gluk256
Committed by
Anton Evangelatov
Feb 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swarm/pss: transition to whisper v6 (#19023)
parent
0c10d376
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
8 deletions
+8
-8
client_test.go
swarm/pss/client/client_test.go
+1
-1
forwarding_test.go
swarm/pss/forwarding_test.go
+1
-1
notify_test.go
swarm/pss/notify/notify_test.go
+1
-1
pss.go
swarm/pss/pss.go
+3
-3
pss_test.go
swarm/pss/pss_test.go
+1
-1
types.go
swarm/pss/types.go
+1
-1
No files found.
swarm/pss/client/client_test.go
View file @
cde02e01
...
@@ -38,7 +38,7 @@ import (
...
@@ -38,7 +38,7 @@ import (
"github.com/ethereum/go-ethereum/swarm/network"
"github.com/ethereum/go-ethereum/swarm/network"
"github.com/ethereum/go-ethereum/swarm/pss"
"github.com/ethereum/go-ethereum/swarm/pss"
"github.com/ethereum/go-ethereum/swarm/state"
"github.com/ethereum/go-ethereum/swarm/state"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
5
"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
6
"
)
)
type
protoCtrl
struct
{
type
protoCtrl
struct
{
...
...
swarm/pss/forwarding_test.go
View file @
cde02e01
...
@@ -12,7 +12,7 @@ import (
...
@@ -12,7 +12,7 @@ import (
"github.com/ethereum/go-ethereum/p2p/protocols"
"github.com/ethereum/go-ethereum/p2p/protocols"
"github.com/ethereum/go-ethereum/swarm/network"
"github.com/ethereum/go-ethereum/swarm/network"
"github.com/ethereum/go-ethereum/swarm/pot"
"github.com/ethereum/go-ethereum/swarm/pot"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
5
"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
6
"
)
)
type
testCase
struct
{
type
testCase
struct
{
...
...
swarm/pss/notify/notify_test.go
View file @
cde02e01
...
@@ -19,7 +19,7 @@ import (
...
@@ -19,7 +19,7 @@ import (
"github.com/ethereum/go-ethereum/swarm/network"
"github.com/ethereum/go-ethereum/swarm/network"
"github.com/ethereum/go-ethereum/swarm/pss"
"github.com/ethereum/go-ethereum/swarm/pss"
"github.com/ethereum/go-ethereum/swarm/state"
"github.com/ethereum/go-ethereum/swarm/state"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
5
"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
6
"
)
)
var
(
var
(
...
...
swarm/pss/pss.go
View file @
cde02e01
...
@@ -38,7 +38,7 @@ import (
...
@@ -38,7 +38,7 @@ import (
"github.com/ethereum/go-ethereum/swarm/network"
"github.com/ethereum/go-ethereum/swarm/network"
"github.com/ethereum/go-ethereum/swarm/pot"
"github.com/ethereum/go-ethereum/swarm/pot"
"github.com/ethereum/go-ethereum/swarm/storage"
"github.com/ethereum/go-ethereum/swarm/storage"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
5
"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
6
"
"golang.org/x/crypto/sha3"
"golang.org/x/crypto/sha3"
)
)
...
@@ -686,7 +686,7 @@ func (p *Pss) processSym(envelope *whisper.Envelope) (*whisper.ReceivedMessage,
...
@@ -686,7 +686,7 @@ func (p *Pss) processSym(envelope *whisper.Envelope) (*whisper.ReceivedMessage,
if
err
!=
nil
{
if
err
!=
nil
{
continue
continue
}
}
if
!
recvmsg
.
Validate
()
{
if
!
recvmsg
.
Validate
AndParse
()
{
return
nil
,
""
,
nil
,
fmt
.
Errorf
(
"symmetrically encrypted message has invalid signature or is corrupt"
)
return
nil
,
""
,
nil
,
fmt
.
Errorf
(
"symmetrically encrypted message has invalid signature or is corrupt"
)
}
}
p
.
symKeyPoolMu
.
Lock
()
p
.
symKeyPoolMu
.
Lock
()
...
@@ -713,7 +713,7 @@ func (p *Pss) processAsym(envelope *whisper.Envelope) (*whisper.ReceivedMessage,
...
@@ -713,7 +713,7 @@ func (p *Pss) processAsym(envelope *whisper.Envelope) (*whisper.ReceivedMessage,
return
nil
,
""
,
nil
,
fmt
.
Errorf
(
"could not decrypt message: %s"
,
err
)
return
nil
,
""
,
nil
,
fmt
.
Errorf
(
"could not decrypt message: %s"
,
err
)
}
}
// check signature (if signed), strip padding
// check signature (if signed), strip padding
if
!
recvmsg
.
Validate
()
{
if
!
recvmsg
.
Validate
AndParse
()
{
return
nil
,
""
,
nil
,
fmt
.
Errorf
(
"invalid message"
)
return
nil
,
""
,
nil
,
fmt
.
Errorf
(
"invalid message"
)
}
}
pubkeyid
:=
common
.
ToHex
(
crypto
.
FromECDSAPub
(
recvmsg
.
Src
))
pubkeyid
:=
common
.
ToHex
(
crypto
.
FromECDSAPub
(
recvmsg
.
Src
))
...
...
swarm/pss/pss_test.go
View file @
cde02e01
...
@@ -50,7 +50,7 @@ import (
...
@@ -50,7 +50,7 @@ import (
"github.com/ethereum/go-ethereum/swarm/network"
"github.com/ethereum/go-ethereum/swarm/network"
"github.com/ethereum/go-ethereum/swarm/pot"
"github.com/ethereum/go-ethereum/swarm/pot"
"github.com/ethereum/go-ethereum/swarm/state"
"github.com/ethereum/go-ethereum/swarm/state"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
5
"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
6
"
)
)
var
(
var
(
...
...
swarm/pss/types.go
View file @
cde02e01
...
@@ -26,7 +26,7 @@ import (
...
@@ -26,7 +26,7 @@ import (
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/swarm/storage"
"github.com/ethereum/go-ethereum/swarm/storage"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
5
"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
6
"
)
)
const
(
const
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment