whisper: sym encryption message padding includes salt (#15631)

Now that the AES salt has been moved to the payload, padding must
be adjusted to hide it, lest an attacker guesses that the packet
uses symmetric encryption.
This commit is contained in:
Guillaume Ballet
2017-12-11 12:32:58 +01:00
committed by Felix Lange
parent 732f5468d3
commit e7610eadfe
2 changed files with 60 additions and 0 deletions

View File

@@ -124,6 +124,10 @@ func (msg *sentMessage) appendPadding(params *MessageParams) error {
if params.Src != nil {
rawSize += signatureLength
}
if params.KeySym != nil {
rawSize += AESNonceLength
}
odd := rawSize % padSizeLimit
if len(params.Padding) != 0 {