mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
Check prekey identity on mismatched devices too.
This commit is contained in:
parent
6b5753337c
commit
d8e1df9233
@ -189,7 +189,7 @@ public class PushTransport extends BaseTransport {
|
|||||||
private void handleMismatchedDevices(PushServiceSocket socket, long threadId,
|
private void handleMismatchedDevices(PushServiceSocket socket, long threadId,
|
||||||
Recipient recipient,
|
Recipient recipient,
|
||||||
MismatchedDevices mismatchedDevices)
|
MismatchedDevices mismatchedDevices)
|
||||||
throws InvalidNumberException, IOException
|
throws InvalidNumberException, IOException, UntrustedIdentityException
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
String e164number = Util.canonicalizeNumber(context, recipient.getNumber());
|
String e164number = Util.canonicalizeNumber(context, recipient.getNumber());
|
||||||
@ -205,7 +205,11 @@ public class PushTransport extends BaseTransport {
|
|||||||
PreKeyEntity preKey = socket.getPreKey(address);
|
PreKeyEntity preKey = socket.getPreKey(address);
|
||||||
KeyExchangeProcessorV2 processor = new KeyExchangeProcessorV2(context, masterSecret, address);
|
KeyExchangeProcessorV2 processor = new KeyExchangeProcessorV2(context, masterSecret, address);
|
||||||
|
|
||||||
|
if (processor.isTrusted(preKey)) {
|
||||||
processor.processKeyExchangeMessage(preKey, threadId);
|
processor.processKeyExchangeMessage(preKey, threadId);
|
||||||
|
} else {
|
||||||
|
throw new UntrustedIdentityException("Untrusted identity key!", e164number, preKey.getIdentityKey());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (InvalidKeyException e) {
|
} catch (InvalidKeyException e) {
|
||||||
throw new IOException(e);
|
throw new IOException(e);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user