Skip to content

Commit

Permalink
Merge pull request #27 from Censio/bugfix/implicit-self-warnings
Browse files Browse the repository at this point in the history
Fix implicit self warnings
  • Loading branch information
rnapier authored May 22, 2018
2 parents c73a0aa + fdd1253 commit 40ddcae
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 11 deletions.
6 changes: 5 additions & 1 deletion RNCryptor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = RN;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = "Rob Napier";
TargetAttributes = {
1F3717521DDB9C5F009E537B = {
Expand Down Expand Up @@ -1193,8 +1193,10 @@
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
Expand Down Expand Up @@ -1235,8 +1237,10 @@
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions RNCryptor/RNDecryptor.m
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ - (void)decryptData:(NSData *)data
{
dispatch_async(self.queue, ^{
if (self.hasHMAC) {
CCHmacUpdate(&_HMACContext, data.bytes, data.length);
CCHmacUpdate(&self->_HMACContext, data.bytes, data.length);
}

NSError *error = nil;
Expand Down Expand Up @@ -309,7 +309,7 @@ - (void)finish

if (self.hasHMAC) {
NSMutableData *HMACData = [NSMutableData dataWithLength:self.HMACLength];
CCHmacFinal(&_HMACContext, [HMACData mutableBytes]);
CCHmacFinal(&self->_HMACContext, [HMACData mutableBytes]);

if (![HMACData rnc_isEqualInConsistentTime:self.inData]) {
[self cleanupAndNotifyWithError:[NSError errorWithDomain:kRNCryptorErrorDomain
Expand Down
8 changes: 4 additions & 4 deletions RNCryptor/RNEncryptor.m
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ - (void)addData:(NSData *)data
NSData *header = [self header];
[self.outData setData:header];
if (self.hasHMAC) {
CCHmacUpdate(&_HMACContext, [header bytes], [header length]);
CCHmacUpdate(&self->_HMACContext, [header bytes], [header length]);
}
self.haveWrittenHeader = YES;
}
Expand All @@ -210,7 +210,7 @@ - (void)addData:(NSData *)data
[self cleanupAndNotifyWithError:error];
}
if (self.hasHMAC) {
CCHmacUpdate(&_HMACContext, encryptedData.bytes, encryptedData.length);
CCHmacUpdate(&self->_HMACContext, encryptedData.bytes, encryptedData.length);
}

[self.outData appendData:encryptedData];
Expand All @@ -233,9 +233,9 @@ - (void)finish
NSData *encryptedData = [self.engine finishWithError:&error];
[self.outData appendData:encryptedData];
if (self.hasHMAC) {
CCHmacUpdate(&_HMACContext, encryptedData.bytes, encryptedData.length);
CCHmacUpdate(&self->_HMACContext, encryptedData.bytes, encryptedData.length);
NSMutableData *HMACData = [NSMutableData dataWithLength:self.HMACLength];
CCHmacFinal(&_HMACContext, [HMACData mutableBytes]);
CCHmacFinal(&self->_HMACContext, [HMACData mutableBytes]);
[self.outData appendData:HMACData];
}
[self cleanupAndNotifyWithError:error];
Expand Down

0 comments on commit 40ddcae

Please sign in to comment.