From 5b87af9bc6a32120063a98570f35b5571e28038f Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 4 Jan 2017 09:42:48 -0500 Subject: [PATCH] Respond to CR, fix build break. // FREEBIE --- src/Network/OWSCensorshipConfiguration.m | 16 ++++++++++++---- src/Network/OWSSignalService.m | 4 +++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/Network/OWSCensorshipConfiguration.m b/src/Network/OWSCensorshipConfiguration.m index bce6e7466..e09096a06 100644 --- a/src/Network/OWSCensorshipConfiguration.m +++ b/src/Network/OWSCensorshipConfiguration.m @@ -3,6 +3,7 @@ #import "OWSCensorshipConfiguration.h" #import "TSStorageManager.h" +#import "Asserts.h" NS_ASSUME_NONNULL_BEGIN @@ -15,7 +16,7 @@ NSString *const OWSCensorshipConfigurationReflectorHost = @"signal-reflector-mee OWSAssert(e164PhonNumber.length > 0); NSString *domain = nil; - for (NSString *countryCode in self.censoredCountryCodes.allKeys) { + for (NSString *countryCode in self.censoredCountryCodes) { if ([e164PhonNumber hasPrefix:countryCode]) { domain = self.censoredCountryCodes[countryCode]; } @@ -38,10 +39,17 @@ NSString *const OWSCensorshipConfigurationReflectorHost = @"signal-reflector-mee - (NSDictionary *)censoredCountryCodes { - // Domain fronting should be used for the following countries. + // The set of countries for which domain fronting should be used. // - // For each country, we should the appropriate google domain, + // For each country, we should add the appropriate google domain, // per: https://en.wikipedia.org/wiki/List_of_Google_domains + // + // If we ever use any non-google domains for domain fronting, + // remember to: + // + // a) Add the appropriate pinning certificate(s) in + // SignalServiceKit.podspec. + // b) Update reflectorHost accordingly. return @{ // Egypt @"+20": @"google.com.eg", @@ -60,7 +68,7 @@ NSString *const OWSCensorshipConfigurationReflectorHost = @"signal-reflector-mee - (BOOL)isCensoredPhoneNumber:(NSString *)e164PhonNumber { - for (NSString *countryCode in self.censoredCountryCodes.allKeys) { + for (NSString *countryCode in self.censoredCountryCodes) { if ([e164PhonNumber hasPrefix:countryCode]) { return YES; } diff --git a/src/Network/OWSSignalService.m b/src/Network/OWSSignalService.m index d4dd8b995..f6067ba16 100644 --- a/src/Network/OWSSignalService.m +++ b/src/Network/OWSSignalService.m @@ -1,12 +1,14 @@ // Created by Michael Kirk on 12/20/16. // Copyright © 2016 Open Whisper Systems. All rights reserved. +#import + #import "OWSSignalService.h" #import "OWSCensorshipConfiguration.h" #import "OWSHTTPSecurityPolicy.h" #import "TSConstants.h" #import "TSAccountManager.h" -#import +#import "Asserts.h" NS_ASSUME_NONNULL_BEGIN