Display legacy message error when V1 message is received.

This commit is contained in:
Moxie Marlinspike
2014-04-10 15:20:43 -07:00
parent cebad39422
commit 0574ec170a
10 changed files with 39 additions and 12 deletions

View File

@@ -133,4 +133,9 @@ public class WhisperMessage implements CiphertextMessage {
return CiphertextMessage.WHISPER_TYPE;
}
public static boolean isLegacy(byte[] message) {
return message != null && message.length >= 1 &&
Conversions.highBitsToInt(message[0]) <= CiphertextMessage.UNSUPPORTED_VERSION;
}
}