File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -311,10 +311,14 @@ func onionEncrypt(sharedSecret *Hash256, data []byte) []byte {
311311 return p
312312}
313313
314- // minOnionErrorLength is the minimally expected length of the onion error
315- // message. Including padding, all messages on the wire should be at least 256
316- // bytes. We then add the size of the sha256 HMAC as well.
317- const minOnionErrorLength = 2 + 2 + 256 + sha256 .Size
314+ // minPaddedOnionErrorLength is the minimally expected length of the padded
315+ // onion error message including two uint16s for the length of the message and
316+ // the length of the padding.
317+ const minPaddedOnionErrorLength = 2 + 2 + 256
318+
319+ // minOnionErrorLength is the minimally expected length of the complete onion
320+ // error message including the HMAC.
321+ const minOnionErrorLength = minPaddedOnionErrorLength + sha256 .Size
318322
319323// DecryptError attempts to decrypt the passed encrypted error response. The
320324// onion failure is encrypted in backward manner, starting from the node where
You can’t perform that action at this time.
0 commit comments