Skip to content

Commit

Permalink
Renamed AFSecurityPolicy with AXSecurityPolicy.
Browse files Browse the repository at this point in the history
  • Loading branch information
devedbox committed May 15, 2017
1 parent 3e1c031 commit d1d6522
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 63 deletions.
12 changes: 6 additions & 6 deletions AXWebViewController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
01CDC1511C2A3C9100D9AF53 /* AXWebViewController.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 01CDC1501C2A3C9100D9AF53 /* AXWebViewController.bundle */; };
01CDC15D1C2A41DF00D9AF53 /* TableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 01CDC15C1C2A41DF00D9AF53 /* TableViewController.m */; };
97F6BE6D557C0BB485DDCF88 /* libPods-AXWebViewController.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2642E682614F41BF460E7673 /* libPods-AXWebViewController.a */; };
DCABA01B1EC5EE2A005C7D31 /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABA01A1EC5EE2A005C7D31 /* AFSecurityPolicy.m */; };
DCABA01B1EC5EE2A005C7D31 /* AXSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABA01A1EC5EE2A005C7D31 /* AXSecurityPolicy.m */; };
DCABA0231EC5FDFF005C7D31 /* AXWebViewControllerActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = DCABA01E1EC5FDFF005C7D31 /* AXWebViewControllerActivity.m */; };
DCCF48241E7987C9009CF38E /* Swift.pdf in Resources */ = {isa = PBXBuildFile; fileRef = DCCF48231E7987C9009CF38E /* Swift.pdf */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -50,8 +50,8 @@
3B7311EC599653BFAAF42107 /* Pods-AXWebViewController.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AXWebViewController.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AXWebViewController/Pods-AXWebViewController.debug.xcconfig"; sourceTree = "<group>"; };
A13CC1551E977227003AC1B2 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Main.strings"; sourceTree = "<group>"; };
A13CC1561E977227003AC1B2 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
DCABA0191EC5EE2A005C7D31 /* AFSecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFSecurityPolicy.h; sourceTree = "<group>"; };
DCABA01A1EC5EE2A005C7D31 /* AFSecurityPolicy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFSecurityPolicy.m; sourceTree = "<group>"; };
DCABA0191EC5EE2A005C7D31 /* AXSecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AXSecurityPolicy.h; sourceTree = "<group>"; };
DCABA01A1EC5EE2A005C7D31 /* AXSecurityPolicy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AXSecurityPolicy.m; sourceTree = "<group>"; };
DCABA01D1EC5FDFF005C7D31 /* AXWebViewControllerActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AXWebViewControllerActivity.h; sourceTree = "<group>"; };
DCABA01E1EC5FDFF005C7D31 /* AXWebViewControllerActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AXWebViewControllerActivity.m; sourceTree = "<group>"; };
DCCF48231E7987C9009CF38E /* Swift.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Swift.pdf; sourceTree = "<group>"; };
Expand Down Expand Up @@ -151,8 +151,8 @@
DCABA0181EC5EE2A005C7D31 /* Security */ = {
isa = PBXGroup;
children = (
DCABA0191EC5EE2A005C7D31 /* AFSecurityPolicy.h */,
DCABA01A1EC5EE2A005C7D31 /* AFSecurityPolicy.m */,
DCABA0191EC5EE2A005C7D31 /* AXSecurityPolicy.h */,
DCABA01A1EC5EE2A005C7D31 /* AXSecurityPolicy.m */,
);
name = Security;
path = AXWebViewController/Security;
Expand Down Expand Up @@ -300,7 +300,7 @@
DCABA0231EC5FDFF005C7D31 /* AXWebViewControllerActivity.m in Sources */,
01513BF01C28F70700CB8238 /* main.m in Sources */,
01AA4F1C1D4F28DD008F2A2C /* TabbarViewController2.m in Sources */,
DCABA01B1EC5EE2A005C7D31 /* AFSecurityPolicy.m in Sources */,
DCABA01B1EC5EE2A005C7D31 /* AXSecurityPolicy.m in Sources */,
01CDC15D1C2A41DF00D9AF53 /* TableViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
4 changes: 2 additions & 2 deletions AXWebViewController/AXWebViewController/AXWebViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#import <NJKWebViewProgress/NJKWebViewProgressView.h>
#if AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
#import <WebKit/WebKit.h>
#import "AFSecurityPolicy.h"
#import "AXSecurityPolicy.h"
#endif
#ifndef AX_REQUIRES_SUPER
#if __has_attribute(objc_requires_super)
Expand Down Expand Up @@ -253,7 +253,7 @@ typedef NSURLSessionAuthChallengeDisposition (^WKWebViewDidReceiveAuthentication
@property(copy, nonatomic, nullable) WKWebViewDidReceiveAuthenticationChallengeHandler challengeHandler;
/// The security policy used by created session to evaluate server trust for secure connections.
/// `AXWebViewController` uses the `defaultPolicy` unless otherwise specified.
@property (strong, nonatomic, nullable) AFSecurityPolicy *securityPolicy;
@property (strong, nonatomic, nullable) AXSecurityPolicy *securityPolicy;
@end
#endif
NS_ASSUME_NONNULL_END
6 changes: 3 additions & 3 deletions AXWebViewController/AXWebViewController/AXWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ @interface AXWebViewController ()<NJKWebViewProgressDelegate, SKStoreProductView
WKWebViewConfiguration *_configuration;

WKWebViewDidReceiveAuthenticationChallengeHandler _challengeHandler;
AFSecurityPolicy *_securityPolicy;
AXSecurityPolicy *_securityPolicy;
#endif

NSURLRequest *_request;
Expand Down Expand Up @@ -1708,15 +1708,15 @@ - (WKWebViewDidReceiveAuthenticationChallengeHandler)challengeHandler {
return _challengeHandler;
}

- (AFSecurityPolicy *)securityPolicy {
- (AXSecurityPolicy *)securityPolicy {
return _securityPolicy;
}

- (void)setChallengeHandler:(WKWebViewDidReceiveAuthenticationChallengeHandler)challengeHandler {
_challengeHandler = [challengeHandler copy];
}

- (void)setSecurityPolicy:(AFSecurityPolicy *)securityPolicy {
- (void)setSecurityPolicy:(AXSecurityPolicy *)securityPolicy {
_securityPolicy = securityPolicy;
}
@end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// AFSecurityPolicy.h
// AXSecurityPolicy.h
// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -22,31 +22,31 @@
#import <Foundation/Foundation.h>
#import <Security/Security.h>

typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
AFSSLPinningModeNone,
AFSSLPinningModePublicKey,
AFSSLPinningModeCertificate,
typedef NS_ENUM(NSUInteger, AXSSLPinningMode) {
AXSSLPinningModeNone,
AXSSLPinningModePublicKey,
AXSSLPinningModeCertificate,
};

/**
`AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections.
`AXSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections.
Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled.
*/

NS_ASSUME_NONNULL_BEGIN

@interface AFSecurityPolicy : NSObject <NSSecureCoding, NSCopying>
@interface AXSecurityPolicy : NSObject <NSSecureCoding, NSCopying>

/**
The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`.
The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AXSSLPinningModeNone`.
*/
@property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode;
@property (readonly, nonatomic, assign) AXSSLPinningMode SSLPinningMode;

/**
The certificates used to evaluate server trust according to the SSL pinning mode.
By default, this property is set to any (`.cer`) certificates included in the target compiling AFNetworking. Note that if you are using AFNetworking as embedded framework, no certificates will be pinned by default. Use `certificatesInBundle` to load certificates from your target, and then create a new policy by calling `policyWithPinningMode:withPinnedCertificates`.
By default, this property is set to any (`.cer`) certificates included in the target compiling AXNetworking. Note that if you are using AXNetworking as embedded framework, no certificates will be pinned by default. Use `certificatesInBundle` to load certificates from your target, and then create a new policy by calling `policyWithPinningMode:withPinnedCertificates`.
Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches.
*/
Expand All @@ -67,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN
///-----------------------------------------

/**
Returns any certificates included in the bundle. If you are using AFNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`.
Returns any certificates included in the bundle. If you are using AXNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`.
@return The certificates included in the given bundle.
*/
Expand Down Expand Up @@ -95,7 +95,7 @@ NS_ASSUME_NONNULL_BEGIN
@return A new security policy.
*/
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode;
+ (instancetype)policyWithPinningMode:(AXSSLPinningMode)pinningMode;

/**
Creates and returns a security policy with the specified pinning mode.
Expand All @@ -105,7 +105,7 @@ NS_ASSUME_NONNULL_BEGIN
@return A new security policy.
*/
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet <NSData *> *)pinnedCertificates;
+ (instancetype)policyWithPinningMode:(AXSSLPinningMode)pinningMode withPinnedCertificates:(NSSet <NSData *> *)pinnedCertificates;

///------------------------------
/// @name Evaluating Server Trust
Expand Down Expand Up @@ -135,20 +135,20 @@ NS_ASSUME_NONNULL_END
/**
## SSL Pinning Modes
The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes.
The following constants are provided by `AXSSLPinningMode` as possible SSL pinning modes.
enum {
AFSSLPinningModeNone,
AFSSLPinningModePublicKey,
AFSSLPinningModeCertificate,
AXSSLPinningModeNone,
AXSSLPinningModePublicKey,
AXSSLPinningModeCertificate,
}
`AFSSLPinningModeNone`
`AXSSLPinningModeNone`
Do not used pinned certificates to validate servers.
`AFSSLPinningModePublicKey`
`AXSSLPinningModePublicKey`
Validate host certificates against public keys of pinned certificates.
`AFSSLPinningModeCertificate`
`AXSSLPinningModeCertificate`
Validate host certificates against pinned certificates.
*/
Loading

0 comments on commit d1d6522

Please sign in to comment.