From e96e01152052be68628c2f7c3c94c6eb4d24467d Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 6 Jan 2020 18:28:36 -0800 Subject: [PATCH 1/2] build: update to latest lightning-onion version --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8eb8cf4fb..bdcff838b 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,7 @@ require ( github.com/kkdai/bstream v0.0.0-20181106074824-b3251f7901ec github.com/lightninglabs/neutrino v0.11.0 github.com/lightninglabs/protobuf-hex-display v1.3.3-0.20191212020323-b444784ce75d - github.com/lightningnetwork/lightning-onion v0.0.0-20191214001659-f34e9dc1651d + github.com/lightningnetwork/lightning-onion v1.0.1 github.com/lightningnetwork/lnd/cert v1.0.0 github.com/lightningnetwork/lnd/queue v1.0.2 github.com/lightningnetwork/lnd/ticker v1.0.0 diff --git a/go.sum b/go.sum index 84782ca1e..4c6503ff1 100644 --- a/go.sum +++ b/go.sum @@ -132,10 +132,10 @@ github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf h1:HZKvJUHlcXI github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf/go.mod h1:vxmQPeIQxPf6Jf9rM8R+B4rKBqLA2AjttNxkFBL2Plk= github.com/lightninglabs/neutrino v0.11.0 h1:lPpYFCtsfJX2W5zI4pWycPmbbBdr7zU+BafYdLoD6k0= github.com/lightninglabs/neutrino v0.11.0/go.mod h1:CuhF0iuzg9Sp2HO6ZgXgayviFTn1QHdSTJlMncK80wg= -github.com/lightningnetwork/lightning-onion v0.0.0-20191214001659-f34e9dc1651d h1:U50MHOOeL6gR3Ee/l0eMvZMpmRo+ydzmlQuIruCyCsA= -github.com/lightningnetwork/lightning-onion v0.0.0-20191214001659-f34e9dc1651d/go.mod h1:rigfi6Af/KqsF7Za0hOgcyq2PNH4AN70AaMRxcJkff4= github.com/lightninglabs/protobuf-hex-display v1.3.3-0.20191212020323-b444784ce75d h1:QWD/5MPnaZfUVP7P8wLa4M8Td2DI7XXHXt2vhVtUgGI= github.com/lightninglabs/protobuf-hex-display v1.3.3-0.20191212020323-b444784ce75d/go.mod h1:KDb67YMzoh4eudnzClmvs2FbiLG9vxISmLApUkCa4uI= +github.com/lightningnetwork/lightning-onion v1.0.1 h1:qChGgS5+aPxFeR6JiUsGvanei1bn6WJpYbvosw/1604= +github.com/lightningnetwork/lightning-onion v1.0.1/go.mod h1:rigfi6Af/KqsF7Za0hOgcyq2PNH4AN70AaMRxcJkff4= github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796 h1:sjOGyegMIhvgfq5oaue6Td+hxZuf3tDC8lAPrFldqFw= github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796/go.mod h1:3p7ZTf9V1sNPI5H8P3NkTFF4LuwMdPl2DodF60qAKqY= github.com/ltcsuite/ltcutil v0.0.0-20181217130922-17f3b04680b6/go.mod h1:8Vg/LTOO0KYa/vlHWJ6XZAevPQThGH5sufO0Hrou/lA= From 128be259a774ae04d16b47a55de524b77e4d0773 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 6 Jan 2020 18:28:54 -0800 Subject: [PATCH 2/2] routing: use updated sphinx.NewOnionPacket method In this commit, we update the routing package to use the new `sphinx.NewOnionPacket` method. The new version of this method allows us to specify _how_ the packet should be filled before it's used to create a mix-header. This isn't a fundamental change (totally backwards compatible), instead it plugs a privacy leak that may have revealed to the destination how long the true route was. --- routing/router.go | 1 + 1 file changed, 1 insertion(+) diff --git a/routing/router.go b/routing/router.go index 55cefaae9..d09383e9f 100644 --- a/routing/router.go +++ b/routing/router.go @@ -1518,6 +1518,7 @@ func generateSphinxPacket(rt *route.Route, paymentHash []byte, // privacy preserving source routing across the network. sphinxPacket, err := sphinx.NewOnionPacket( sphinxPath, sessionKey, paymentHash, + sphinx.DeterministicPacketFiller, ) if err != nil { return nil, nil, err