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
81e7c2b8
Commit
81e7c2b8
authored
Jan 30, 2015
by
Juan Batiz-Benet
Committed by
Brian Tiger Chow
Feb 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log(secio): session loggable for event
parent
7c7ec141
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
p2p/crypto/secio/protocol.go
p2p/crypto/secio/protocol.go
+9
-2
No files found.
p2p/crypto/secio/protocol.go
View file @
81e7c2b8
...
...
@@ -46,6 +46,14 @@ type secureSession struct {
sharedSecret
[]
byte
}
func
(
s
*
secureSession
)
Loggable
()
map
[
string
]
interface
{}
{
m
:=
make
(
map
[
string
]
interface
{})
m
[
"localPeer"
]
=
s
.
localPeer
.
Pretty
()
m
[
"remotePeer"
]
=
s
.
remotePeer
.
Pretty
()
m
[
"established"
]
=
(
s
.
secure
!=
nil
)
return
m
}
func
newSecureSession
(
local
peer
.
ID
,
key
ci
.
PrivKey
)
(
*
secureSession
,
error
)
{
s
:=
&
secureSession
{
localPeer
:
local
,
localKey
:
key
}
...
...
@@ -80,7 +88,7 @@ func (s *secureSession) handshake(ctx context.Context, insecure io.ReadWriter) e
return
err
}
defer
log
.
EventBegin
(
ctx
,
"secureHandshake"
,
s
.
localPeer
)
.
Done
()
defer
log
.
EventBegin
(
ctx
,
"secureHandshake"
,
s
)
.
Done
()
s
.
local
.
permanentPubKey
=
s
.
localKey
.
GetPublic
()
myPubKeyBytes
,
err
:=
s
.
local
.
permanentPubKey
.
Bytes
()
...
...
@@ -292,6 +300,5 @@ func (s *secureSession) handshake(ctx context.Context, insecure io.ReadWriter) e
}
// Whew! ok, that's all folks.
log
.
Event
(
ctx
,
"secureHandshakeFinish"
,
s
.
localPeer
,
s
.
remotePeer
)
return
nil
}
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