From 8058951b08a9fb0c610c56bdb50c403132da2089 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Tue, 14 Jun 2016 12:19:19 -0700 Subject: [PATCH] Adapt to updated SocketRocket pod refactorings. (#11) While trying to pull in upstream changes to our fork of SocketRocket I noticed we're publishing it/installing it from CocoaPods trunk, but there's no need to do that. Also, due to upstream refactoring, the actual included file has changed. // FREEBIE --- Example/TSKitiOSTestApp/Podfile | 2 ++ Example/TSKitiOSTestApp/Podfile.lock | 19 ++++++++++++++----- SignalServiceKit.podspec | 5 ++++- src/Network/WebSockets/TSSocketManager.m | 2 +- src/Security/AFSecurityOWSPolicy.h | 4 ++-- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/Example/TSKitiOSTestApp/Podfile b/Example/TSKitiOSTestApp/Podfile index 84c4b10eb..e5d403d71 100644 --- a/Example/TSKitiOSTestApp/Podfile +++ b/Example/TSKitiOSTestApp/Podfile @@ -3,8 +3,10 @@ source 'https://github.com/CocoaPods/Specs.git' target 'TSKitiOSTestApp' do pod 'SignalServiceKit', :path => '../../SignalServiceKit.podspec' + pod 'SocketRocket', git: 'https://github.com/WhisperSystems/SocketRocket.git', branch: 'signal-ios' target 'TSKitiOSTestAppTests' do inherit! :search_paths end end + diff --git a/Example/TSKitiOSTestApp/Podfile.lock b/Example/TSKitiOSTestApp/Podfile.lock index 991b96f88..dfc8c5a0f 100644 --- a/Example/TSKitiOSTestApp/Podfile.lock +++ b/Example/TSKitiOSTestApp/Podfile.lock @@ -41,11 +41,11 @@ PODS: - CocoaLumberjack - libPhoneNumber-iOS - Mantle - - SocketRocket-PinningPolicy + - SocketRocket - SSKeychain - TwistedOakCollapsingFutures - YapDatabase/SQLCipher - - SocketRocket-PinningPolicy (0.4.3) + - SocketRocket (0.5.1) - SQLCipher/common (3.4.0) - SQLCipher/fts (3.4.0): - SQLCipher/common @@ -105,10 +105,19 @@ PODS: DEPENDENCIES: - SignalServiceKit (from `../../SignalServiceKit.podspec`) + - SocketRocket (from `https://github.com/WhisperSystems/SocketRocket.git`, branch `signal-ios`) EXTERNAL SOURCES: SignalServiceKit: :path: "../../SignalServiceKit.podspec" + SocketRocket: + :branch: signal-ios + :git: https://github.com/WhisperSystems/SocketRocket.git + +CHECKOUT OPTIONS: + SocketRocket: + :commit: 587ad297eb63eb0d64d4caeb32a7da646ad1132b + :git: https://github.com/WhisperSystems/SocketRocket.git SPEC CHECKSUMS: '25519': dc4bad7e2dbcbf1efa121068a705a44cd98c80fc @@ -120,14 +129,14 @@ SPEC CHECKSUMS: Mantle: bc40bb061d8c2c6fb48d5083e04d928c3b7f73d9 ProtocolBuffers: d088180c10072b3d24a9939a6314b7b9bcc2340b Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 - SignalServiceKit: db7e03dbb7870f77dfa2743eb0e4926dab59d792 - SocketRocket-PinningPolicy: f2ef00c3927bac05cd04d9d5171f82d922b40d3d + SignalServiceKit: e27a3025c2d5c61696386e44a50ac8d2fe83151e + SocketRocket: 3f77ec2104cc113add553f817ad90a77114f5d43 SQLCipher: 4c768761421736a247ed6cf412d9045615d53dff SSKeychain: c71293fa57216a40ab06c23f4085387583293de4 TwistedOakCollapsingFutures: f359b90f203e9ab13dfb92c9ff41842a7fe1cd0c UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d YapDatabase: c00f4197bba2fea17bdbd82c8e8e3f7104b6fa67 -PODFILE CHECKSUM: 913b3be9a409f864e7b2de3a8bb57d95da3b7358 +PODFILE CHECKSUM: 6bebc6fc58d19a6a56c27878035f7a074da10006 COCOAPODS: 1.0.1 diff --git a/SignalServiceKit.podspec b/SignalServiceKit.podspec index a71d95908..29461f44f 100644 --- a/SignalServiceKit.podspec +++ b/SignalServiceKit.podspec @@ -37,7 +37,10 @@ An Objective-C library for communicating with the Signal messaging service. s.dependency 'AxolotlKit' s.dependency 'Mantle' s.dependency 'YapDatabase/SQLCipher' - s.dependency 'SocketRocket-PinningPolicy' + # NOTE: we're using a custom fork of SocketRocket to support our certificate + # pinning policy. + # see Example/TSKitiOSTestApp/Podfile for details + s.dependency 'SocketRocket' s.dependency 'libPhoneNumber-iOS' s.dependency 'SSKeychain' s.dependency 'TwistedOakCollapsingFutures' diff --git a/src/Network/WebSockets/TSSocketManager.m b/src/Network/WebSockets/TSSocketManager.m index 4bc4c6cb8..e581fa401 100644 --- a/src/Network/WebSockets/TSSocketManager.m +++ b/src/Network/WebSockets/TSSocketManager.m @@ -100,7 +100,7 @@ NSString *const SocketConnectingNotification = @"SocketConnectingNotification"; [textSecureWebSocketAPI stringByAppendingString:[[self sharedManager] webSocketAuthenticationString]]; NSURL *webSocketConnectURL = [NSURL URLWithString:webSocketConnect]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:webSocketConnectURL]; - request.securityPolicy = [AFSecurityOWSPolicy OWS_PinningPolicy]; + request.SR_securityPolicy = [AFSecurityOWSPolicy OWS_PinningPolicy]; socket = [[SRWebSocket alloc] initWithURLRequest:request]; socket.delegate = [self sharedManager]; diff --git a/src/Security/AFSecurityOWSPolicy.h b/src/Security/AFSecurityOWSPolicy.h index 96bbcc782..555535cdb 100644 --- a/src/Security/AFSecurityOWSPolicy.h +++ b/src/Security/AFSecurityOWSPolicy.h @@ -6,10 +6,10 @@ // Copyright © 2015 Open Whisper Systems. All rights reserved. // -#import +#import #import "AFSecurityPolicy.h" -@interface AFSecurityOWSPolicy : AFSecurityPolicy +@interface AFSecurityOWSPolicy : AFSecurityPolicy + (instancetype)OWS_PinningPolicy;