diff --git a/Podfile.lock b/Podfile.lock index d330fff9d..ebfeb48fc 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -83,7 +83,7 @@ EXTERNAL SOURCES: CHECKOUT OPTIONS: JSQMessagesViewController: - :commit: 7c2cec63f9e05ac7859df786e6ca31af2f0dc583 + :commit: 82482a1fc560fb4f716babbe49a20cf9c0bc7fc3 :git: https://github.com/dtsbourg/JSQMessagesViewController SocketRocket: :commit: d0585af165 diff --git a/Pods b/Pods index bc9ebd5dc..0b6f683fb 160000 --- a/Pods +++ b/Pods @@ -1 +1 @@ -Subproject commit bc9ebd5dc7fb4100c78e5bb4dda15cfcc3b6734a +Subproject commit 0b6f683fbd2c3947a73ddb619ca4fe5ef4e6edcd diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index a31ae1456..d4372c944 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -392,6 +392,8 @@ B6B096951A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096601A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.m */; }; B6B1013C196D213F007E3930 /* SignalKeyingStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B1013B196D213F007E3930 /* SignalKeyingStorage.m */; }; B6B9ECFC198B31BA00C620D3 /* PushManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B9ECFB198B31BA00C620D3 /* PushManager.m */; }; + B6C6AE551A305ED1006BAF8F /* redphone.cer in Resources */ = {isa = PBXBuildFile; fileRef = B6C6AE531A305ED1006BAF8F /* redphone.cer */; }; + B6C6AE561A305ED1006BAF8F /* textsecure.cer in Resources */ = {isa = PBXBuildFile; fileRef = B6C6AE541A305ED1006BAF8F /* textsecure.cer */; }; B6C93C4E199567AD00EDF894 /* DebugLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = B6C93C4D199567AD00EDF894 /* DebugLogger.m */; }; B6CBF53F1A254BD1000D4184 /* ContactDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B6CBF53E1A254BD1000D4184 /* ContactDetailCell.m */; }; B90418E6183E9DD40038554A /* DateUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B90418E5183E9DD40038554A /* DateUtil.m */; }; @@ -444,7 +446,6 @@ E1370BF018A0689000826894 /* AppIcon60x60@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E18AB3FA18A05734001A532A /* AppIcon60x60@2x.png */; }; E1370BF118A0689000826894 /* AppIcon76x76.png in Resources */ = {isa = PBXBuildFile; fileRef = E18AB3FB18A05734001A532A /* AppIcon76x76.png */; }; E1370BF218A0689000826894 /* AppIcon76x76@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E18AB3FC18A05734001A532A /* AppIcon76x76@2x.png */; }; - E1370BF618A068A600826894 /* whisperReal.cer in Resources */ = {isa = PBXBuildFile; fileRef = E1C407C117F0C246007BEE65 /* whisperReal.cer */; }; E14874F818A06951002CC4F3 /* ContactTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB053A18170B33006006FC /* ContactTableViewCell.xib */; }; E14874F918A06951002CC4F3 /* CountryCodeTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B97CBFB018861023008E0DE9 /* CountryCodeTableViewCell.xib */; }; E148750018A06966002CC4F3 /* CallAudioManagerDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB051D18170B33006006FC /* CallAudioManagerDemo.xib */; }; @@ -1040,6 +1041,8 @@ B6B1013B196D213F007E3930 /* SignalKeyingStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignalKeyingStorage.m; sourceTree = ""; }; B6B9ECFA198B31BA00C620D3 /* PushManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PushManager.h; sourceTree = ""; }; B6B9ECFB198B31BA00C620D3 /* PushManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PushManager.m; sourceTree = ""; }; + B6C6AE531A305ED1006BAF8F /* redphone.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = redphone.cer; sourceTree = ""; }; + B6C6AE541A305ED1006BAF8F /* textsecure.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = textsecure.cer; sourceTree = ""; }; B6C93C4C199567AD00EDF894 /* DebugLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugLogger.h; sourceTree = ""; }; B6C93C4D199567AD00EDF894 /* DebugLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DebugLogger.m; sourceTree = ""; }; B6CBF53D1A254BD1000D4184 /* ContactDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ContactDetailCell.h; path = "Signal/src/view controllers/ContactDetailCell.h"; sourceTree = SOURCE_ROOT; }; @@ -1145,7 +1148,6 @@ E197B62618BBF63B00F073E5 /* SoundBoard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SoundBoard.m; sourceTree = ""; }; E1A0AD8B16E13FDD0071E604 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; E1B3DC731885EFA100B7F794 /* NotificationManifest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NotificationManifest.h; sourceTree = ""; }; - E1C407C117F0C246007BEE65 /* whisperReal.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = whisperReal.cer; sourceTree = ""; }; E1CD329418BCFF9900B1A496 /* SoundInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoundInstance.h; sourceTree = ""; }; E1CD329518BCFF9900B1A496 /* SoundInstance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SoundInstance.m; sourceTree = ""; }; FC15B7BE1A1F80F200F59801 /* defaultConctact_light@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "defaultConctact_light@2x.png"; sourceTree = ""; }; @@ -2403,6 +2405,15 @@ name = Translations; sourceTree = ""; }; + B6C6AE521A305ED1006BAF8F /* Certificates */ = { + isa = PBXGroup; + children = ( + B6C6AE531A305ED1006BAF8F /* redphone.cer */, + B6C6AE541A305ED1006BAF8F /* textsecure.cer */, + ); + path = Certificates; + sourceTree = ""; + }; BF8C3D8119CE3B6A008F644C /* call */ = { isa = PBXGroup; children = ( @@ -2478,6 +2489,7 @@ D221A094169C9E5E00537ABF /* Supporting Files */ = { isa = PBXGroup; children = ( + B6C6AE521A305ED1006BAF8F /* Certificates */, B6B6C3C419193F5B00C0B76B /* Translations */, E18AB40618A05754001A532A /* AudioFiles */, E18AB3F318A05734001A532A /* Icons */, @@ -2486,7 +2498,6 @@ D221A095169C9E5E00537ABF /* Signal-Info.plist */, D221A09B169C9E5E00537ABF /* Signal-Prefix.pch */, B661C211198EE2EA00548CA1 /* iOSVersions.h */, - E1C407C117F0C246007BEE65 /* whisperReal.cer */, ); name = "Supporting Files"; sourceTree = ""; @@ -2717,6 +2728,7 @@ ORGANIZATIONNAME = "Open Whisper Systems"; TargetAttributes = { D221A088169C9E5E00537ABF = { + DevelopmentTeam = U68MSDN6DR; SystemCapabilities = { com.apple.DataProtection = { enabled = 1; @@ -2846,6 +2858,7 @@ B633C59D1A1D190B0059AC12 /* endcall@2x.png in Resources */, B633C5B41A1D190B0059AC12 /* keypad@2x.png in Resources */, B633C5DA1A1D190B0059AC12 /* settings_dark@2x.png in Resources */, + B6C6AE561A305ED1006BAF8F /* textsecure.cer in Resources */, FCA52AEC1A2B676C00CCADFA /* message_error@2x.png in Resources */, E14874F818A06951002CC4F3 /* ContactTableViewCell.xib in Resources */, B633C5BC1A1D190B0059AC12 /* message_bubble@2x.png in Resources */, @@ -2892,6 +2905,7 @@ B67EBF5D19194AC60084CCFD /* Settings.bundle in Resources */, E1370BE418A0686C00826894 /* outring.mp3 in Resources */, B633C5841A1D190B0059AC12 /* backspace@2x.png in Resources */, + B6C6AE551A305ED1006BAF8F /* redphone.cer in Resources */, B633C5B71A1D190B0059AC12 /* logo_intro@2x.png in Resources */, E1370BE518A0686C00826894 /* r.caf in Resources */, B633C5981A1D190B0059AC12 /* delete_history@2x.png in Resources */, @@ -2906,7 +2920,6 @@ E148751418A06AFD002CC4F3 /* HelveticaNeueLTStd-Lt.otf in Resources */, E148751518A06AFD002CC4F3 /* HelveticaNeueLTStd-Md.otf in Resources */, FC3BD97B1A2CD385005B96BB /* call_dotted@2x.png in Resources */, - E1370BF618A068A600826894 /* whisperReal.cer in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Signal/whisperReal.cer b/Signal/Certificates/redphone.cer similarity index 100% rename from Signal/whisperReal.cer rename to Signal/Certificates/redphone.cer diff --git a/Signal/Certificates/textsecure.cer b/Signal/Certificates/textsecure.cer new file mode 100644 index 000000000..6ba998196 Binary files /dev/null and b/Signal/Certificates/textsecure.cer differ diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index 8fcaccf6c..d142bc5af 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -38,7 +38,7 @@ CFBundleVersion - 2.0 + 2.0.1 LOGS_EMAIL support@whispersystems.org LOGS_URL diff --git a/Signal/src/Storyboard/Storyboard.storyboard b/Signal/src/Storyboard/Storyboard.storyboard index 5b72e1ebf..fa2e1aac3 100755 --- a/Signal/src/Storyboard/Storyboard.storyboard +++ b/Signal/src/Storyboard/Storyboard.storyboard @@ -1,7 +1,7 @@ - + - + @@ -35,6 +35,9 @@ + + + @@ -2419,7 +2422,8 @@ Licensed under the GPLv3 - + + @@ -2571,7 +2575,8 @@ Licensed under the GPLv3 - + + @@ -2904,7 +2909,8 @@ Licensed under the GPLv3 - + + @@ -2958,6 +2964,9 @@ Licensed under the GPLv3 + + + @@ -3040,6 +3049,6 @@ Licensed under the GPLv3 - + diff --git a/Signal/src/environment/Release.m b/Signal/src/environment/Release.m index c47da7564..5875cee31 100644 --- a/Signal/src/environment/Release.m +++ b/Signal/src/environment/Release.m @@ -54,7 +54,7 @@ static unsigned char DH3K_PRIME[]={ andMasterServerHostName:@"master.whispersystems.org" andDefaultRelayName:@"relay" andRelayServerHostNameSuffix:@"whispersystems.org" - andCertificate:[Certificate certificateFromResourcePath:@"whisperReal" ofType:@"cer"] + andCertificate:[Certificate certificateFromResourcePath:@"redphone" ofType:@"cer"] andCurrentRegionCodeForPhoneNumbers:[(NSLocale*)NSLocale.currentLocale objectForKey:NSLocaleCountryCode] andSupportedKeyAgreementProtocols:[self supportedKeyAgreementProtocols] andPhoneManager:[PhoneManager phoneManagerWithErrorHandler:errorNoter] @@ -78,7 +78,7 @@ static unsigned char DH3K_PRIME[]={ andMasterServerHostName:@"master.whispersystems.org" andDefaultRelayName:@"relay" andRelayServerHostNameSuffix:@"whispersystems.org" - andCertificate:[Certificate certificateFromResourcePath:@"whisperReal" ofType:@"cer"] + andCertificate:[Certificate certificateFromResourcePath:@"redphone" ofType:@"cer"] andCurrentRegionCodeForPhoneNumbers:@"US" andSupportedKeyAgreementProtocols:keyAgreementProtocols andPhoneManager:nil diff --git a/Signal/src/network/http/RPServerRequestsManager.m b/Signal/src/network/http/RPServerRequestsManager.m index 9219e8320..61988fa6d 100644 --- a/Signal/src/network/http/RPServerRequestsManager.m +++ b/Signal/src/network/http/RPServerRequestsManager.m @@ -38,7 +38,7 @@ MacrosSingletonImplemention self.operationManager = [[AFHTTPSessionManager alloc] initWithBaseURL:endPointURL sessionConfiguration:sessionConf]; self.operationManager.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; self.operationManager.securityPolicy.allowInvalidCertificates = YES; - NSString *certPath = [NSBundle.mainBundle pathForResource:@"whisperReal" ofType:@"cer"]; + NSString *certPath = [NSBundle.mainBundle pathForResource:@"redphone" ofType:@"cer"]; NSData *certData = [NSData dataWithContentsOfFile:certPath]; SecCertificateRef cert = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData)); self.operationManager.securityPolicy.pinnedCertificates = @[(__bridge_transfer NSData *)SecCertificateCopyData(cert)]; diff --git a/Signal/src/textsecure/Network/API/TSNetworkManager.m b/Signal/src/textsecure/Network/API/TSNetworkManager.m index 4b01859b0..2773d5743 100644 --- a/Signal/src/textsecure/Network/API/TSNetworkManager.m +++ b/Signal/src/textsecure/Network/API/TSNetworkManager.m @@ -39,9 +39,9 @@ if (self = [super init]) { NSURLSessionConfiguration *sessionConf = NSURLSessionConfiguration.ephemeralSessionConfiguration; self.operationManager = [[AFHTTPSessionManager alloc] initWithBaseURL:[[NSURL alloc] initWithString:textSecureServerURL] sessionConfiguration:sessionConf]; - AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; //TODO: pinging cert + AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey]; policy.allowInvalidCertificates = YES; - NSString *certPath = [NSBundle.mainBundle pathForResource:@"whisperReal" ofType:@"cer"]; + NSString *certPath = [NSBundle.mainBundle pathForResource:@"textsecure" ofType:@"cer"]; NSData *certData = [NSData dataWithContentsOfFile:certPath]; SecCertificateRef cert = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData)); policy.pinnedCertificates = @[(__bridge_transfer NSData *)SecCertificateCopyData(cert)]; diff --git a/Signal/src/textsecure/Network/WebSockets/TSSocketManager.m b/Signal/src/textsecure/Network/WebSockets/TSSocketManager.m index 123c7bf65..86c0791d7 100644 --- a/Signal/src/textsecure/Network/WebSockets/TSSocketManager.m +++ b/Signal/src/textsecure/Network/WebSockets/TSSocketManager.m @@ -81,10 +81,19 @@ NSString * const SocketConnectingNotification = @"SocketConnectingNotification"; } } - NSString *webSocketConnect = [textSecureWebSocketAPI stringByAppendingString:[[self sharedManager] webSocketAuthenticationString]]; - NSURL *webSocketConnectURL = [NSURL URLWithString:webSocketConnect]; - socket = [[SRWebSocket alloc] initWithURL:webSocketConnectURL]; - socket.delegate = [self sharedManager]; + NSString* webSocketConnect = [textSecureWebSocketAPI stringByAppendingString:[[self sharedManager] webSocketAuthenticationString]]; + NSURL* webSocketConnectURL = [NSURL URLWithString:webSocketConnect]; + NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:webSocketConnectURL]; + NSString* cerPath = [[NSBundle mainBundle] pathForResource:@"textsecure" ofType:@"cer"]; + NSData* certData = [[NSData alloc] initWithContentsOfFile:cerPath]; + CFDataRef certDataRef = (__bridge CFDataRef)certData; + SecCertificateRef certRef = SecCertificateCreateWithData(NULL, certDataRef); + id certificate = (__bridge id)certRef; + [request setSR_SSLPinnedCertificates:@[ certificate ]]; + + socket = [[SRWebSocket alloc] initWithURLRequest:request]; + socket.delegate = [self sharedManager]; + [socket open]; [[self sharedManager] setWebsocket:socket]; } diff --git a/Signal/src/textsecure/Util/NSData+Base64.h b/Signal/src/textsecure/Util/NSData+Base64.h index 7fc864bd7..c3e88dd20 100644 --- a/Signal/src/textsecure/Util/NSData+Base64.h +++ b/Signal/src/textsecure/Util/NSData+Base64.h @@ -2,8 +2,9 @@ @interface NSData (Base64) -+ (NSData *)dataFromBase64String:(NSString *)aString; ++ (NSData*)dataFromBase64StringNoPadding:(NSString*)aString; ++ (NSData*)dataFromBase64String:(NSString*)aString; -- (NSString *)base64EncodedString; +- (NSString*)base64EncodedString; @end diff --git a/Signal/src/textsecure/Util/NSData+Base64.m b/Signal/src/textsecure/Util/NSData+Base64.m index 76a2ab329..76be4c066 100644 --- a/Signal/src/textsecure/Util/NSData+Base64.m +++ b/Signal/src/textsecure/Util/NSData+Base64.m @@ -4,6 +4,19 @@ @implementation NSData (Base64) ++ (NSData*)dataFromBase64StringNoPadding:(NSString*)aString{ + int padding = aString.length%4; + + NSMutableString *strResult = [aString mutableCopy]; + if (padding != 0) { + int charsToAdd = 4 - padding; + for (int i = 0; i < charsToAdd; i++) { + [strResult appendString:@"="]; + } + } + return [self dataFromBase64String:strResult]; +} + // // dataFromBase64String: // @@ -15,18 +28,9 @@ // // returns the NSData representation of the base64 string // + + (NSData *)dataFromBase64String:(NSString *)aString { - int padding = aString.length%4; - - NSMutableString *strResult = [aString mutableCopy]; - if (padding != 0) { - int charsToAdd = 4 - padding; - for (int i = 0; i < charsToAdd; i++) { - [strResult appendString:@"="]; - } - } - - return [[NSData alloc] initWithBase64EncodedString:strResult options:NSDataBase64DecodingIgnoreUnknownCharacters]; + return [[NSData alloc] initWithBase64EncodedString:aString options:NSDataBase64DecodingIgnoreUnknownCharacters]; } // diff --git a/Signal/src/util/protocols/PreKeyBundle+jsonDict.m b/Signal/src/util/protocols/PreKeyBundle+jsonDict.m index c79234839..554d01060 100644 --- a/Signal/src/util/protocols/PreKeyBundle+jsonDict.m +++ b/Signal/src/util/protocols/PreKeyBundle+jsonDict.m @@ -22,7 +22,7 @@ return nil; } - NSData *identityKey = [NSData dataFromBase64String:identityKeyString]; + NSData *identityKey = [NSData dataFromBase64StringNoPadding:identityKeyString]; for (NSDictionary *deviceDict in devicesArray) { NSNumber *registrationIdString = [deviceDict objectForKey:@"registrationId"]; @@ -50,7 +50,7 @@ } else{ prekeyId = [[preKey objectForKey:@"keyId"] intValue]; NSString *preKeyPublicString = [preKey objectForKey:@"publicKey"]; - preKeyPublic = [NSData dataFromBase64String:preKeyPublicString]; + preKeyPublic = [NSData dataFromBase64StringNoPadding:preKeyPublicString]; } NSDictionary *signedPrekey = [deviceDict objectForKey:@"signedPreKey"]; @@ -71,8 +71,8 @@ return nil; } - NSData *signedPrekeyPublic = [NSData dataFromBase64String:signedPublicKeyString]; - NSData *signedPreKeySignature = [NSData dataFromBase64String:signedSignatureString]; + NSData *signedPrekeyPublic = [NSData dataFromBase64StringNoPadding:signedPublicKeyString]; + NSData *signedPreKeySignature = [NSData dataFromBase64StringNoPadding:signedSignatureString]; if (!(signedPrekeyPublic && signedPreKeySignature)) { DDLogError(@"Failed to parse signed keying material"); diff --git a/Signal/src/view controllers/MessagesViewController.m b/Signal/src/view controllers/MessagesViewController.m index 5021d4647..75420f991 100644 --- a/Signal/src/view controllers/MessagesViewController.m +++ b/Signal/src/view controllers/MessagesViewController.m @@ -93,12 +93,6 @@ typedef enum : NSUInteger { self.senderId = ME_MESSAGE_IDENTIFIER self.senderDisplayName = ME_MESSAGE_IDENTIFIER - - if (!isGroupConversation) - { - [self initializeObservers]; - } - } - (void)didPressBack{ @@ -112,12 +106,6 @@ typedef enum : NSUInteger { [super didReceiveMemoryWarning]; } --(void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; -} - #pragma mark - Initiliazers -(void)initializeNavigationBar @@ -164,31 +152,6 @@ typedef enum : NSUInteger { } --(void)initializeObservers -{ - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillHide:) - name:UIKeyboardWillHideNotification - object:nil]; - -} - -#pragma mark - Keyboard Handlers - --(void)keyboardWillShow:(id)sender -{ - [self.inputToolbar.contentView setRightBarButtonItem:[JSQMessagesToolbarButtonFactory defaultSendButtonItem]]; -} - --(void)keyboardWillHide:(id)sender -{ - [self.inputToolbar.contentView setRightBarButtonItem:[JSQMessagesToolbarButtonFactory signalCallButtonItem]]; -} - #pragma mark - Fingerprints -(void)showFingerprint @@ -236,11 +199,7 @@ typedef enum : NSUInteger { senderDisplayName:(NSString *)senderDisplayName date:(NSDate *)date { - if ([button.titleLabel.text isEqualToString:@"Call"]) - { - NSLog(@"Let's call !"); - - } else if (text.length > 0) { + if (text.length > 0) { [JSQSystemSoundPlayer jsq_playMessageSentSound]; TSOutgoingMessage *message = [[TSOutgoingMessage alloc] initWithTimestamp:[NSDate ows_millisecondTimeStamp] inThread:self.thread messageBody:text attachements:nil]; diff --git a/Signal/test/network/tcp/tls/NetworkStreamTest.m b/Signal/test/network/tcp/tls/NetworkStreamTest.m index c38278142..c3cbc7987 100644 --- a/Signal/test/network/tcp/tls/NetworkStreamTest.m +++ b/Signal/test/network/tcp/tls/NetworkStreamTest.m @@ -8,7 +8,7 @@ #define TEST_SERVER_HOST @"master.whispersystems.org" #define TEST_SERVER_PORT 31337 -#define TEST_SERVER_CERT_PATH @"whisperReal" +#define TEST_SERVER_CERT_PATH @"redphone" #define TEST_SERVER_CERT_TYPE @"cer" #define TEST_SERVER_INCORRECT_HOST_TO_SAME_IP @"96.126.120.52" diff --git a/Signal/test/network/tcp/tls/SecureEndPointTest.m b/Signal/test/network/tcp/tls/SecureEndPointTest.m index 2ee355515..d2ff67fd9 100644 --- a/Signal/test/network/tcp/tls/SecureEndPointTest.m +++ b/Signal/test/network/tcp/tls/SecureEndPointTest.m @@ -10,7 +10,7 @@ @implementation SecureEndPointTest -(void) testCert { - Certificate* r = [Certificate certificateFromResourcePath:@"whisperReal" + Certificate* r = [Certificate certificateFromResourcePath:@"redphone" ofType:@"cer"]; test(r != nil); } diff --git a/Signal/test/textsecure/TSMessageStorageTests.m b/Signal/test/textsecure/TSMessageStorageTests.m index 542aee3aa..554781b04 100644 --- a/Signal/test/textsecure/TSMessageStorageTests.m +++ b/Signal/test/textsecure/TSMessageStorageTests.m @@ -58,8 +58,9 @@ inThread:self.thread messageBody:body attachements:nil]; - [newMessage save]; - + [[TSStorageManager sharedManager].newDatabaseConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { + [newMessage saveWithTransaction:transaction]; + }]; TSIncomingMessage *fetchedMessage = [TSIncomingMessage fetchObjectWithUniqueID:[TSInteraction stringFromTimeStamp:timestamp]];