Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify public key before requesting routes #211

Merged
merged 3 commits into from
Mar 6, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pkg/app/appnet/skywire_networker.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package appnet
import (
"context"
"errors"
"fmt"
"io"
"net"
"strings"
Expand Down Expand Up @@ -50,7 +51,12 @@ func (r *SkywireNetworker) DialContext(ctx context.Context, addr Addr) (net.Conn
return nil, err
}

rg, err := r.r.DialRoutes(ctx, addr.PubKey, routing.Port(localPort), addr.Port, router.DefaultDialOptions())
rPK := addr.PubKey
if rPK.Null() {
return nil, fmt.Errorf("Empty public key: %s", rPK)
evanlinjin marked this conversation as resolved.
Show resolved Hide resolved
}

rg, err := r.r.DialRoutes(ctx, rPK, routing.Port(localPort), addr.Port, router.DefaultDialOptions())
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# github.com/SkycoinProject/dmsg v0.0.0-20200306152741-acee74fa4514
# github.com/SkycoinProject/dmsg v0.0.0-20200306131535-fabb2c8177e9 => ../dmsg
github.com/SkycoinProject/dmsg
github.com/SkycoinProject/dmsg/cipher
github.com/SkycoinProject/dmsg/disc
Expand Down