Skip to content

Commit

Permalink
Merge pull request #47 from datatheorem/notifications
Browse files Browse the repository at this point in the history
Add support for pin validation notifications
  • Loading branch information
nabla-c0d3 committed May 25, 2016
2 parents e7f8c28 + a53b773 commit 98ab6d4
Show file tree
Hide file tree
Showing 60 changed files with 2,299 additions and 583 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TrustKit
========

[![Build Status](https://travis-ci.org/datatheorem/TrustKit.svg?branch=1.2.5)](https://travis-ci.org/datatheorem/TrustKit) [![Version Status](https://img.shields.io/cocoapods/v/TrustKit.svg?style=flat)](https://cocoapods.org/pods/TrustKit) [![Platform](https://img.shields.io/cocoapods/p/TrustKit.svg?style=flat)](https://cocoapods.org/pods/TrustKit) [![License MIT](https://img.shields.io/cocoapods/l/TrustKit.svg?style=flat)](https://en.wikipedia.org/wiki/MIT_License)
[![Build Status](https://travis-ci.org/datatheorem/TrustKit.svg?branch=1.3.0)](https://travis-ci.org/datatheorem/TrustKit) [![Version Status](https://img.shields.io/cocoapods/v/TrustKit.svg?style=flat)](https://cocoapods.org/pods/TrustKit) [![Platform](https://img.shields.io/cocoapods/p/TrustKit.svg?style=flat)](https://cocoapods.org/pods/TrustKit) [![License MIT](https://img.shields.io/cocoapods/l/TrustKit.svg?style=flat)](https://en.wikipedia.org/wiki/MIT_License)

**TrustKit** is an open source framework that makes it easy to deploy SSL public key pinning in any iOS or OS X App; it supports both Swift and Objective-C Apps.

Expand All @@ -14,7 +14,7 @@ Overview
* Simple API to configure an SSL pinning policy and enforce it within an App. The policy settings are heavily based on the [HTTP Public Key Pinning specification](https://tools.ietf.org/html/rfc7469).
* Auto-pinning functionality by swizzling the App's _NSURLConnection_ and _NSURLSession_ delegates in order to automatically add pinning validation to the App's HTTPS connections; this allows deploying **TrustKit** without even modifying the App's source code.
* Sane implementation by pinning the certificate's Subject Public Key Info, [as opposed to the certificate itself or the public key bits](https://www.imperialviolet.org/2011/05/04/pinning.html).
* Reporting mechanism to notify a server about pinning validation failures happening within the App, when an unexpected certificate chain is detected. This is similar to the _report-uri_ directive described in the HPKP specification.
* Reporting mechanism to notify a server about pinning validation failures happening within the App, when an unexpected certificate chain is detected. This is similar to the _report-uri_ directive described in the HPKP specification. The reporting mechanism can also be customized within the App by leveraging pin validation notifications sent by TrustKit.

**TrustKit** was open-sourced at [Black Hat 2015 USA][bh2015-conf].

Expand Down
2 changes: 1 addition & 1 deletion TrustKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "TrustKit"
s.version = "1.2.5"
s.version = "1.3.0"
s.summary = 'TrustKit is an open source framework that makes it easy to deploy SSL pinning in any iOS or OS X App.'
s.homepage = "https://datatheorem.github.io/TrustKit"
s.documentation_url = 'https://datatheorem.github.io/TrustKit/documentation/'
Expand Down
90 changes: 84 additions & 6 deletions TrustKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
8C15F9A01B16094D00F06C0E /* TSKPinFailureReport.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C15F99E1B16094D00F06C0E /* TSKPinFailureReport.h */; };
8C15F9A11B16094E00F06C0E /* TSKPinFailureReport.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C15F99F1B16094D00F06C0E /* TSKPinFailureReport.m */; };
8C15F9A41B17564400F06C0E /* TSKPinConfigurationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C15F9A31B17564400F06C0E /* TSKPinConfigurationTests.m */; };
8C5AB45F1CF268FA00234B30 /* OCMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C5AB45E1CF268FA00234B30 /* OCMock.framework */; };
8C5AB4621CF269DA00234B30 /* OCMock.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8C5AB45E1CF268FA00234B30 /* OCMock.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
8C5AB4681CF26A2900234B30 /* OCMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C5AB4671CF26A2900234B30 /* OCMock.framework */; };
8C5AB46A1CF26A3E00234B30 /* OCMock.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8C5AB4671CF26A2900234B30 /* OCMock.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
8C5D98B31CEFF079008E654B /* parse_configuration.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C5D98B21CEFF079008E654B /* parse_configuration.m */; };
8C5D98B41CEFF079008E654B /* parse_configuration.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C5D98B21CEFF079008E654B /* parse_configuration.m */; };
8C5D98B51CEFF079008E654B /* parse_configuration.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C5D98B21CEFF079008E654B /* parse_configuration.m */; };
8C7D06811C69551900D3B3D2 /* www.cloudflare.com.der in Resources */ = {isa = PBXBuildFile; fileRef = 8C7D06801C69551400D3B3D2 /* www.cloudflare.com.der */; };
8C7D06821C69551900D3B3D2 /* www.cloudflare.com.der in Resources */ = {isa = PBXBuildFile; fileRef = 8C7D06801C69551400D3B3D2 /* www.cloudflare.com.der */; };
8C7D06871C6957FE00D3B3D2 /* COMODOECCExtendedValidationSecureServerCA.der in Resources */ = {isa = PBXBuildFile; fileRef = 8C7D06861C6957FE00D3B3D2 /* COMODOECCExtendedValidationSecureServerCA.der */; };
Expand All @@ -42,7 +49,6 @@
8CA6CC071BAE2ADD00BDA419 /* TrustKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CA6CBFD1BAE2ADD00BDA419 /* TrustKit.framework */; };
8CA6CC141BAE2B6600BDA419 /* TSKReportsRateLimiter.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C9EBE001B619BBE00CA7EE0 /* TSKReportsRateLimiter.h */; };
8CA6CC151BAE2B6600BDA419 /* TSKReportsRateLimiter.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9EBE011B619BBE00CA7EE0 /* TSKReportsRateLimiter.m */; };
8CA6CC161BAE2B6600BDA419 /* TSKReporterDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CE919261AEA0991002B29AE /* TSKReporterDelegate.h */; };
8CA6CC191BAE2B6600BDA419 /* TSKBackgroundReporter.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B2B06AC1B05154A00FC749E /* TSKBackgroundReporter.h */; };
8CA6CC1A1BAE2B6600BDA419 /* TSKBackgroundReporter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B2B06AE1B05157400FC749E /* TSKBackgroundReporter.m */; };
8CA6CC1B1BAE2B6600BDA419 /* TSKPinFailureReport.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C15F99E1B16094D00F06C0E /* TSKPinFailureReport.h */; };
Expand Down Expand Up @@ -110,7 +116,6 @@
8CE9191F1AEA073C002B29AE /* public_key_utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CE9191D1AEA073C002B29AE /* public_key_utils.m */; };
8CE919221AEA077F002B29AE /* ssl_pin_verifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CE919211AEA077F002B29AE /* ssl_pin_verifier.m */; };
8CE919251AEA07C5002B29AE /* ssl_pin_verifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CE919241AEA07C5002B29AE /* ssl_pin_verifier.h */; };
8CE919271AEA0991002B29AE /* TSKReporterDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CE919261AEA0991002B29AE /* TSKReporterDelegate.h */; };
8CE9192D1AEA0F7E002B29AE /* domain_registry.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CE919291AEA0F7E002B29AE /* domain_registry.h */; };
/* End PBXBuildFile section */

Expand All @@ -132,6 +137,26 @@
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
8C5AB4611CF269CE00234B30 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
8C5AB4621CF269DA00234B30 /* OCMock.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8C5AB4691CF26A3200234B30 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
8C5AB46A1CF26A3E00234B30 /* OCMock.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8C8716941B23A91D00267E1D /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -160,6 +185,10 @@
8C15F99E1B16094D00F06C0E /* TSKPinFailureReport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TSKPinFailureReport.h; path = Reporting/TSKPinFailureReport.h; sourceTree = "<group>"; };
8C15F99F1B16094D00F06C0E /* TSKPinFailureReport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TSKPinFailureReport.m; path = Reporting/TSKPinFailureReport.m; sourceTree = "<group>"; };
8C15F9A31B17564400F06C0E /* TSKPinConfigurationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSKPinConfigurationTests.m; sourceTree = "<group>"; };
8C5AB45E1CF268FA00234B30 /* OCMock.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OCMock.framework; path = Dependencies/OCMock/OSX/OCMock.framework; sourceTree = "<group>"; };
8C5AB4671CF26A2900234B30 /* OCMock.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OCMock.framework; path = Dependencies/OCMock/iOS/OCMock.framework; sourceTree = "<group>"; };
8C5D98B21CEFF079008E654B /* parse_configuration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = parse_configuration.m; sourceTree = "<group>"; };
8C5D98B61CEFF103008E654B /* parse_configuration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = parse_configuration.h; sourceTree = "<group>"; };
8C7D06801C69551400D3B3D2 /* www.cloudflare.com.der */ = {isa = PBXFileReference; lastKnownFileType = file; path = www.cloudflare.com.der; sourceTree = "<group>"; };
8C7D06861C6957FE00D3B3D2 /* COMODOECCExtendedValidationSecureServerCA.der */ = {isa = PBXFileReference; lastKnownFileType = file; path = COMODOECCExtendedValidationSecureServerCA.der; sourceTree = "<group>"; };
8C8480471A896EE30017C155 /* TrustKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TrustKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -200,7 +229,6 @@
8CE9191D1AEA073C002B29AE /* public_key_utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = public_key_utils.m; path = Pinning/public_key_utils.m; sourceTree = "<group>"; };
8CE919211AEA077F002B29AE /* ssl_pin_verifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ssl_pin_verifier.m; path = Pinning/ssl_pin_verifier.m; sourceTree = "<group>"; };
8CE919241AEA07C5002B29AE /* ssl_pin_verifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ssl_pin_verifier.h; path = Pinning/ssl_pin_verifier.h; sourceTree = "<group>"; };
8CE919261AEA0991002B29AE /* TSKReporterDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TSKReporterDelegate.h; path = Reporting/TSKReporterDelegate.h; sourceTree = "<group>"; };
8CE919291AEA0F7E002B29AE /* domain_registry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = domain_registry.h; path = Dependencies/domain_registry/domain_registry.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand All @@ -219,6 +247,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8C5AB4681CF26A2900234B30 /* OCMock.framework in Frameworks */,
8C8480531A896EE30017C155 /* TrustKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -247,6 +276,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8C5AB45F1CF268FA00234B30 /* OCMock.framework in Frameworks */,
8CA6CC071BAE2ADD00BDA419 /* TrustKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -274,6 +304,39 @@
name = domain_registry;
sourceTree = "<group>";
};
8C5AB4631CF26A0300234B30 /* Dependencies */ = {
isa = PBXGroup;
children = (
8C5AB4641CF26A0900234B30 /* OCMock */,
);
name = Dependencies;
sourceTree = "<group>";
};
8C5AB4641CF26A0900234B30 /* OCMock */ = {
isa = PBXGroup;
children = (
8C5AB4661CF26A1400234B30 /* iOS */,
8C5AB4651CF26A0E00234B30 /* OS X */,
);
name = OCMock;
sourceTree = "<group>";
};
8C5AB4651CF26A0E00234B30 /* OS X */ = {
isa = PBXGroup;
children = (
8C5AB45E1CF268FA00234B30 /* OCMock.framework */,
);
name = "OS X";
sourceTree = "<group>";
};
8C5AB4661CF26A1400234B30 /* iOS */ = {
isa = PBXGroup;
children = (
8C5AB4671CF26A2900234B30 /* OCMock.framework */,
);
name = iOS;
sourceTree = "<group>";
};
8C84803D1A896EE30017C155 = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -306,6 +369,8 @@
8C84806C1A896F660017C155 /* TrustKit.m */,
2FA286123F801C437F35D240 /* TrustKit+Private.h */,
8C84804A1A896EE30017C155 /* Supporting Files */,
8C5D98B21CEFF079008E654B /* parse_configuration.m */,
8C5D98B61CEFF103008E654B /* parse_configuration.h */,
);
path = TrustKit;
sourceTree = "<group>";
Expand All @@ -321,6 +386,7 @@
8C8480561A896EE30017C155 /* TrustKitTests */ = {
isa = PBXGroup;
children = (
8C5AB4631CF26A0300234B30 /* Dependencies */,
070868B31ADFF68200E5AFDC /* Certificates */,
8CD5F7371BCB02A7005801D8 /* TSKNSURLConnectionTests.m */,
8CD5F7561BCB7219005801D8 /* TSKNSURLSessionTests.m */,
Expand Down Expand Up @@ -432,7 +498,6 @@
children = (
8C9EBE001B619BBE00CA7EE0 /* TSKReportsRateLimiter.h */,
8C9EBE011B619BBE00CA7EE0 /* TSKReportsRateLimiter.m */,
8CE919261AEA0991002B29AE /* TSKReporterDelegate.h */,
6B2B06AC1B05154A00FC749E /* TSKBackgroundReporter.h */,
6B2B06AE1B05157400FC749E /* TSKBackgroundReporter.m */,
8C15F99E1B16094D00F06C0E /* TSKPinFailureReport.h */,
Expand Down Expand Up @@ -472,7 +537,6 @@
8C9492F61B2379A100F5DF38 /* reporting_utils.h in Headers */,
8C84804D1A896EE30017C155 /* TrustKit.h in Headers */,
8C15F9A01B16094D00F06C0E /* TSKPinFailureReport.h in Headers */,
8CE919271AEA0991002B29AE /* TSKReporterDelegate.h in Headers */,
8CE919251AEA07C5002B29AE /* ssl_pin_verifier.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -491,7 +555,6 @@
8CD5F7431BCB06F4005801D8 /* RSSwizzle.h in Headers */,
8CA6CC191BAE2B6600BDA419 /* TSKBackgroundReporter.h in Headers */,
8CA6CC271BAE2B7000BDA419 /* domain_registry.h in Headers */,
8CA6CC161BAE2B6600BDA419 /* TSKReporterDelegate.h in Headers */,
8CA6CC1D1BAE2B6600BDA419 /* reporting_utils.h in Headers */,
8CA6CC1F1BAE2B6A00BDA419 /* public_key_utils.h in Headers */,
);
Expand Down Expand Up @@ -525,6 +588,7 @@
8C84804E1A896EE30017C155 /* Sources */,
8C84804F1A896EE30017C155 /* Frameworks */,
8C8480501A896EE30017C155 /* Resources */,
8C5AB4691CF26A3200234B30 /* CopyFiles */,
);
buildRules = (
);
Expand Down Expand Up @@ -578,6 +642,7 @@
8CA6CC021BAE2ADD00BDA419 /* Sources */,
8CA6CC031BAE2ADD00BDA419 /* Frameworks */,
8CA6CC041BAE2ADD00BDA419 /* Resources */,
8C5AB4611CF269CE00234B30 /* CopyFiles */,
);
buildRules = (
);
Expand Down Expand Up @@ -696,6 +761,7 @@
files = (
8CE919221AEA077F002B29AE /* ssl_pin_verifier.m in Sources */,
8C9EBE031B619BBE00CA7EE0 /* TSKReportsRateLimiter.m in Sources */,
8C5D98B31CEFF079008E654B /* parse_configuration.m in Sources */,
6B2B06AF1B05157400FC749E /* TSKBackgroundReporter.m in Sources */,
8CD5F74B1BCB535E005801D8 /* TSKNSURLSessionDelegateProxy.m in Sources */,
8CE9191F1AEA073C002B29AE /* public_key_utils.m in Sources */,
Expand Down Expand Up @@ -728,6 +794,7 @@
files = (
8C8716B71B23AA0B00267E1D /* TSKPinningValidator.m in Sources */,
8C8716B51B23AA0600267E1D /* public_key_utils.m in Sources */,
8C5D98B41CEFF079008E654B /* parse_configuration.m in Sources */,
8C8716B31B23A9F700267E1D /* TSKPinFailureReport.m in Sources */,
8C8716B41B23A9FA00267E1D /* reporting_utils.m in Sources */,
8C8716B81B23AA0D00267E1D /* TrustKit.m in Sources */,
Expand All @@ -748,6 +815,7 @@
8CA6CC1A1BAE2B6600BDA419 /* TSKBackgroundReporter.m in Sources */,
8CA6CC1C1BAE2B6600BDA419 /* TSKPinFailureReport.m in Sources */,
8CD5F74D1BCB535E005801D8 /* TSKNSURLSessionDelegateProxy.m in Sources */,
8C5D98B51CEFF079008E654B /* parse_configuration.m in Sources */,
8CA6CC241BAE2B6A00BDA419 /* TSKPinningValidator.m in Sources */,
8C0237161C25736400855D43 /* osx_vendor_id.m in Sources */,
8CA6CC1E1BAE2B6600BDA419 /* reporting_utils.m in Sources */,
Expand Down Expand Up @@ -975,6 +1043,7 @@
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)",
"$(inherited)",
"$(PROJECT_DIR)/TrustKitTests/Dependencies/OCMock/iOS",
);
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand Down Expand Up @@ -1002,6 +1071,7 @@
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)",
"$(inherited)",
"$(PROJECT_DIR)/TrustKitTests/Dependencies/OCMock/iOS",
);
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
INFOPLIST_FILE = TrustKitTests/Info.plist;
Expand Down Expand Up @@ -1130,6 +1200,10 @@
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/TrustKitTests/Dependencies/OCMock/OSX",
);
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = TrustKitTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
Expand All @@ -1150,6 +1224,10 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/TrustKitTests/Dependencies/OCMock/OSX",
);
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = TrustKitTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
Expand Down
Loading

0 comments on commit 98ab6d4

Please sign in to comment.