Respond to CR.

pull/1/head
Matthew Chen 6 years ago
parent c0f4254599
commit bb5c9ff106

@ -7,6 +7,15 @@ NS_ASSUME_NONNULL_BEGIN
@class ECKeyPair;
@class OWSAES256Key;
@interface RemoteAttestationAuth : NSObject
@property (nonatomic, readonly) NSString *username;
@property (nonatomic, readonly) NSString *password;
@end
#pragma mark -
@interface RemoteAttestationKeys : NSObject
@property (nonatomic, readonly) ECKeyPair *keyPair;
@ -18,17 +27,20 @@ NS_ASSUME_NONNULL_BEGIN
@end
#pragma mark -
@interface RemoteAttestation : NSObject
@property (nonatomic, readonly) RemoteAttestationKeys *keys;
@property (nonatomic, readonly) NSArray<NSHTTPCookie *> *cookies;
@property (nonatomic, readonly) NSData *requestId;
@property (nonatomic, readonly) NSString *enclaveId;
@property (nonatomic, readonly) NSString *authUsername;
@property (nonatomic, readonly) NSString *authToken;
@property (nonatomic, readonly) RemoteAttestationAuth *auth;
@end
#pragma mark -
@interface ContactDiscoveryService : NSObject
- (instancetype)init NS_UNAVAILABLE;

@ -16,7 +16,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface RemoteAttestationAuth : NSObject
@interface RemoteAttestationAuth ()
@property (nonatomic) NSString *username;
@property (nonatomic) NSString *password;
@ -152,16 +152,6 @@ NS_ASSUME_NONNULL_BEGIN
@implementation RemoteAttestation
- (NSString *)authUsername
{
return self.auth.username;
}
- (NSString *)authToken
{
return self.auth.password;
}
@end
#pragma mark -

@ -7,9 +7,6 @@ import Foundation
@objc(OWSLegacyContactDiscoveryOperation)
class LegacyContactDiscoveryBatchOperation: OWSOperation {
// TODO: Remove this feature flag.
private let isCDSEnabled = true
@objc
var registeredRecipientIds: Set<String>
@ -86,9 +83,6 @@ class LegacyContactDiscoveryBatchOperation: OWSOperation {
// Called at most one time.
override func didSucceed() {
guard isCDSEnabled else {
return
}
// Compare against new CDS service
let modernCDSOperation = CDSOperation(recipientIdsToLookup: self.recipientIdsToLookup)
let cdsFeedbackOperation = CDSFeedbackOperation(legacyRegisteredRecipientIds: self.registeredRecipientIds)
@ -271,8 +265,8 @@ class CDSBatchOperation: OWSOperation {
cryptIv: encryptionResult.initializationVector,
cryptMac: encryptionResult.authTag,
enclaveId: remoteAttestation.enclaveId,
authUsername: remoteAttestation.authUsername,
authPassword: remoteAttestation.authToken,
authUsername: remoteAttestation.auth.username,
authPassword: remoteAttestation.auth.password,
cookies: remoteAttestation.cookies)
self.networkManager.makeRequest(request,

@ -328,6 +328,7 @@ NS_ASSUME_NONNULL_BEGIN
// these cookies are ephemeral.
[request setHTTPShouldHandleCookies:NO];
// Set the cookie header.
OWSAssertDebug(request.allHTTPHeaderFields.count == 0);
[request setAllHTTPHeaderFields:[NSHTTPCookie requestHeaderFieldsWithCookies:cookies]];
return request;

Loading…
Cancel
Save