aboutsummaryrefslogtreecommitdiffstats
path: root/handshake
diff options
context:
space:
mode:
Diffstat (limited to 'handshake')
-rw-r--r--handshake/handshake.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/handshake/handshake.go b/handshake/handshake.go
index 07b3ef4..dc3df95 100644
--- a/handshake/handshake.go
+++ b/handshake/handshake.go
@@ -69,12 +69,16 @@ func Handshake(rhost string) error {
// send sends the local public box (encryption) key to a remote host.
func send(rhost string) error {
- util.Logf("loading public encryption key...")
pubBoxkey, err := key.LoadBoxPublicKey()
if err != nil {
return err
}
+ pubSigKey, err := key.LoadSigPublicKey()
+ if err != nil {
+ return err
+ }
+
raddr := net.JoinHostPort(rhost, port)
util.Logf("connecting to %s...", raddr)
conn, err := dialWithTimeout(network, raddr, timeout)
@@ -87,8 +91,11 @@ func send(rhost string) error {
if _, err := conn.Write(pubBoxkey[:]); err != nil {
return err
}
+ if _, err := conn.Write(pubSigKey[:]); err != nil {
+ return err
+ }
- util.Logf("sent public encryption key to %s", rhost)
+ util.Logf("sent public keys to %s", rhost)
return nil
}