Browse Source

sphinx: Removing old nexthop based on public keys

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 8 years ago
parent
commit
157c2da778
  1. 4
      lightningd/sphinx.c
  2. 1
      lightningd/sphinx.h

4
lightningd/sphinx.c

@ -368,14 +368,13 @@ struct onionpacket *create_onionpacket(
int i, num_hops = tal_count(path); int i, num_hops = tal_count(path);
u8 filler[(num_hops - 1) * HOP_DATA_SIZE]; u8 filler[(num_hops - 1) * HOP_DATA_SIZE];
struct keyset keys; struct keyset keys;
u8 nextaddr[20], nexthmac[SECURITY_PARAMETER]; u8 nexthmac[SECURITY_PARAMETER];
u8 stream[ROUTING_INFO_SIZE]; u8 stream[ROUTING_INFO_SIZE];
struct hop_params *params = generate_hop_params(ctx, sessionkey, path); struct hop_params *params = generate_hop_params(ctx, sessionkey, path);
if (!params) if (!params)
return NULL; return NULL;
packet->version = 1; packet->version = 1;
memset(nextaddr, 0, 20);
memset(nexthmac, 0, 20); memset(nexthmac, 0, 20);
memset(packet->routinginfo, 0, ROUTING_INFO_SIZE); memset(packet->routinginfo, 0, ROUTING_INFO_SIZE);
@ -400,7 +399,6 @@ struct onionpacket *create_onionpacket(
compute_packet_hmac(packet, assocdata, assocdatalen, keys.mu, compute_packet_hmac(packet, assocdata, assocdatalen, keys.mu,
nexthmac); nexthmac);
pubkey_hash160(nextaddr, &path[i]);
} }
memcpy(packet->mac, nexthmac, sizeof(nexthmac)); memcpy(packet->mac, nexthmac, sizeof(nexthmac));
memcpy(&packet->ephemeralkey, &params[0].ephemeralkey, sizeof(secp256k1_pubkey)); memcpy(&packet->ephemeralkey, &params[0].ephemeralkey, sizeof(secp256k1_pubkey));

1
lightningd/sphinx.h

@ -20,7 +20,6 @@
struct onionpacket { struct onionpacket {
/* Cleartext information */ /* Cleartext information */
u8 version; u8 version;
u8 nexthop[20];
u8 mac[20]; u8 mac[20];
secp256k1_pubkey ephemeralkey; secp256k1_pubkey ephemeralkey;

Loading…
Cancel
Save