Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TrustKit/Pinning/TSKSPKIHashCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
static NSString *const kTSKSPKISharedHashCacheIdentifier = @"spki-hash-v2.cache";

// Each key is a raw certificate data (for easy lookup) and each value is the certificate's raw SPKI data
typedef NSMutableDictionary<NSData *, NSData *> SPKICacheDictionnary;
typedef NSMutableDictionary<NSData *, NSData *> SPKICacheDictionary;

@interface TSKSPKIHashCache : NSObject

Expand Down
14 changes: 7 additions & 7 deletions TrustKit/Pinning/TSKSPKIHashCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

@interface TSKSPKIHashCache ()

// Dictionnary to cache SPKI hashes instead of having to compute them on every connection
@property (nonatomic) SPKICacheDictionnary *spkiCache;
// Dictionary to cache SPKI hashes instead of having to compute them on every connection
@property (nonatomic) SPKICacheDictionary *spkiCache;
@property (nonatomic) dispatch_queue_t lockQueue;
@property (nonatomic) dispatch_queue_t persistenceQueue;
@property (nonatomic) BOOL persistenceScheduled;
Expand All @@ -31,7 +31,7 @@ @interface TSKSPKIHashCache ()
/**
Load the SPKI cache from the filesystem. This triggers blocking file I/O.
*/
- (SPKICacheDictionnary *)loadSPKICacheFromFileSystem;
- (SPKICacheDictionary *)loadSPKICacheFromFileSystem;

@end

Expand Down Expand Up @@ -140,7 +140,7 @@ - (void)schedulePersistence {
self.persistenceScheduled = YES;

isProtectedDataAvailableAsync(self.persistenceQueue, ^(BOOL available) {
__block SPKICacheDictionnary *snapshot = nil;
__block SPKICacheDictionary *snapshot = nil;
dispatch_sync(self.lockQueue, ^{
self.persistenceScheduled = NO;
if (available) {
Expand All @@ -162,12 +162,12 @@ - (void)schedulePersistence {
});
}

- (SPKICacheDictionnary *)loadSPKICacheFromFileSystem {
- (SPKICacheDictionary *)loadSPKICacheFromFileSystem {
NSMutableDictionary *spkiCache = nil;
NSData *serializedSpkiCache = [NSData dataWithContentsOfURL:[self SPKICachePath]];
if (serializedSpkiCache) {
NSError *decodingError = nil;
spkiCache = [NSKeyedUnarchiver unarchivedObjectOfClasses:[NSSet setWithArray:@[[SPKICacheDictionnary class], [NSData class]]]
spkiCache = [NSKeyedUnarchiver unarchivedObjectOfClasses:[NSSet setWithArray:@[[SPKICacheDictionary class], [NSData class]]]
fromData:serializedSpkiCache
error:&decodingError];
if (decodingError) {
Expand Down Expand Up @@ -200,7 +200,7 @@ - (void)waitForPendingSubjectPublicKeyInfoDiskWrites {
);
}

- (SPKICacheDictionnary *)getSubjectPublicKeyInfoHashesCache {
- (SPKICacheDictionary *)getSubjectPublicKeyInfoHashesCache {
return _spkiCache;
}

Expand Down
2 changes: 1 addition & 1 deletion TrustKit/TSKPinningValidator_Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Initialize an instance of TSKPinningValidator.

@param domainPinningPolicies A dictionnary of domains and the corresponding pinning policy.
@param domainPinningPolicies A dictionary of domains and the corresponding pinning policy.
@param hashCache The hash cache to use. If nil, no caching is performed, performance may suffer.
@param ignorePinsForUserTrustAnchors Set to true to ignore the trust anchors in the user trust store
@param validationCallbackQueue The queue used when invoking the validationResultHandler
Expand Down
4 changes: 2 additions & 2 deletions TrustKitTests/TSKPinningValidatorTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ - (void)cancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge

@interface TSKSPKIHashCache (TestSupport)
- (void)resetSubjectPublicKeyInfoDiskCache;
- (NSMutableDictionary<NSNumber *, SPKICacheDictionnary *> *)getSubjectPublicKeyInfoHashesCache;
- (NSMutableDictionary<NSNumber *, SPKICacheDictionnary *> *)loadSPKICacheFromFileSystem;
- (NSMutableDictionary<NSNumber *, SPKICacheDictionary *> *)getSubjectPublicKeyInfoHashesCache;
- (NSMutableDictionary<NSNumber *, SPKICacheDictionary *> *)loadSPKICacheFromFileSystem;
- (void)waitForPendingSubjectPublicKeyInfoDiskWrites;
@end

Expand Down
2 changes: 1 addition & 1 deletion TrustKitTests/TSKSPKIHashCacheTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

@interface TSKSPKIHashCache (TestSupport)
- (void)resetSubjectPublicKeyInfoDiskCache;
- (NSMutableDictionary<NSNumber *, SPKICacheDictionnary *> *)getSubjectPublicKeyInfoHashesCache;
- (NSMutableDictionary<NSNumber *, SPKICacheDictionary *> *)getSubjectPublicKeyInfoHashesCache;
@end

@interface TSKSPKIHashCacheTests : XCTestCase
Expand Down