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
p2p
go-p2p-tls
Commits
27e03a0a
Commit
27e03a0a
authored
Aug 01, 2019
by
Marten Seemann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make the error check for not receiving a public key more explicit
parent
46e9e9f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
transport.go
transport.go
+3
-4
No files found.
transport.go
View file @
27e03a0a
...
...
@@ -105,6 +105,9 @@ func (t *Transport) handshake(
case
remotePubKey
=
<-
keyCh
:
default
:
}
if
remotePubKey
==
nil
{
return
nil
,
errors
.
New
(
"go-libp2p-tls BUG: expected remote pub key to be set"
)
}
conn
,
err
:=
t
.
setupConn
(
tlsConn
,
remotePubKey
)
if
err
!=
nil
{
...
...
@@ -118,10 +121,6 @@ func (t *Transport) handshake(
}
func
(
t
*
Transport
)
setupConn
(
tlsConn
*
tls
.
Conn
,
remotePubKey
ci
.
PubKey
)
(
sec
.
SecureConn
,
error
)
{
if
remotePubKey
==
nil
{
return
nil
,
errors
.
New
(
"go-libp2p-tls BUG: expected remote pub key to be set"
)
}
remotePeerID
,
err
:=
peer
.
IDFromPublicKey
(
remotePubKey
)
if
err
!=
nil
{
return
nil
,
err
...
...
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