Added a random salt to prevent ID clashes between anonymous messages.

This commit is contained in:
akwizgran
2011-09-13 17:56:44 +01:00
parent 8ec40587b2
commit 005e7d5207
6 changed files with 24 additions and 2 deletions

View File

@@ -79,6 +79,9 @@ class MessageReader implements ObjectReader<Message> {
// Read the timestamp
long timestamp = r.readInt64();
if(timestamp < 0L) throw new FormatException();
// Read the salt
byte[] salt = r.readBytes(Message.SALT_LENGTH);
if(salt.length != Message.SALT_LENGTH) throw new FormatException();
// Skip the message body
r.readBytes(Message.MAX_BODY_LENGTH);
// Record the length of the data covered by the author's signature