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
54252ede
Commit
54252ede
authored
Jan 21, 2015
by
zelig
Committed by
Felix Lange
Feb 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add temporary forced session token generation
parent
faa069a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
crypto.go
p2p/crypto.go
+3
-0
peer.go
p2p/peer.go
+5
-0
No files found.
p2p/crypto.go
View file @
54252ede
...
...
@@ -103,6 +103,9 @@ func (self *cryptoId) Run(conn io.ReadWriter, remotePubKeyS []byte, sessionToken
if
auth
,
initNonce
,
randomPrivKey
,
_
,
err
=
self
.
startHandshake
(
remotePubKeyS
,
sessionToken
);
err
!=
nil
{
return
}
if
sessionToken
!=
nil
{
clogger
.
Debugf
(
"session-token: %v"
,
hexkey
(
sessionToken
))
}
clogger
.
Debugf
(
"initiator-nonce: %v"
,
hexkey
(
initNonce
))
clogger
.
Debugf
(
"initiator-random-private-key: %v"
,
hexkey
(
crypto
.
FromECDSA
(
randomPrivKey
)))
randomPublicKeyS
,
_
:=
ExportPublicKey
(
&
randomPrivKey
.
PublicKey
)
...
...
p2p/peer.go
View file @
54252ede
...
...
@@ -3,6 +3,7 @@ package p2p
import
(
"bufio"
"bytes"
"crypto/rand"
"fmt"
"io"
"io/ioutil"
...
...
@@ -342,6 +343,10 @@ func (p *Peer) handleCryptoHandshake() (loop readLoop, err error) {
// it is survived by an encrypted readwriter
var
initiator
bool
var
sessionToken
[]
byte
sessionToken
=
make
([]
byte
,
keyLen
)
if
_
,
err
=
rand
.
Read
(
sessionToken
);
err
!=
nil
{
return
}
if
p
.
dialAddr
!=
nil
{
// this should have its own method Outgoing() bool
initiator
=
true
}
...
...
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