Respond to CR.

This commit is contained in:
Matthew Chen 2018-02-09 10:42:25 -05:00
parent 78c4c00eac
commit b64528e817
5 changed files with 77 additions and 83 deletions

View File

@ -9,9 +9,9 @@ def shared_pods
pod 'SQLCipher', :git => 'https://github.com/sqlcipher/sqlcipher.git', :commit => 'd5c2bec'
# pod 'YapDatabase/SQLCipher', path: '../YapDatabase'
pod 'YapDatabase/SQLCipher', :git => 'https://github.com/WhisperSystems/YapDatabase.git', branch: 'release/unencryptedHeaders'
pod 'AxolotlKit', path: '../SignalProtocolKit'
# pod 'AxolotlKit', path: '../SignalProtocolKit'
pod 'SignalServiceKit', path: '.'
# pod 'AxolotlKit', git: 'https://github.com/WhisperSystems/SignalProtocolKit.git', branch: 'mkirk/framework-friendly'
pod 'AxolotlKit', git: 'https://github.com/signalapp/SignalProtocolKit.git'
#pod 'AxolotlKit', path: '../SignalProtocolKit'
pod 'HKDFKit', git: 'https://github.com/WhisperSystems/HKDFKit.git', branch: 'mkirk/framework-friendly'
#pod 'HKDFKit', path: '../HKDFKit'

View File

@ -129,7 +129,7 @@ PODS:
DEPENDENCIES:
- AFNetworking
- ATAppUpdater
- AxolotlKit (from `../SignalProtocolKit`)
- AxolotlKit (from `https://github.com/signalapp/SignalProtocolKit.git`)
- Curve25519Kit (from `https://github.com/WhisperSystems/Curve25519Kit`, branch `mkirk/framework-friendly`)
- GRKOpenSSLFramework (from `https://github.com/WhisperSystems/GRKOpenSSLFramework`)
- HKDFKit (from `https://github.com/WhisperSystems/HKDFKit.git`, branch `mkirk/framework-friendly`)
@ -146,7 +146,7 @@ DEPENDENCIES:
EXTERNAL SOURCES:
AxolotlKit:
:path: ../SignalProtocolKit
:git: https://github.com/signalapp/SignalProtocolKit.git
Curve25519Kit:
:branch: mkirk/framework-friendly
:git: https://github.com/WhisperSystems/Curve25519Kit
@ -170,6 +170,9 @@ EXTERNAL SOURCES:
:git: https://github.com/WhisperSystems/YapDatabase.git
CHECKOUT OPTIONS:
AxolotlKit:
:commit: b523c0b82e76295726ded8afec2715328d63213c
:git: https://github.com/signalapp/SignalProtocolKit.git
Curve25519Kit:
:commit: 03a19c80aafc10a3464f0c086b1eb38239c507ac
:git: https://github.com/WhisperSystems/Curve25519Kit
@ -217,6 +220,6 @@ SPEC CHECKSUMS:
YapDatabase: 299a32de9d350d37a9ac5b0532609d87d5d2a5de
YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54
PODFILE CHECKSUM: d1c081f5e8cda394caa2bfbb157d628f33352cff
PODFILE CHECKSUM: d424a8f153ae6e31631ed25ef5700e7e60234a79
COCOAPODS: 1.3.1

View File

@ -314,7 +314,6 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
OWSAssert(recipientId.length > 0);
OWSAssert(transaction);
// TODO: Remove all @synchronized
// Ensure a remote identity exists for this key. We may be learning about
// it for the first time.
[self saveRemoteIdentity:identityKey recipientId:recipientId protocolContext:transaction];
@ -449,8 +448,6 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
OWSAssert(direction != TSMessageDirectionUnknown);
OWSAssert(transaction);
@synchronized(self)
{
if ([[TSAccountManager localNumber] isEqualToString:recipientId]) {
ECKeyPair *_Nullable localIdentityKeyPair = [self identityKeyPair:transaction];
@ -481,7 +478,6 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
}
}
}
}
- (BOOL)isTrustedKey:(NSData *)identityKey forSendingToIdentity:(nullable OWSRecipientIdentity *)recipientIdentity
{
@ -577,14 +573,12 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
- (void)syncQueuedVerificationStates
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
@synchronized(self)
{
NSMutableArray<NSString *> *recipientIds = [NSMutableArray new];
[self.dbConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
[transaction enumerateKeysAndObjectsInCollection:OWSIdentityManager_QueuedVerificationStateSyncMessages
usingBlock:^(NSString *_Nonnull recipientId,
id _Nonnull object,
BOOL *_Nonnull stop) {
[transaction
enumerateKeysAndObjectsInCollection:OWSIdentityManager_QueuedVerificationStateSyncMessages
usingBlock:^(
NSString *_Nonnull recipientId, id _Nonnull object, BOOL *_Nonnull stop) {
[recipientIds addObject:recipientId];
}];
}];
@ -617,8 +611,8 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
recipientId);
continue;
}
OWSVerificationStateSyncMessage *message = [[OWSVerificationStateSyncMessage alloc]
initWithVerificationState:recipientIdentity.verificationState
OWSVerificationStateSyncMessage *message =
[[OWSVerificationStateSyncMessage alloc] initWithVerificationState:recipientIdentity.verificationState
identityKey:identityKey
verificationForRecipientId:recipientIdentity.recipientId];
[messages addObject:message];
@ -628,7 +622,6 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
[self sendSyncVerificationStateMessage:message];
}
}
}
});
}

View File

@ -109,7 +109,6 @@ OWSSignalServiceProtosVerifiedState OWSVerificationStateToProtoState(OWSVerifica
[latest saveWithTransaction:transaction];
}
// TODO: Is this method obsolete?
- (void)updateWithChangeBlock:(void (^)(OWSRecipientIdentity *obj))changeBlock
{
changeBlock(self);

View File

@ -33,7 +33,6 @@ NSString *const kSessionStoreDBConnectionKey = @"kSessionStoreDBConnectionKey";
return sessionStoreDBConnection;
}
// TODO: Audit usage of this connection.
- (YapDatabaseConnection *)sessionStoreDBConnection
{
return [[self class] sessionStoreDBConnection];