From b00858921df4ad5ec0b3a0cc167b090bc9986051 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 29 Aug 2018 16:26:08 -0400 Subject: [PATCH] Update Cocoapods. --- SignalServiceKit/src/Util/NSData+OWS.h | 7 ++----- SignalServiceKit/src/Util/NSData+OWS.m | 19 ------------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/SignalServiceKit/src/Util/NSData+OWS.h b/SignalServiceKit/src/Util/NSData+OWS.h index 50ec714e0..afaa79d60 100644 --- a/SignalServiceKit/src/Util/NSData+OWS.h +++ b/SignalServiceKit/src/Util/NSData+OWS.h @@ -2,15 +2,12 @@ // Copyright (c) 2018 Open Whisper Systems. All rights reserved. // +#import + NS_ASSUME_NONNULL_BEGIN @interface NSData (OWS) -/** - * Compares data in constant time so as to help avoid potential timing attacks. - */ -- (BOOL)ows_constantTimeIsEqualToData:(NSData *)other; - - (NSData *)dataByAppendingData:(NSData *)data; - (NSString *)hexadecimalString; diff --git a/SignalServiceKit/src/Util/NSData+OWS.m b/SignalServiceKit/src/Util/NSData+OWS.m index 2a44da3a8..fab0c02e1 100644 --- a/SignalServiceKit/src/Util/NSData+OWS.m +++ b/SignalServiceKit/src/Util/NSData+OWS.m @@ -8,25 +8,6 @@ NS_ASSUME_NONNULL_BEGIN @implementation NSData (OWS) -- (BOOL)ows_constantTimeIsEqualToData:(NSData *)other -{ - volatile UInt8 isEqual = 0; - - if (self.length != other.length) { - return NO; - } - - UInt8 *leftBytes = (UInt8 *)self.bytes; - UInt8 *rightBytes = (UInt8 *)other.bytes; - for (int i = 0; i < self.length; i++) { - // rather than returning as soon as we find a discrepency, we compare the rest of - // the byte stream to maintain a constant time comparison - isEqual |= leftBytes[i] ^ rightBytes[i]; - } - - return isEqual == 0; -} - - (NSData *)dataByAppendingData:(NSData *)data { NSMutableData *result = [self mutableCopy];