aboutsummaryrefslogtreecommitdiffstats
path: root/handshake
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-04-14 19:48:48 -0400
committerSam Anthony <sam@samanthony.xyz>2025-04-14 19:48:48 -0400
commit19586853713277cdfe7cf3322037c72c40b75b85 (patch)
treeabfe1e44822c85c9ec80c3814a66a90a1b179f38 /handshake
parented00b0e3d9b8a3304ceb4f1d847e929c45b6332f (diff)
downloadhose-19586853713277cdfe7cf3322037c72c40b75b85.zip
send signature verification key in handshake
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
}