From 157c2da778ffabc0dfa6d11f5a8f8a2035214f80 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 10 Apr 2017 15:11:32 -0700 Subject: [PATCH] sphinx: Removing old nexthop based on public keys Signed-off-by: Christian Decker --- lightningd/sphinx.c | 4 +--- lightningd/sphinx.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lightningd/sphinx.c b/lightningd/sphinx.c index f513491c8..20d49e468 100644 --- a/lightningd/sphinx.c +++ b/lightningd/sphinx.c @@ -368,14 +368,13 @@ struct onionpacket *create_onionpacket( int i, num_hops = tal_count(path); u8 filler[(num_hops - 1) * HOP_DATA_SIZE]; struct keyset keys; - u8 nextaddr[20], nexthmac[SECURITY_PARAMETER]; + u8 nexthmac[SECURITY_PARAMETER]; u8 stream[ROUTING_INFO_SIZE]; struct hop_params *params = generate_hop_params(ctx, sessionkey, path); if (!params) return NULL; packet->version = 1; - memset(nextaddr, 0, 20); memset(nexthmac, 0, 20); memset(packet->routinginfo, 0, ROUTING_INFO_SIZE); @@ -400,7 +399,6 @@ struct onionpacket *create_onionpacket( compute_packet_hmac(packet, assocdata, assocdatalen, keys.mu, nexthmac); - pubkey_hash160(nextaddr, &path[i]); } memcpy(packet->mac, nexthmac, sizeof(nexthmac)); memcpy(&packet->ephemeralkey, ¶ms[0].ephemeralkey, sizeof(secp256k1_pubkey)); diff --git a/lightningd/sphinx.h b/lightningd/sphinx.h index 4ab5e82f0..08c4b5551 100644 --- a/lightningd/sphinx.h +++ b/lightningd/sphinx.h @@ -20,7 +20,6 @@ struct onionpacket { /* Cleartext information */ u8 version; - u8 nexthop[20]; u8 mac[20]; secp256k1_pubkey ephemeralkey;