Add padding for push messages.

1) Use 'bit padding.'

1) By default, pad at 160 byte increments.
This commit is contained in:
Moxie Marlinspike
2014-07-09 14:36:01 -07:00
parent fcaa3f0d73
commit 07fd17ccda
5 changed files with 77 additions and 7 deletions

View File

@@ -168,6 +168,13 @@ public class SessionCipher {
}
WhisperMessage ciphertextMessage = new WhisperMessage(decodedMessage);
if (ciphertextMessage.getMessageVersion() != sessionState.getSessionVersion()) {
throw new InvalidMessageException(String.format("Message version %d, but session version %d",
ciphertextMessage.getMessageVersion(),
sessionState.getSessionVersion()));
}
ECPublicKey theirEphemeral = ciphertextMessage.getSenderEphemeral();
int counter = ciphertextMessage.getCounter();
ChainKey chainKey = getOrCreateChainKey(sessionState, theirEphemeral);