sphinx: Actually use the pad stream to generate the packet

We flipped two buffers and were not actually using the chacha20 stream.
This commit is contained in:
Christian Decker 2020-01-21 16:21:00 +01:00
parent 7f4ed54b46
commit 9038364c63
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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")