From f70b2ebceaff118e67541f3d9d0f714a00fe0dc7 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sat, 9 May 2020 12:49:02 +0100 Subject: [PATCH] Fix bad check --- src/yggdrasil/link.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/yggdrasil/link.go b/src/yggdrasil/link.go index 03e60076..0b37eaa2 100644 --- a/src/yggdrasil/link.go +++ b/src/yggdrasil/link.go @@ -103,7 +103,7 @@ func (l *link) call(uri string, sintf string) error { if pubkeys, ok := u.Query()["curve25519"]; ok && len(pubkeys) > 0 { tcpOpts.pinnedCurve25519Keys = make(map[crypto.BoxPubKey]struct{}) for _, pubkey := range pubkeys { - if boxPub, err := hex.DecodeString(pubkey); err != nil { + if boxPub, err := hex.DecodeString(pubkey); err == nil { var boxPubKey crypto.BoxPubKey copy(boxPubKey[:], boxPub) tcpOpts.pinnedCurve25519Keys[boxPubKey] = struct{}{} @@ -113,7 +113,7 @@ func (l *link) call(uri string, sintf string) error { if pubkeys, ok := u.Query()["ed25519"]; ok && len(pubkeys) > 0 { tcpOpts.pinnedEd25519Keys = make(map[crypto.SigPubKey]struct{}) for _, pubkey := range pubkeys { - if sigPub, err := hex.DecodeString(pubkey); err != nil { + if sigPub, err := hex.DecodeString(pubkey); err == nil { var sigPubKey crypto.SigPubKey copy(sigPubKey[:], sigPub) tcpOpts.pinnedEd25519Keys[sigPubKey] = struct{}{}