Clean up prekey logic.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 35728b2835
commit 97001018ae

@ -137,10 +137,10 @@ EXTERNAL SOURCES:
CHECKOUT OPTIONS: CHECKOUT OPTIONS:
AxolotlKit: AxolotlKit:
:commit: 919d541d6b8a8802a94f943026b8f68394e2c0b8 :commit: 945c04f9e70f7119d2ada4edb938849f3b7febab
:git: https://github.com/WhisperSystems/SignalProtocolKit.git :git: https://github.com/WhisperSystems/SignalProtocolKit.git
SignalServiceKit: SignalServiceKit:
:commit: e1949893f297ab485e83a0ea80d3523d3c6cd82b :commit: 93219e4d23e07b3734fb8df4a2d244b26fcecd59
:git: https://github.com/WhisperSystems/SignalServiceKit.git :git: https://github.com/WhisperSystems/SignalServiceKit.git
SocketRocket: SocketRocket:
:commit: 41b57bb2fc292a814f758441a05243eb38457027 :commit: 41b57bb2fc292a814f758441a05243eb38457027
@ -174,4 +174,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 48dbf2fb380d626bb799a782dd41b6bf1e466506 PODFILE CHECKSUM: 48dbf2fb380d626bb799a782dd41b6bf1e466506
COCOAPODS: 1.0.1 COCOAPODS: 1.1.1

@ -132,8 +132,8 @@
70377AAB1918450100CAF501 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70377AAA1918450100CAF501 /* MobileCoreServices.framework */; }; 70377AAB1918450100CAF501 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70377AAA1918450100CAF501 /* MobileCoreServices.framework */; };
7038632718F70C0700D4A43F /* CryptoTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632418F70C0700D4A43F /* CryptoTools.m */; }; 7038632718F70C0700D4A43F /* CryptoTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632418F70C0700D4A43F /* CryptoTools.m */; };
7038632818F70C0700D4A43F /* EvpSymetricUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632618F70C0700D4A43F /* EvpSymetricUtil.m */; }; 7038632818F70C0700D4A43F /* EvpSymetricUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632618F70C0700D4A43F /* EvpSymetricUtil.m */; };
70B800A6190C53180042E3F0 /* libspandsp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70B800A3190C529C0042E3F0 /* libspandsp.a */; }; 70B800A6190C53180042E3F0 /* ReferenceProxy in Frameworks */ = {isa = PBXBuildFile; fileRef = 70B800A3190C529C0042E3F0 /* libspandsp.a */; };
70B800AF190C548D0042E3F0 /* libspeex.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70B800AC190C54790042E3F0 /* libspeex.a */; }; 70B800AF190C548D0042E3F0 /* ReferenceProxy in Frameworks */ = {isa = PBXBuildFile; fileRef = 70B800AC190C54790042E3F0 /* libspeex.a */; };
70B8FEE21909FE360042E3F0 /* 171756__nenadsimic__picked-coin-echo-2.wav in Resources */ = {isa = PBXBuildFile; fileRef = 70B8FEE11909FE360042E3F0 /* 171756__nenadsimic__picked-coin-echo-2.wav */; }; 70B8FEE21909FE360042E3F0 /* 171756__nenadsimic__picked-coin-echo-2.wav in Resources */ = {isa = PBXBuildFile; fileRef = 70B8FEE11909FE360042E3F0 /* 171756__nenadsimic__picked-coin-echo-2.wav */; };
70BAFD5D190584BE00FA5E0B /* NotificationTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BAFD5C190584BE00FA5E0B /* NotificationTracker.m */; }; 70BAFD5D190584BE00FA5E0B /* NotificationTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BAFD5C190584BE00FA5E0B /* NotificationTracker.m */; };
768A1A2B17FC9CD300E00ED8 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 768A1A2A17FC9CD300E00ED8 /* libz.dylib */; }; 768A1A2B17FC9CD300E00ED8 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 768A1A2A17FC9CD300E00ED8 /* libz.dylib */; };
@ -1259,8 +1259,8 @@
FC3BD9881A30A790005B96BB /* Social.framework in Frameworks */, FC3BD9881A30A790005B96BB /* Social.framework in Frameworks */,
FCB11D8C1A129A76002F93FB /* CoreMedia.framework in Frameworks */, FCB11D8C1A129A76002F93FB /* CoreMedia.framework in Frameworks */,
70377AAB1918450100CAF501 /* MobileCoreServices.framework in Frameworks */, 70377AAB1918450100CAF501 /* MobileCoreServices.framework in Frameworks */,
70B800AF190C548D0042E3F0 /* libspeex.a in Frameworks */, 70B800AF190C548D0042E3F0 /* ReferenceProxy in Frameworks */,
70B800A6190C53180042E3F0 /* libspandsp.a in Frameworks */, 70B800A6190C53180042E3F0 /* ReferenceProxy in Frameworks */,
B9EB5ABD1884C002007CBB57 /* MessageUI.framework in Frameworks */, B9EB5ABD1884C002007CBB57 /* MessageUI.framework in Frameworks */,
76C87F19181EFCE600C4ACAB /* MediaPlayer.framework in Frameworks */, 76C87F19181EFCE600C4ACAB /* MediaPlayer.framework in Frameworks */,
768A1A2B17FC9CD300E00ED8 /* libz.dylib in Frameworks */, 768A1A2B17FC9CD300E00ED8 /* libz.dylib in Frameworks */,
@ -2922,7 +2922,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
3465F381B1856CC06933B3A8 /* [CP] Copy Pods Resources */ = { 3465F381B1856CC06933B3A8 /* [CP] Copy Pods Resources */ = {
@ -3013,7 +3013,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
B4E9B04E862FB64FC9A8F79B /* [CP] Embed Pods Frameworks */ = { B4E9B04E862FB64FC9A8F79B /* [CP] Embed Pods Frameworks */ = {

@ -17,7 +17,6 @@
#import "Release.h" #import "Release.h"
#import "Signal-Swift.h" #import "Signal-Swift.h"
#import "TSMessagesManager.h" #import "TSMessagesManager.h"
#import "TSPreKeyManager.h"
#import "TSSocketManager.h" #import "TSSocketManager.h"
#import "TextSecureKitEnv.h" #import "TextSecureKitEnv.h"
#import "VersionMigrations.h" #import "VersionMigrations.h"
@ -28,6 +27,7 @@
#import <SignalServiceKit/OWSIncomingMessageReadObserver.h> #import <SignalServiceKit/OWSIncomingMessageReadObserver.h>
#import <SignalServiceKit/OWSMessageSender.h> #import <SignalServiceKit/OWSMessageSender.h>
#import <SignalServiceKit/TSAccountManager.h> #import <SignalServiceKit/TSAccountManager.h>
#import <SignalServiceKit/TSPreKeyManager.h>
@import WebRTC; @import WebRTC;
@import Intents; @import Intents;
@ -85,6 +85,13 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
DDLogWarn(@"%@ application: didFinishLaunchingWithOptions.", self.tag); DDLogWarn(@"%@ application: didFinishLaunchingWithOptions.", self.tag);
// Set the seed the generator for rand().
//
// We should always use arc4random() instead of rand(), but we
// still want to ensure that any third-party code that uses rand()
// gets random values.
srand((unsigned int)time(NULL));
// XXX - careful when moving this. It must happen before we initialize TSStorageManager. // XXX - careful when moving this. It must happen before we initialize TSStorageManager.
[self verifyDBKeysAvailableBeforeBackgroundLaunch]; [self verifyDBKeysAvailableBeforeBackgroundLaunch];
@ -277,6 +284,8 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
}]; }];
[self removeScreenProtection]; [self removeScreenProtection];
[TSPreKeyManager checkPreKeysIfNecessary];
} }
- (void)applicationWillResignActive:(UIApplication *)application { - (void)applicationWillResignActive:(UIApplication *)application {

@ -55,7 +55,7 @@ class PeerConnectionClientTest: XCTestCase {
let iceServers = [RTCIceServer]() let iceServers = [RTCIceServer]()
clientDelegate = FakePeerConnectionClientDelegate() clientDelegate = FakePeerConnectionClientDelegate()
client = PeerConnectionClient(iceServers: iceServers, delegate: clientDelegate, callType: .outgoing) client = PeerConnectionClient(iceServers: iceServers, delegate: clientDelegate, callDirection: .outgoing)
peerConnection = client.peerConnectionForTests() peerConnection = client.peerConnectionForTests()
dataChannel = client.dataChannelForTests() dataChannel = client.dataChannelForTests()
} }

Loading…
Cancel
Save