Compare commits

..

No commits in common. "5a70698f50dceb2f927ae683c2a15c8e855b7859" and "b10faf55e31caf4c9f1cbd402ccb2983674e9448" have entirely different histories.

16 changed files with 170 additions and 108 deletions

8
.gitmodules vendored
View File

@ -1,8 +1,4 @@
[submodule "submodules/Base64"] [submodule "xctool"]
path = submodules/Base64 path = xctool
url = https://github.com/nicklockwood/Base64.git
ignore = dirty
[submodule "submodules/xctool"]
path = submodules/xctool
url = https://github.com/facebook/xctool.git url = https://github.com/facebook/xctool.git
ignore = dirty ignore = dirty

View File

@ -1,6 +1,6 @@
language: objective-c language: objective-c
script: script:
- submodules/xctool/xctool.sh -project CocoaSecurity.xcodeproj -scheme CocoaSecurity -sdk iphonesimulator build - xctool/xctool.sh -project CocoaSecurity.xcodeproj -scheme CocoaSecurity -sdk iphonesimulator build
- submodules/xctool/xctool.sh -project CocoaSecurity.xcodeproj -scheme CocoaSecurity -sdk iphonesimulator test -test-sdk iphonesimulator7.0 # waiting for xcode 5
- submodules/xctool/xctool.sh -project CocoaSecurity.xcodeproj -scheme CocoaSecurity -sdk iphonesimulator test -test-sdk iphonesimulator7.1 # - xctool/xctool.sh -project CocoaSecurity.xcodeproj -scheme CocoaSecurity test -test-sdk iphonesimulator6.1

View File

@ -10,20 +10,18 @@
2113923B16EAD6AF00AFDF87 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2113923A16EAD6AF00AFDF87 /* Foundation.framework */; }; 2113923B16EAD6AF00AFDF87 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2113923A16EAD6AF00AFDF87 /* Foundation.framework */; };
2113924016EAD6AF00AFDF87 /* CocoaSecurity.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2113923F16EAD6AF00AFDF87 /* CocoaSecurity.h */; }; 2113924016EAD6AF00AFDF87 /* CocoaSecurity.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2113923F16EAD6AF00AFDF87 /* CocoaSecurity.h */; };
2113924216EAD6AF00AFDF87 /* CocoaSecurity.m in Sources */ = {isa = PBXBuildFile; fileRef = 2113924116EAD6AF00AFDF87 /* CocoaSecurity.m */; }; 2113924216EAD6AF00AFDF87 /* CocoaSecurity.m in Sources */ = {isa = PBXBuildFile; fileRef = 2113924116EAD6AF00AFDF87 /* CocoaSecurity.m */; };
215409ED183DD72F00E4C15B /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21BB8A2E17FEA0EC0032C38C /* XCTest.framework */; }; 2164336617FEB509006C71F4 /* CocoaSecurityDecoder_Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2164336517FEB509006C71F4 /* CocoaSecurityDecoder_Tests.m */; };
215409EE183DD72F00E4C15B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2113923A16EAD6AF00AFDF87 /* Foundation.framework */; }; 2164336817FEB8B0006C71F4 /* CocoaSecurityResult_Test.m in Sources */ = {isa = PBXBuildFile; fileRef = 2164336717FEB8B0006C71F4 /* CocoaSecurityResult_Test.m */; };
215409F5183DD72F00E4C15B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 215409F3183DD72F00E4C15B /* InfoPlist.strings */; }; 21BB8A2F17FEA0EC0032C38C /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21BB8A2E17FEA0EC0032C38C /* XCTest.framework */; };
21540A02183DD7F000E4C15B /* CocoaSecurity_Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 215409FE183DD7F000E4C15B /* CocoaSecurity_Tests.m */; }; 21BB8A3017FEA0EC0032C38C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2113923A16EAD6AF00AFDF87 /* Foundation.framework */; };
21540A03183DD7F000E4C15B /* CocoaSecurityDecoder_Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 215409FF183DD7F000E4C15B /* CocoaSecurityDecoder_Tests.m */; }; 21BB8A3717FEA0EC0032C38C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 21BB8A3517FEA0EC0032C38C /* InfoPlist.strings */; };
21540A04183DD7F000E4C15B /* CocoaSecurityEncoder_Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 21540A00183DD7F000E4C15B /* CocoaSecurityEncoder_Tests.m */; }; 21BB8A3917FEA0EC0032C38C /* CocoaSecurity_Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 21BB8A3817FEA0EC0032C38C /* CocoaSecurity_Tests.m */; };
21540A05183DD7F000E4C15B /* CocoaSecurityResult_Test.m in Sources */ = {isa = PBXBuildFile; fileRef = 21540A01183DD7F000E4C15B /* CocoaSecurityResult_Test.m */; }; 21BB8A4017FEA5190032C38C /* CocoaSecurity.m in Sources */ = {isa = PBXBuildFile; fileRef = 2113924116EAD6AF00AFDF87 /* CocoaSecurity.m */; };
21540A06183DD81A00E4C15B /* CocoaSecurity.m in Sources */ = {isa = PBXBuildFile; fileRef = 2113924116EAD6AF00AFDF87 /* CocoaSecurity.m */; }; 21BB8A4317FEB3ED0032C38C /* CocoaSecurityEncoder_Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 21BB8A4217FEB3ED0032C38C /* CocoaSecurityEncoder_Tests.m */; };
21FB346C189601A6002F38DE /* Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 21FB346B189601A6002F38DE /* Base64.m */; };
21FB346D18960347002F38DE /* Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 21FB346B189601A6002F38DE /* Base64.m */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
215409F9183DD72F00E4C15B /* PBXContainerItemProxy */ = { 21BB8A3B17FEA0EC0032C38C /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
containerPortal = 2113922F16EAD6AF00AFDF87 /* Project object */; containerPortal = 2113922F16EAD6AF00AFDF87 /* Project object */;
proxyType = 1; proxyType = 1;
@ -52,17 +50,15 @@
2113924116EAD6AF00AFDF87 /* CocoaSecurity.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CocoaSecurity.m; sourceTree = "<group>"; }; 2113924116EAD6AF00AFDF87 /* CocoaSecurity.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CocoaSecurity.m; sourceTree = "<group>"; };
2113924916EAD6AF00AFDF87 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; 2113924916EAD6AF00AFDF87 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
2113924B16EAD6AF00AFDF87 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; 2113924B16EAD6AF00AFDF87 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
215409EC183DD72F00E4C15B /* CocoaSecurityTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CocoaSecurityTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 2164336517FEB509006C71F4 /* CocoaSecurityDecoder_Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocoaSecurityDecoder_Tests.m; sourceTree = "<group>"; };
215409F2183DD72F00E4C15B /* CocoaSecurityTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CocoaSecurityTests-Info.plist"; sourceTree = "<group>"; }; 2164336717FEB8B0006C71F4 /* CocoaSecurityResult_Test.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocoaSecurityResult_Test.m; sourceTree = "<group>"; };
215409F4183DD72F00E4C15B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 21BB8A2D17FEA0EC0032C38C /* CocoaSecurity Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "CocoaSecurity Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
215409F8183DD72F00E4C15B /* CocoaSecurityTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CocoaSecurityTests-Prefix.pch"; sourceTree = "<group>"; };
215409FE183DD7F000E4C15B /* CocoaSecurity_Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocoaSecurity_Tests.m; sourceTree = "<group>"; };
215409FF183DD7F000E4C15B /* CocoaSecurityDecoder_Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocoaSecurityDecoder_Tests.m; sourceTree = "<group>"; };
21540A00183DD7F000E4C15B /* CocoaSecurityEncoder_Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocoaSecurityEncoder_Tests.m; sourceTree = "<group>"; };
21540A01183DD7F000E4C15B /* CocoaSecurityResult_Test.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocoaSecurityResult_Test.m; sourceTree = "<group>"; };
21BB8A2E17FEA0EC0032C38C /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 21BB8A2E17FEA0EC0032C38C /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
21FB346A189601A6002F38DE /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Base64.h; path = submodules/Base64/Base64/Base64.h; sourceTree = SOURCE_ROOT; }; 21BB8A3417FEA0EC0032C38C /* CocoaSecurity Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CocoaSecurity Tests-Info.plist"; sourceTree = "<group>"; };
21FB346B189601A6002F38DE /* Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Base64.m; path = submodules/Base64/Base64/Base64.m; sourceTree = SOURCE_ROOT; }; 21BB8A3617FEA0EC0032C38C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
21BB8A3817FEA0EC0032C38C /* CocoaSecurity_Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CocoaSecurity_Tests.m; sourceTree = "<group>"; };
21BB8A3A17FEA0EC0032C38C /* CocoaSecurity Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CocoaSecurity Tests-Prefix.pch"; sourceTree = "<group>"; };
21BB8A4217FEB3ED0032C38C /* CocoaSecurityEncoder_Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocoaSecurityEncoder_Tests.m; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -74,12 +70,12 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
215409E9183DD72F00E4C15B /* Frameworks */ = { 21BB8A2A17FEA0EC0032C38C /* Frameworks */ = {
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
215409ED183DD72F00E4C15B /* XCTest.framework in Frameworks */, 21BB8A2F17FEA0EC0032C38C /* XCTest.framework in Frameworks */,
215409EE183DD72F00E4C15B /* Foundation.framework in Frameworks */, 21BB8A3017FEA0EC0032C38C /* Foundation.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -90,7 +86,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
2113923C16EAD6AF00AFDF87 /* CocoaSecurity */, 2113923C16EAD6AF00AFDF87 /* CocoaSecurity */,
215409F0183DD72F00E4C15B /* CocoaSecurityTests */, 21BB8A3217FEA0EC0032C38C /* CocoaSecurity Tests */,
2113923916EAD6AF00AFDF87 /* Frameworks */, 2113923916EAD6AF00AFDF87 /* Frameworks */,
2113923816EAD6AF00AFDF87 /* Products */, 2113923816EAD6AF00AFDF87 /* Products */,
); );
@ -100,7 +96,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
2113923716EAD6AF00AFDF87 /* libCocoaSecurity.a */, 2113923716EAD6AF00AFDF87 /* libCocoaSecurity.a */,
215409EC183DD72F00E4C15B /* CocoaSecurityTests.xctest */, 21BB8A2D17FEA0EC0032C38C /* CocoaSecurity Tests.xctest */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
@ -119,44 +115,34 @@
2113923C16EAD6AF00AFDF87 /* CocoaSecurity */ = { 2113923C16EAD6AF00AFDF87 /* CocoaSecurity */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
21FB34691896019A002F38DE /* Submodules */,
2113923F16EAD6AF00AFDF87 /* CocoaSecurity.h */, 2113923F16EAD6AF00AFDF87 /* CocoaSecurity.h */,
2113924116EAD6AF00AFDF87 /* CocoaSecurity.m */, 2113924116EAD6AF00AFDF87 /* CocoaSecurity.m */,
); );
path = CocoaSecurity; path = CocoaSecurity;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
215409F0183DD72F00E4C15B /* CocoaSecurityTests */ = { 21BB8A3217FEA0EC0032C38C /* CocoaSecurity Tests */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
215409FE183DD7F000E4C15B /* CocoaSecurity_Tests.m */, 21BB8A3817FEA0EC0032C38C /* CocoaSecurity_Tests.m */,
215409FF183DD7F000E4C15B /* CocoaSecurityDecoder_Tests.m */, 21BB8A4217FEB3ED0032C38C /* CocoaSecurityEncoder_Tests.m */,
21540A00183DD7F000E4C15B /* CocoaSecurityEncoder_Tests.m */, 2164336517FEB509006C71F4 /* CocoaSecurityDecoder_Tests.m */,
21540A01183DD7F000E4C15B /* CocoaSecurityResult_Test.m */, 2164336717FEB8B0006C71F4 /* CocoaSecurityResult_Test.m */,
215409F1183DD72F00E4C15B /* Supporting Files */, 21BB8A3317FEA0EC0032C38C /* Supporting Files */,
); );
path = CocoaSecurityTests; path = "CocoaSecurity Tests";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
215409F1183DD72F00E4C15B /* Supporting Files */ = { 21BB8A3317FEA0EC0032C38C /* Supporting Files */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
215409F2183DD72F00E4C15B /* CocoaSecurityTests-Info.plist */, 21BB8A3417FEA0EC0032C38C /* CocoaSecurity Tests-Info.plist */,
215409F3183DD72F00E4C15B /* InfoPlist.strings */, 21BB8A3517FEA0EC0032C38C /* InfoPlist.strings */,
215409F8183DD72F00E4C15B /* CocoaSecurityTests-Prefix.pch */, 21BB8A3A17FEA0EC0032C38C /* CocoaSecurity Tests-Prefix.pch */,
); );
name = "Supporting Files"; name = "Supporting Files";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
21FB34691896019A002F38DE /* Submodules */ = {
isa = PBXGroup;
children = (
21FB346A189601A6002F38DE /* Base64.h */,
21FB346B189601A6002F38DE /* Base64.m */,
);
name = Submodules;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
@ -177,22 +163,22 @@
productReference = 2113923716EAD6AF00AFDF87 /* libCocoaSecurity.a */; productReference = 2113923716EAD6AF00AFDF87 /* libCocoaSecurity.a */;
productType = "com.apple.product-type.library.static"; productType = "com.apple.product-type.library.static";
}; };
215409EB183DD72F00E4C15B /* CocoaSecurityTests */ = { 21BB8A2C17FEA0EC0032C38C /* CocoaSecurity Tests */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 215409FD183DD72F00E4C15B /* Build configuration list for PBXNativeTarget "CocoaSecurityTests" */; buildConfigurationList = 21BB8A3D17FEA0EC0032C38C /* Build configuration list for PBXNativeTarget "CocoaSecurity Tests" */;
buildPhases = ( buildPhases = (
215409E8183DD72F00E4C15B /* Sources */, 21BB8A2917FEA0EC0032C38C /* Sources */,
215409E9183DD72F00E4C15B /* Frameworks */, 21BB8A2A17FEA0EC0032C38C /* Frameworks */,
215409EA183DD72F00E4C15B /* Resources */, 21BB8A2B17FEA0EC0032C38C /* Resources */,
); );
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
215409FA183DD72F00E4C15B /* PBXTargetDependency */, 21BB8A3C17FEA0EC0032C38C /* PBXTargetDependency */,
); );
name = CocoaSecurityTests; name = "CocoaSecurity Tests";
productName = CocoaSecurityTests; productName = "CocoaSecurity Tests";
productReference = 215409EC183DD72F00E4C15B /* CocoaSecurityTests.xctest */; productReference = 21BB8A2D17FEA0EC0032C38C /* CocoaSecurity Tests.xctest */;
productType = "com.apple.product-type.bundle.unit-test"; productType = "com.apple.product-type.bundle.unit-test";
}; };
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */
@ -201,9 +187,9 @@
2113922F16EAD6AF00AFDF87 /* Project object */ = { 2113922F16EAD6AF00AFDF87 /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 0510; LastUpgradeCheck = 0500;
TargetAttributes = { TargetAttributes = {
215409EB183DD72F00E4C15B = { 21BB8A2C17FEA0EC0032C38C = {
TestTargetID = 2113923616EAD6AF00AFDF87; TestTargetID = 2113923616EAD6AF00AFDF87;
}; };
}; };
@ -221,17 +207,17 @@
projectRoot = ""; projectRoot = "";
targets = ( targets = (
2113923616EAD6AF00AFDF87 /* CocoaSecurity */, 2113923616EAD6AF00AFDF87 /* CocoaSecurity */,
215409EB183DD72F00E4C15B /* CocoaSecurityTests */, 21BB8A2C17FEA0EC0032C38C /* CocoaSecurity Tests */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */ /* Begin PBXResourcesBuildPhase section */
215409EA183DD72F00E4C15B /* Resources */ = { 21BB8A2B17FEA0EC0032C38C /* Resources */ = {
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
215409F5183DD72F00E4C15B /* InfoPlist.strings in Resources */, 21BB8A3717FEA0EC0032C38C /* InfoPlist.strings in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -242,39 +228,37 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
21FB346C189601A6002F38DE /* Base64.m in Sources */,
2113924216EAD6AF00AFDF87 /* CocoaSecurity.m in Sources */, 2113924216EAD6AF00AFDF87 /* CocoaSecurity.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
215409E8183DD72F00E4C15B /* Sources */ = { 21BB8A2917FEA0EC0032C38C /* Sources */ = {
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
21FB346D18960347002F38DE /* Base64.m in Sources */, 2164336617FEB509006C71F4 /* CocoaSecurityDecoder_Tests.m in Sources */,
21540A06183DD81A00E4C15B /* CocoaSecurity.m in Sources */, 21BB8A4017FEA5190032C38C /* CocoaSecurity.m in Sources */,
21540A05183DD7F000E4C15B /* CocoaSecurityResult_Test.m in Sources */, 21BB8A3917FEA0EC0032C38C /* CocoaSecurity_Tests.m in Sources */,
21540A03183DD7F000E4C15B /* CocoaSecurityDecoder_Tests.m in Sources */, 21BB8A4317FEB3ED0032C38C /* CocoaSecurityEncoder_Tests.m in Sources */,
21540A02183DD7F000E4C15B /* CocoaSecurity_Tests.m in Sources */, 2164336817FEB8B0006C71F4 /* CocoaSecurityResult_Test.m in Sources */,
21540A04183DD7F000E4C15B /* CocoaSecurityEncoder_Tests.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */ /* Begin PBXTargetDependency section */
215409FA183DD72F00E4C15B /* PBXTargetDependency */ = { 21BB8A3C17FEA0EC0032C38C /* PBXTargetDependency */ = {
isa = PBXTargetDependency; isa = PBXTargetDependency;
target = 2113923616EAD6AF00AFDF87 /* CocoaSecurity */; target = 2113923616EAD6AF00AFDF87 /* CocoaSecurity */;
targetProxy = 215409F9183DD72F00E4C15B /* PBXContainerItemProxy */; targetProxy = 21BB8A3B17FEA0EC0032C38C /* PBXContainerItemProxy */;
}; };
/* End PBXTargetDependency section */ /* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
215409F3183DD72F00E4C15B /* InfoPlist.strings */ = { 21BB8A3517FEA0EC0032C38C /* InfoPlist.strings */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
215409F4183DD72F00E4C15B /* en */, 21BB8A3617FEA0EC0032C38C /* en */,
); );
name = InfoPlist.strings; name = InfoPlist.strings;
sourceTree = "<group>"; sourceTree = "<group>";
@ -306,8 +290,8 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0; IPHONEOS_DEPLOYMENT_TARGET = 6.1;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
}; };
name = Debug; name = Debug;
@ -329,7 +313,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0; IPHONEOS_DEPLOYMENT_TARGET = 6.1;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
@ -342,7 +326,6 @@
DSTROOT = /tmp/CocoaSecurity.dst; DSTROOT = /tmp/CocoaSecurity.dst;
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ""; GCC_PREFIX_HEADER = "";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "-ObjC"; OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
@ -356,7 +339,6 @@
DSTROOT = /tmp/CocoaSecurity.dst; DSTROOT = /tmp/CocoaSecurity.dst;
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ""; GCC_PREFIX_HEADER = "";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "-ObjC"; OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
@ -364,7 +346,7 @@
}; };
name = Release; name = Release;
}; };
215409FB183DD72F00E4C15B /* Debug */ = { 21BB8A3E17FEA0EC0032C38C /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
@ -388,13 +370,12 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
INFOPLIST_FILE = "CocoaSecurity Tests/CocoaSecurity Tests-Info.plist"; INFOPLIST_FILE = "CocoaSecurity Tests/CocoaSecurity Tests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.0; IPHONEOS_DEPLOYMENT_TARGET = 7.0;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = xctest; WRAPPER_EXTENSION = xctest;
}; };
name = Debug; name = Debug;
}; };
215409FC183DD72F00E4C15B /* Release */ = { 21BB8A3F17FEA0EC0032C38C /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
@ -441,11 +422,11 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
215409FD183DD72F00E4C15B /* Build configuration list for PBXNativeTarget "CocoaSecurityTests" */ = { 21BB8A3D17FEA0EC0032C38C /* Build configuration list for PBXNativeTarget "CocoaSecurity Tests" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
215409FB183DD72F00E4C15B /* Debug */, 21BB8A3E17FEA0EC0032C38C /* Debug */,
215409FC183DD72F00E4C15B /* Release */, 21BB8A3F17FEA0EC0032C38C /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0510" LastUpgradeVersion = "0500"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
@ -32,7 +32,7 @@
skipped = "NO"> skipped = "NO">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "215409EB183DD72F00E4C15B" BlueprintIdentifier = "21BB8A2C17FEA0EC0032C38C"
BuildableName = "CocoaSecurity Tests.xctest" BuildableName = "CocoaSecurity Tests.xctest"
BlueprintName = "CocoaSecurity Tests" BlueprintName = "CocoaSecurity Tests"
ReferencedContainer = "container:CocoaSecurity.xcodeproj"> ReferencedContainer = "container:CocoaSecurity.xcodeproj">

View File

@ -9,7 +9,6 @@
#import "CocoaSecurity.h" #import "CocoaSecurity.h"
#import <CommonCrypto/CommonHMAC.h> #import <CommonCrypto/CommonHMAC.h>
#import <CommonCrypto/CommonCryptor.h> #import <CommonCrypto/CommonCryptor.h>
#import "Base64.h"
#pragma mark - CocoaSecurity #pragma mark - CocoaSecurity
@implementation CocoaSecurity @implementation CocoaSecurity
@ -420,7 +419,51 @@
// convert NSData to Base64 // convert NSData to Base64
- (NSString *)base64:(NSData *)data - (NSString *)base64:(NSData *)data
{ {
return [data base64EncodedString]; static const char lookup[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
long long inputLength = [data length];
const unsigned char *inputBytes = [data bytes];
long long maxOutputLength = (inputLength / 3 + 1) * 4;
unsigned char *outputBytes = (unsigned char *)malloc((unsigned long)maxOutputLength);
long long index;
long long outputLength = 0;
for (index = 0; index < inputLength - 2; index += 3)
{
outputBytes[outputLength++] = lookup[(inputBytes[index] & 0xFC) >> 2];
outputBytes[outputLength++] = lookup[((inputBytes[index] & 0x03) << 4) | ((inputBytes[index + 1] & 0xF0) >> 4)];
outputBytes[outputLength++] = lookup[((inputBytes[index + 1] & 0x0F) << 2) | ((inputBytes[index + 2] & 0xC0) >> 6)];
outputBytes[outputLength++] = lookup[inputBytes[index + 2] & 0x3F];
}
//handle left-over data
if (index == inputLength - 2)
{
// = terminator
outputBytes[outputLength++] = lookup[(inputBytes[index] & 0xFC) >> 2];
outputBytes[outputLength++] = lookup[((inputBytes[index] & 0x03) << 4) | ((inputBytes[index + 1] & 0xF0) >> 4)];
outputBytes[outputLength++] = lookup[(inputBytes[index + 1] & 0x0F) << 2];
outputBytes[outputLength++] = '=';
}
else if (index == inputLength - 1)
{
// == terminator
outputBytes[outputLength++] = lookup[(inputBytes[index] & 0xFC) >> 2];
outputBytes[outputLength++] = lookup[(inputBytes[index] & 0x03) << 4];
outputBytes[outputLength++] = '=';
outputBytes[outputLength++] = '=';
}
NSString *result;
if (outputLength >= 4)
{
//truncate data to match actual output length
outputBytes = realloc(outputBytes, (unsigned long)outputLength);
result = [[NSString alloc] initWithBytes:outputBytes length:(unsigned long)outputLength encoding:NSASCIIStringEncoding];
}
free(outputBytes);
return result;
} }
// convert NSData to hex string // convert NSData to hex string
@ -467,7 +510,52 @@
@implementation CocoaSecurityDecoder @implementation CocoaSecurityDecoder
- (NSData *)base64:(NSString *)string - (NSData *)base64:(NSString *)string
{ {
return [NSData dataWithBase64EncodedString:string]; static const char lookup[] =
{
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 62, 99, 99, 99, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 99, 99, 99, 99, 99, 99,
99, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 99, 99, 99, 99, 99,
99, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 99, 99, 99, 99, 99
};
NSData *inputData = [string dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSUInteger inputLength = [inputData length];
const unsigned char *inputBytes = [inputData bytes];
NSMutableData *outputData = [NSMutableData dataWithLength:(inputLength / 4 + 1) * 3];
unsigned char *outputBytes = (unsigned char *)[outputData mutableBytes];
int accumulator = 0;
long long outputLength = 0;
unsigned char accumulated[] = {0, 0, 0, 0};
for (NSUInteger index = 0; index < inputLength; index++)
{
unsigned char decoded = lookup[inputBytes[index] & 0x7F];
if (decoded != 99)
{
accumulated[accumulator] = decoded;
if (accumulator == 3)
{
outputBytes[outputLength++] = (accumulated[0] << 2) | (accumulated[1] >> 4);
outputBytes[outputLength++] = (accumulated[1] << 4) | (accumulated[2] >> 2);
outputBytes[outputLength++] = (accumulated[2] << 6) | accumulated[3];
}
accumulator = (accumulator + 1) % 4;
}
}
//handle left-over data
if (accumulator > 0) outputBytes[outputLength] = (accumulated[0] << 2) | (accumulated[1] >> 4);
if (accumulator > 1) outputBytes[++outputLength] = (accumulated[1] << 4) | (accumulated[2] >> 2);
if (accumulator > 2) outputLength++;
//truncate data to match actual output length
outputData.length = outputLength;
return outputLength? outputData: nil;
} }
- (NSData *)hex:(NSString *)data - (NSData *)hex:(NSString *)data
{ {

View File

@ -96,8 +96,6 @@ NSData *data2 = [decoder base64:@"zT1PS64MnXIUDCUiy13RRg=="];
1. **git:** 1. **git:**
``` ```
$ git clone git://github.com/kelp404/CocoaSecurity.git $ git clone git://github.com/kelp404/CocoaSecurity.git
$ cd CocoaSecurity
$ git submodule update --init
``` ```
2. **<a href="http://cocoapods.org/?q=CocoaSecurity" target="_blank">CocoadPods</a>:** 2. **<a href="http://cocoapods.org/?q=CocoaSecurity" target="_blank">CocoadPods</a>:**

@ -1 +0,0 @@
Subproject commit bff0cc9be811b62bd09cca96cf9177b653c1a9f9

@ -1 +0,0 @@
Subproject commit abe45bd3e89bf3e93aa1a574287630cf9d6baa48

1
xctool Submodule

@ -0,0 +1 @@
Subproject commit 9680172729a9c63f7efb4d2759a95b43f632b28f