From 429189d11dff8f4709ea1910f81f1e3420474037 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sun, 16 Feb 2020 23:44:20 +0000 Subject: [PATCH] Use 'curve25519' instead of 'pubkey' --- src/crypto/crypto.go | 4 ++-- src/yggdrasil/dialer.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/crypto/crypto.go b/src/crypto/crypto.go index 92adf890..211a0e54 100644 --- a/src/crypto/crypto.go +++ b/src/crypto/crypto.go @@ -199,9 +199,9 @@ func (k BoxPubKey) String() string { return hex.EncodeToString(k[:]) } -// Network returns "pubkey" for "box" keys. +// Network returns "curve25519" for "box" keys. func (n BoxPubKey) Network() string { - return "pubkey" + return "curve25519" } // NewBoxKeys generates a new pair of public/private crypto box keys. diff --git a/src/yggdrasil/dialer.go b/src/yggdrasil/dialer.go index 293f6d0b..9f58d305 100644 --- a/src/yggdrasil/dialer.go +++ b/src/yggdrasil/dialer.go @@ -18,21 +18,21 @@ type Dialer struct { } // Dial opens a session to the given node. The first parameter should be -// "pubkey" or "nodeid" and the second parameter should contain a hexadecimal -// representation of the target. It uses DialContext internally. +// "curve25519" or "nodeid" and the second parameter should contain a +// hexadecimal representation of the target. It uses DialContext internally. func (d *Dialer) Dial(network, address string) (net.Conn, error) { return d.DialContext(nil, network, address) } // DialContext is used internally by Dial, and should only be used with a // context that includes a timeout. It uses DialByNodeIDandMask internally when -// the network is "nodeid", or DialByPublicKey when the network is "pubkey". +// the network is "nodeid", or DialByPublicKey when the network is "curve25519". func (d *Dialer) DialContext(ctx context.Context, network, address string) (net.Conn, error) { var nodeID crypto.NodeID var nodeMask crypto.NodeID // Process switch network { - case "pubkey": + case "curve25519": dest, err := hex.DecodeString(address) if err != nil { return nil, err