session clearing must be in IdentityKeyStore implementation
Trying to do it in the protocol will not work with multiple devices, because we'll only archive the session of the first sending device. // FREEBIE
This commit is contained in:
parent
f8f44d143b
commit
8fa5ea8d22
@ -124,9 +124,7 @@ static dispatch_queue_t _sessionCipherDispatchQueue;
|
||||
userInfo:@{}];
|
||||
}
|
||||
|
||||
if ([self.identityKeyStore saveRemoteIdentity:sessionState.remoteIdentityKey recipientId:self.recipientId]) {
|
||||
[sessionRecord removePreviousSessionStates];
|
||||
}
|
||||
[self.identityKeyStore saveRemoteIdentity:sessionState.remoteIdentityKey recipientId:self.recipientId];
|
||||
|
||||
NSData *ciphertextBody = [AES_CBC encryptCBCMode:paddedMessage withKey:messageKeys.cipherKey withIV:messageKeys.iv];
|
||||
|
||||
@ -202,11 +200,8 @@ static dispatch_queue_t _sessionCipherDispatchQueue;
|
||||
userInfo:@{}];
|
||||
}
|
||||
|
||||
if ([self.identityKeyStore saveRemoteIdentity:sessionRecord.sessionState.remoteIdentityKey
|
||||
recipientId:self.recipientId]) {
|
||||
[sessionRecord removePreviousSessionStates];
|
||||
}
|
||||
|
||||
[self.identityKeyStore saveRemoteIdentity:sessionRecord.sessionState.remoteIdentityKey
|
||||
recipientId:self.recipientId];
|
||||
[self.sessionStore storeSession:self.recipientId deviceId:self.deviceId session:sessionRecord];
|
||||
|
||||
return plaintext;
|
||||
|
||||
@ -141,14 +141,7 @@ const int kPreKeyOfLastResortId = 0xFFFFFF;
|
||||
break;
|
||||
}
|
||||
|
||||
BOOL previousIdentityExisted =
|
||||
[self.identityStore saveRemoteIdentity:theirIdentityKey recipientId:self.recipientId];
|
||||
if (previousIdentityExisted) {
|
||||
DDLogInfo(@"%@ PKWM removing previous session states for changed identity for recipient:%@",
|
||||
self.tag,
|
||||
self.recipientId);
|
||||
[sessionRecord removePreviousSessionStates];
|
||||
}
|
||||
[self.identityStore saveRemoteIdentity:theirIdentityKey recipientId:self.recipientId];
|
||||
|
||||
return unSignedPrekeyId;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user