Fix bug in onion message payload decode
authorValentine Wallace <vwallace@protonmail.com>
Fri, 5 Aug 2022 21:50:02 +0000 (17:50 -0400)
committerValentine Wallace <vwallace@protonmail.com>
Wed, 24 Aug 2022 00:33:58 +0000 (20:33 -0400)
commit351349c845b9927ef8a508c1216efe380c41b138
treebdf555a60f0c77e5530c737e7fb8bc083c4f3d12
parentdceca5b590dd34370e365307ed8517db5d04440e
Fix bug in onion message payload decode

Previously, we were decoding payload lengths as a VarInt. Per the spec, this is
wrong -- it should be decoded as a BigSize.  This bug also exists in our
payment payload decoding, to be fixed separately.

Upcoming reply path tests caught this bug because we hadn't encoded a payload
greater than 253 before, so we hadn't hit the problem that VarInts are encoded
as little-endian whereas BigSizes are encoded as big-endian.
lightning/src/onion_message/packet.rs