mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-29 13:16:01 +01:00
Rollbacks, v2 sms-transport key exchanges, push identity conflicts.
1) Stop protocol rollbacks. 2) Handle v2 version key exchange messages. 3) Handle identity key conflicts on prekeybundle messages.
This commit is contained in:
@@ -89,7 +89,14 @@ public class SessionCipher {
|
||||
throws InvalidMessageException
|
||||
{
|
||||
try {
|
||||
KeyRecords records = getKeyRecords(context, masterSecret, recipient);
|
||||
KeyRecords records = getKeyRecords(context, masterSecret, recipient);
|
||||
|
||||
if (messageVersion < records.getSessionRecord().getNegotiatedSessionVersion()) {
|
||||
throw new InvalidMessageException("Message version: " + messageVersion +
|
||||
" but negotiated session version: " +
|
||||
records.getSessionRecord().getNegotiatedSessionVersion());
|
||||
}
|
||||
|
||||
SessionKey sessionKey = getSessionKey(masterSecret, Cipher.DECRYPT_MODE, messageVersion, localIdentityKey, records, recipientKeyId, senderKeyId);
|
||||
return new SessionCipherContext(records, sessionKey, senderKeyId,
|
||||
recipientKeyId, nextKey, counter,
|
||||
|
||||
Reference in New Issue
Block a user