diff --git a/Signal.xcworkspace/xcshareddata/Signal.xccheckout b/Signal.xcworkspace/xcshareddata/Signal.xccheckout index 3559b0543..d6725997c 100644 --- a/Signal.xcworkspace/xcshareddata/Signal.xccheckout +++ b/Signal.xcworkspace/xcshareddata/Signal.xccheckout @@ -22,7 +22,7 @@ 5D79A077E31B3FE97A3C6613CBFFDD71C314D14C .. D74FB800F048CB516BB4BC70047F7CC676D291B9 - ..Pods/ + ..Pods IDESourceControlProjectURL github.com:WhisperSystems/Signal-iOS.git @@ -36,17 +36,17 @@ IDESourceControlRepositoryExtensionIdentifierKey public.vcs.git IDESourceControlWCCIdentifierKey - D74FB800F048CB516BB4BC70047F7CC676D291B9 + 5D79A077E31B3FE97A3C6613CBFFDD71C314D14C IDESourceControlWCCName - Pods + Signal-iOS IDESourceControlRepositoryExtensionIdentifierKey public.vcs.git IDESourceControlWCCIdentifierKey - 5D79A077E31B3FE97A3C6613CBFFDD71C314D14C + D74FB800F048CB516BB4BC70047F7CC676D291B9 IDESourceControlWCCName - Signal-iOS + Signal-iOSPods diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index b0f92be1e..150b4b4bd 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -66,7 +66,7 @@ NSError *error; - NSDictionary *attrs = @{NSFileProtectionKey: NSFileProtectionComplete}; + NSDictionary *attrs = @{NSFileProtectionKey: NSFileProtectionCompleteUntilFirstUserAuthentication}; [[NSFileManager defaultManager] setAttributes:attrs ofItemAtPath:preferencesPath error:&error]; [pathsToExclude addObject:[[preferencesPath stringByAppendingString:[[NSBundle mainBundle] bundleIdentifier]] stringByAppendingString:@".plist"]]; @@ -74,7 +74,7 @@ NSString *logPath = [NSHomeDirectory() stringByAppendingString:@"/Library/Caches/Logs/"]; NSArray *logsFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:logPath error:&error]; - attrs = @{NSFileProtectionKey: NSFileProtectionComplete}; + attrs = @{NSFileProtectionKey: NSFileProtectionCompleteUntilFirstUserAuthentication}; [[NSFileManager defaultManager] setAttributes:attrs ofItemAtPath:logPath error:&error]; for (NSUInteger i = 0; i < [logsFiles count]; i++) { @@ -173,6 +173,11 @@ return; } + if (!call) { + DDLogError(@"Decryption of session descriptor failed"); + return; + } + [[Environment phoneManager] incomingCallWithSession:call]; } diff --git a/Signal/src/phone/signaling/ResponderSessionDescriptor.m b/Signal/src/phone/signaling/ResponderSessionDescriptor.m index c2d859094..6823f3c1a 100644 --- a/Signal/src/phone/signaling/ResponderSessionDescriptor.m +++ b/Signal/src/phone/signaling/ResponderSessionDescriptor.m @@ -99,6 +99,7 @@ require(data != nil); checkOperation([data length] >= VERSION_SIZE + IV_SIZE); NSData* cipherKey = [SGNKeychainUtil signalingCipherKey]; + require(cipherKey != nil); NSData* iv = [data subdataWithRange:NSMakeRange(VERSION_SIZE, IV_SIZE)]; NSData* cipherText = [data skip:VERSION_SIZE+IV_SIZE]; return [cipherText decryptWithAesInCipherBlockChainingModeWithPkcs7PaddingWithKey:cipherKey andIv:iv]; diff --git a/Signal/src/view controllers/InboxFeedViewController.m b/Signal/src/view controllers/InboxFeedViewController.m index d1c383030..949085c7d 100644 --- a/Signal/src/view controllers/InboxFeedViewController.m +++ b/Signal/src/view controllers/InboxFeedViewController.m @@ -48,11 +48,6 @@ static NSString *const FOOTER_TABLE_CELL_IDENTIFIER = @"InboxFeedFooterCell"; [self observeKeyboardNotifications]; [self setupLabelLocalizationAndStyles]; - if (![Environment isRegistered]) { - [Environment resetAppData]; - RegisterViewController *registerViewController = [RegisterViewController registerViewController]; - [self presentViewController:registerViewController animated:NO completion:nil]; - } _inboxFeedTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; } @@ -67,6 +62,12 @@ static NSString *const FOOTER_TABLE_CELL_IDENTIFIER = @"InboxFeedFooterCell"; [self.navigationController setNavigationBarHidden:YES animated:NO]; [_searchBarTitleView updateAutoCorrectionType]; [_inboxFeedTableView reloadData]; + + if (![Environment isRegistered]) { + [Environment resetAppData]; + RegisterViewController *registerViewController = [RegisterViewController registerViewController]; + [self presentViewController:registerViewController animated:NO completion:nil]; + } } - (void)dealloc {