Verify friend request stuff before decrypting

pull/33/head
Mikunj 6 years ago
parent 99cfe7ca24
commit 40edf1992a

@ -27,13 +27,14 @@ NSString *const kNSNotificationKey_ContactPubKey = @"kNSNotificationKey_ContactP
// Our state before we decrypt the message
SessionState *_Nullable state = [self getCurrentState:protocolContext];
// While decrypting our state may change internally
NSData *plainText = [self throws_decrypt:whisperMessage protocolContext:protocolContext];
// Loki: Verify incoming friend request messages
if (!state) {
[self throws_verifyFriendRequestAcceptPreKeyForMessage:whisperMessage protocolContext:protocolContext];
}
// While decrypting our state may change internally
NSData *plainText = [self throws_decrypt:whisperMessage protocolContext:protocolContext];
// Loki: Handle any session resets
[self handleSessionReset:whisperMessage previousState:state protocolContext:protocolContext];

Loading…
Cancel
Save