diff --git a/Signal/src/textsecure/Contacts/TSRecipient.h b/Signal/src/textsecure/Contacts/TSRecipient.h index 88a8d2c78..046315712 100644 --- a/Signal/src/textsecure/Contacts/TSRecipient.h +++ b/Signal/src/textsecure/Contacts/TSRecipient.h @@ -20,12 +20,6 @@ - (void)removeDevices:(NSSet *)set; -#pragma mark Fingerprint verification - -- (BOOL)hasVerifiedFingerprint; - -- (void)setFingerPrintVerified:(BOOL)verified transaction:(YapDatabaseReadTransaction*)transaction; - @property (nonatomic, readonly) NSString *relay; @end diff --git a/Signal/src/textsecure/Contacts/TSRecipient.m b/Signal/src/textsecure/Contacts/TSRecipient.m index 79871328e..60ccb4388 100644 --- a/Signal/src/textsecure/Contacts/TSRecipient.m +++ b/Signal/src/textsecure/Contacts/TSRecipient.m @@ -12,7 +12,6 @@ @interface TSRecipient () @property (nonatomic, retain) NSMutableSet *devices; -@property (nonatomic, copy) NSData *verifiedKey; @end @@ -27,7 +26,6 @@ if (self) { _devices = [NSMutableSet setWithObject:[NSNumber numberWithInt:1]]; - _verifiedKey = nil; _relay = relay; } @@ -50,31 +48,4 @@ [_devices minusSet:set]; } -#pragma mark Fingerprint verification - -- (BOOL)hasVerifiedFingerprint{ - if (self.verifiedKey) { - BOOL equalsStoredValue = [self.verifiedKey isEqualToData:[[TSStorageManager sharedManager] identityKeyForRecipientId:self.uniqueId]]; - - if (equalsStoredValue) { - return YES; - } else{ - self.verifiedKey = nil; - return NO; - } - - } else{ - return NO; - } -} - -- (void)setFingerPrintVerified:(BOOL)verified transaction:(YapDatabaseReadTransaction*)transaction{ - if (verified) { - self.verifiedKey = [[TSStorageManager sharedManager] identityKeyForRecipientId:self.uniqueId]; - } else{ - self.verifiedKey = nil; - } -} - - @end diff --git a/Signal/src/textsecure/Messages/TSMessagesManager.m b/Signal/src/textsecure/Messages/TSMessagesManager.m index 5a213fb4a..504123b0f 100644 --- a/Signal/src/textsecure/Messages/TSMessagesManager.m +++ b/Signal/src/textsecure/Messages/TSMessagesManager.m @@ -301,7 +301,7 @@ TSContactThread *cThread = [TSContactThread getOrCreateThreadWithContactId:message.source transaction:transaction pushSignal:message]; - [cThread saveWithTransaction:transaction]; + incomingMessage = [[TSIncomingMessage alloc] initWithTimestamp:timeStamp inThread:cThread messageBody:body diff --git a/Signal/src/textsecure/Network/API/TSNetworkManager.m b/Signal/src/textsecure/Network/API/TSNetworkManager.m index e74e858a2..cb7f1c169 100644 --- a/Signal/src/textsecure/Network/API/TSNetworkManager.m +++ b/Signal/src/textsecure/Network/API/TSNetworkManager.m @@ -40,8 +40,8 @@ self.operationManager = [[AFHTTPSessionManager alloc] initWithBaseURL:[[NSURL alloc] initWithString:textSecureServerURL] sessionConfiguration:sessionConf]; AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate]; policy.allowInvalidCertificates = YES; - policy.validatesDomainName = NO; - policy.validatesCertificateChain = NO; + policy.allowInvalidCertificates = YES; //The certificate is not signed by a CA in the iOS trust store. + policy.validatesCertificateChain = NO; //Looking at AFNetworking's implementation of chain checking, we don't need to pin all certs in chain. https://github.com/AFNetworking/AFNetworking/blob/104ce04105098466ea0ea4e337af554d7b9df195/AFNetworking/AFSecurityPolicy.m#L281 Trust to the trusted cert is already vertified before by AFServerTrustIsValid(); NSString *certPath = [NSBundle.mainBundle pathForResource:@"textsecure" ofType:@"cer"]; NSData *certData = [NSData dataWithContentsOfFile:certPath]; SecCertificateRef cert = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData));