Browse Source

sphinx: Moving HMAC to the end of the packet

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

4
lightningd/sphinx.c

@ -70,8 +70,8 @@ u8 *serialize_onionpacket(
write_buffer(dst, &m->version, 1, &p);
write_buffer(dst, der, outputlen, &p);
write_buffer(dst, m->mac, sizeof(m->mac), &p);
write_buffer(dst, m->routinginfo, ROUTING_INFO_SIZE, &p);
write_buffer(dst, m->mac, sizeof(m->mac), &p);
return dst;
}
@ -100,8 +100,8 @@ struct onionpacket *parse_onionpacket(
if (secp256k1_ec_pubkey_parse(secp256k1_ctx, &m->ephemeralkey, rawEphemeralkey, 33) != 1)
return tal_free(m);
read_buffer(&m->mac, src, 20, &p);
read_buffer(&m->routinginfo, src, ROUTING_INFO_SIZE, &p);
read_buffer(&m->mac, src, 20, &p);
return m;
}

Loading…
Cancel
Save