tExport ValidateOnionInternal function. - tordam - A library for peer discovery inside the Tor network HTML git clone https://git.parazyd.org/tordam DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit 2f66ffd8201aa31aba279822a292125485bffe51 DIR parent 9d478d3c2b426c24d92be1079ce0ba39acd70e1b HTML Author: parazyd <parazyd@dyne.org> Date: Sun, 7 Mar 2021 21:20:14 +0100 Export ValidateOnionInternal function. Diffstat: M announce_test.go | 2 +- M peer_announce.go | 2 +- M rpc_announce.go | 4 ++-- M sanity.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) --- DIR diff --git a/announce_test.go b/announce_test.go t@@ -57,7 +57,7 @@ func TestAnnounce(t *testing.T) { t.Fatal(err) } for _, i := range ret { - if err := validateOnionInternal(i); err != nil { + if err := ValidateOnionInternal(i); err != nil { t.Fatal(err) } } DIR diff --git a/peer_announce.go b/peer_announce.go t@@ -97,7 +97,7 @@ func AppendPeers(p []string) error { if _, ok := Peers[i]; ok { continue } - if err := validateOnionInternal(i); err != nil { + if err := ValidateOnionInternal(i); err != nil { log.Printf("warning: received garbage peer (%v)", err) continue } DIR diff --git a/rpc_announce.go b/rpc_announce.go t@@ -55,7 +55,7 @@ func (ann) Init(ctx context.Context, vals []string) ([]string, error) { pubkey := vals[1] portmap := strings.Split(vals[2], ",") - if err := validateOnionInternal(onion); err != nil { + if err := ValidateOnionInternal(onion); err != nil { rpcWarn("ann.Init", err.Error()) return nil, err } t@@ -145,7 +145,7 @@ func (ann) Validate(ctx context.Context, vals []string) ([]string, error) { onion := vals[0] signature := vals[1] - if err := validateOnionInternal(onion); err != nil { + if err := ValidateOnionInternal(onion); err != nil { rpcWarn("ann.Validate", err.Error()) return nil, err } DIR diff --git a/sanity.go b/sanity.go t@@ -40,7 +40,7 @@ func ValidateOnionAddress(addr string) error { return nil } -func validateOnionInternal(onionaddr string) error { +func ValidateOnionInternal(onionaddr string) error { splitOnion := strings.Split(onionaddr, ":") if len(splitOnion) != 2 { return errors.New("onion address doesn't contain a port")