Browse Source

sphinx: Actually use the pad stream to generate the packet

We flipped two buffers and were not actually using the chacha20 stream.
travis-debug
Christian Decker 5 years ago
parent
commit
9038364c63
  1. 2
      common/sphinx.c
  2. 2
      tests/test_pay.py

2
common/sphinx.c

@ -425,7 +425,7 @@ struct onionpacket *create_onionpacket(
/* Note that this is just hop_payloads: the rest of the packet is
* overwritten below or above anyway. */
generate_key(padkey, "pad", 3, sp->session_key);
generate_cipher_stream(stream, padkey, ROUTING_INFO_SIZE);
generate_cipher_stream(packet->routinginfo, padkey, ROUTING_INFO_SIZE);
generate_header_padding(filler, sizeof(filler), sp, params);

2
tests/test_pay.py

@ -2479,7 +2479,7 @@ def test_createonion_rpc(node_factory):
# The trailer is generated using the filler and can be ued as a
# checksum. This trailer is from the test-vector in the specs.
print(res)
assert(res['onion'].endswith('be89e4701eb870f8ed64fafa446c78df3ea'))
assert(res['onion'].endswith('9400f45a48e6dc8ddbaeb3'))
@unittest.skipIf(not DEVELOPER, "gossip propagation is slow without DEVELOPER=1")

Loading…
Cancel
Save