Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
e89e83f4
Commit
e89e83f4
authored
9 years ago
by
Dominic Tarr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make comments describe what code actually does.
parent
b71b7271
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
p2p/crypto/secio/protocol.go
p2p/crypto/secio/protocol.go
+3
-3
No files found.
p2p/crypto/secio/protocol.go
View file @
e89e83f4
...
...
@@ -144,7 +144,7 @@ func (s *secureSession) handshake(ctx context.Context, insecure io.ReadWriter) e
// =============================================================================
// step 1.2 Selection -- select/agree on best encryption parameters
// to determine order, use cmp(H(
lr||rpk), H(rr||lpk
)).
// to determine order, use cmp(H(
remote_pubkey||local_rand), H(local_pubkey||remote_rand
)).
oh1
:=
u
.
Hash
(
append
(
proposeIn
.
GetPubkey
(),
nonceOut
...
))
oh2
:=
u
.
Hash
(
append
(
myPubKeyBytes
,
proposeIn
.
GetRand
()
...
))
order
:=
bytes
.
Compare
(
oh1
,
oh2
)
...
...
@@ -203,7 +203,7 @@ func (s *secureSession) handshake(ctx context.Context, insecure io.ReadWriter) e
return
err
}
// Receive + Parse their
Propose packet and generate an
Exchange packet.
// Receive + Parse their Exchange packet.
exchangeIn
:=
new
(
pb
.
Exchange
)
if
_
,
err
:=
readMsgCtx
(
ctx
,
s
.
insecureM
,
exchangeIn
);
err
!=
nil
{
return
err
...
...
@@ -278,7 +278,7 @@ func (s *secureSession) handshake(ctx context.Context, insecure io.ReadWriter) e
// log.Debug("2.3 mac + cipher.")
// =============================================================================
// step 3. Finish -- send expected message
(the nonces),
verify encryption works
// step 3. Finish -- send expected message
to
verify encryption works
(send local nonce)
// setup ETM ReadWriter
w
:=
NewETMWriter
(
s
.
insecure
,
s
.
local
.
cipher
,
s
.
local
.
mac
)
...
...
This diff is collapsed.
Click to expand it.
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