Skip to content

Commit ec40a88

Browse files
authored
Merge pull request #1416 from AzureAD/release/1.7.40
Merge Release 1.7.40 to main
2 parents 8899ef1 + b8d4248 commit ec40a88

File tree

63 files changed

+630
-844
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+630
-844
lines changed

IdentityCore/IdentityCore.xcodeproj/project.pbxproj

+14-14
Original file line numberDiff line numberDiff line change
@@ -8197,7 +8197,7 @@
81978197
INFOPLIST_FILE = MSIDTestsHostApp/Info.plist;
81988198
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
81998199
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
8200-
MACOSX_DEPLOYMENT_TARGET = 10.13;
8200+
MACOSX_DEPLOYMENT_TARGET = 10.15;
82018201
MTL_ENABLE_DEBUG_INFO = YES;
82028202
ONLY_ACTIVE_ARCH = YES;
82038203
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.MSIDTestsHostApp;
@@ -8247,7 +8247,7 @@
82478247
INFOPLIST_FILE = MSIDTestsHostApp/Info.plist;
82488248
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
82498249
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
8250-
MACOSX_DEPLOYMENT_TARGET = 10.13;
8250+
MACOSX_DEPLOYMENT_TARGET = 10.15;
82518251
MTL_ENABLE_DEBUG_INFO = NO;
82528252
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.MSIDTestsHostApp;
82538253
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -8441,7 +8441,7 @@
84418441
GCC_WARN_UNUSED_FUNCTION = YES;
84428442
GCC_WARN_UNUSED_VARIABLE = YES;
84438443
MACH_O_TYPE = staticlib;
8444-
MACOSX_DEPLOYMENT_TARGET = 10.13;
8444+
MACOSX_DEPLOYMENT_TARGET = 10.15;
84458445
MTL_ENABLE_DEBUG_INFO = YES;
84468446
ONLY_ACTIVE_ARCH = YES;
84478447
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -8502,7 +8502,7 @@
85028502
GCC_WARN_UNUSED_FUNCTION = YES;
85038503
GCC_WARN_UNUSED_VARIABLE = YES;
85048504
MACH_O_TYPE = staticlib;
8505-
MACOSX_DEPLOYMENT_TARGET = 10.13;
8505+
MACOSX_DEPLOYMENT_TARGET = 10.15;
85068506
MTL_ENABLE_DEBUG_INFO = NO;
85078507
PRODUCT_NAME = "$(TARGET_NAME)";
85088508
SDKROOT = macosx;
@@ -8694,7 +8694,7 @@
86948694
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
86958695
GCC_WARN_UNUSED_FUNCTION = YES;
86968696
GCC_WARN_UNUSED_VARIABLE = YES;
8697-
MACOSX_DEPLOYMENT_TARGET = 10.13;
8697+
MACOSX_DEPLOYMENT_TARGET = 10.15;
86988698
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
86998699
MTL_FAST_MATH = YES;
87008700
ONLY_ACTIVE_ARCH = YES;
@@ -8753,7 +8753,7 @@
87538753
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
87548754
GCC_WARN_UNUSED_FUNCTION = YES;
87558755
GCC_WARN_UNUSED_VARIABLE = YES;
8756-
MACOSX_DEPLOYMENT_TARGET = 10.13;
8756+
MACOSX_DEPLOYMENT_TARGET = 10.15;
87578757
MTL_ENABLE_DEBUG_INFO = NO;
87588758
MTL_FAST_MATH = YES;
87598759
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -8811,7 +8811,7 @@
88118811
"$(inherited)",
88128812
"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks/Swift",
88138813
);
8814-
MACOSX_DEPLOYMENT_TARGET = 10.13;
8814+
MACOSX_DEPLOYMENT_TARGET = 10.15;
88158815
};
88168816
name = Debug;
88178817
};
@@ -8823,7 +8823,7 @@
88238823
"$(inherited)",
88248824
"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks/Swift",
88258825
);
8826-
MACOSX_DEPLOYMENT_TARGET = 10.13;
8826+
MACOSX_DEPLOYMENT_TARGET = 10.15;
88278827
};
88288828
name = Release;
88298829
};
@@ -8837,7 +8837,7 @@
88378837
DEVELOPMENT_TEAM = UBF8T346G9;
88388838
GCC_OPTIMIZATION_LEVEL = 0;
88398839
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
8840-
MACOSX_DEPLOYMENT_TARGET = 10.13;
8840+
MACOSX_DEPLOYMENT_TARGET = 10.15;
88418841
SWIFT_OBJC_BRIDGING_HEADER = "tests/IdentityCoreTests Mac-Bridging-Header.h";
88428842
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
88438843
SWIFT_VERSION = 5.0;
@@ -8853,7 +8853,7 @@
88538853
CODE_SIGN_STYLE = Automatic;
88548854
DEVELOPMENT_TEAM = UBF8T346G9;
88558855
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
8856-
MACOSX_DEPLOYMENT_TARGET = 10.13;
8856+
MACOSX_DEPLOYMENT_TARGET = 10.15;
88578857
SWIFT_OBJC_BRIDGING_HEADER = "tests/IdentityCoreTests Mac-Bridging-Header.h";
88588858
SWIFT_VERSION = 5.0;
88598859
};
@@ -8883,15 +8883,15 @@
88838883
baseConfigurationReference = D6CF4E991FC3626A00CD70C5 /* identitycore__testlib__mac.xcconfig */;
88848884
buildSettings = {
88858885
GCC_OPTIMIZATION_LEVEL = 0;
8886-
MACOSX_DEPLOYMENT_TARGET = 10.13;
8886+
MACOSX_DEPLOYMENT_TARGET = 10.15;
88878887
};
88888888
name = Debug;
88898889
};
88908890
D626FFE81FBD1F5700EE4487 /* Release */ = {
88918891
isa = XCBuildConfiguration;
88928892
baseConfigurationReference = D6CF4E991FC3626A00CD70C5 /* identitycore__testlib__mac.xcconfig */;
88938893
buildSettings = {
8894-
MACOSX_DEPLOYMENT_TARGET = 10.13;
8894+
MACOSX_DEPLOYMENT_TARGET = 10.15;
88958895
};
88968896
name = Release;
88978897
};
@@ -8909,7 +8909,7 @@
89098909
);
89108910
GCC_WARN_SHADOW = YES;
89118911
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
8912-
MACOSX_DEPLOYMENT_TARGET = 10.13;
8912+
MACOSX_DEPLOYMENT_TARGET = 10.15;
89138913
};
89148914
name = Debug;
89158915
};
@@ -8925,7 +8925,7 @@
89258925
);
89268926
GCC_WARN_SHADOW = YES;
89278927
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
8928-
MACOSX_DEPLOYMENT_TARGET = 10.13;
8928+
MACOSX_DEPLOYMENT_TARGET = 10.15;
89298929
};
89308930
name = Release;
89318931
};

IdentityCore/src/IdentityCore_Internal.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@
4747
- (void)SETTER:(NSString *)value { [DICT setValue:[value copy] forKey:KEY]; }
4848

4949
#define STRING_CASE(_CASE) case _CASE: return @#_CASE
50-
#define MSID_ENABLE_SSO_EXTENSION ((__IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 || __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500) && !MSID_EXCLUDE_WEBKIT)
50+
#define MSID_ENABLE_SSO_EXTENSION (!MSID_EXCLUDE_WEBKIT)

IdentityCore/src/broker_operation/request/interactive_token_request/MSIDBrokerOperationInteractiveTokenRequest.m

+2-10
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ @implementation MSIDBrokerOperationInteractiveTokenRequest
3434

3535
+ (void)load
3636
{
37-
if (@available(macOS 10.15, *))
38-
{
39-
[MSIDJsonSerializableFactory registerClass:self forClassType:self.operation];
40-
}
37+
[MSIDJsonSerializableFactory registerClass:self forClassType:self.operation];
4138
}
4239

4340
+ (instancetype)tokenRequestWithParameters:(MSIDInteractiveTokenRequestParameters *)parameters
@@ -66,12 +63,7 @@ + (instancetype)tokenRequestWithParameters:(MSIDInteractiveTokenRequestParameter
6663

6764
+ (NSString *)operation
6865
{
69-
if (@available(macOS 10.15, *))
70-
{
71-
return ASAuthorizationOperationLogin;
72-
}
73-
74-
return @"login";
66+
return ASAuthorizationOperationLogin;
7567
}
7668

7769
#pragma mark - MSIDJsonSerializable

IdentityCore/src/broker_operation/request/silent_token_request/MSIDBrokerOperationSilentTokenRequest.m

+2-10
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ @implementation MSIDBrokerOperationSilentTokenRequest
4040

4141
+ (void)load
4242
{
43-
if (@available(macOS 10.15, *))
44-
{
45-
[MSIDJsonSerializableFactory registerClass:self forClassType:self.operation];
46-
}
43+
[MSIDJsonSerializableFactory registerClass:self forClassType:self.operation];
4744
}
4845

4946
+ (instancetype)tokenRequestWithParameters:(MSIDRequestParameters *)parameters
@@ -64,12 +61,7 @@ + (instancetype)tokenRequestWithParameters:(MSIDRequestParameters *)parameters
6461

6562
+ (NSString *)operation
6663
{
67-
if (@available(macOS 10.15, *))
68-
{
69-
return ASAuthorizationOperationRefresh;
70-
}
71-
72-
return @"refresh";
64+
return ASAuthorizationOperationRefresh;
7365
}
7466

7567
#pragma mark - MSIDJsonSerializable

IdentityCore/src/cache/MSIDKeychainTokenCache.m

+2-11
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,7 @@ - (nullable instancetype)initWithGroup:(nullable NSString *)keychainGroup error:
152152
(id)kSecAttrAccessGroup : self.keychainGroup} mutableCopy];
153153

154154
#ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
155-
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
156-
if (@available(macOS 10.15, *)) {
157-
defaultKeychainQuery[(id)kSecUseDataProtectionKeychain] = @YES;
158-
}
159-
#endif
155+
defaultKeychainQuery[(id)kSecUseDataProtectionKeychain] = @YES;
160156
#endif
161157

162158
self.defaultKeychainQuery = defaultKeychainQuery;
@@ -165,13 +161,8 @@ - (nullable instancetype)initWithGroup:(nullable NSString *)keychainGroup error:
165161
(id)kSecAttrGeneric : [s_wipeLibraryString dataUsingEncoding:NSUTF8StringEncoding],
166162
(id)kSecAttrAccessGroup : self.keychainGroup,
167163
(id)kSecAttrAccount : @"TokenWipe"} mutableCopy];
168-
169164
#ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
170-
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
171-
if (@available(macOS 10.15, *)) {
172-
defaultWipeQuery[(id)kSecUseDataProtectionKeychain] = @YES;
173-
}
174-
#endif
165+
defaultWipeQuery[(id)kSecUseDataProtectionKeychain] = @YES;
175166
#endif
176167

177168
self.defaultWipeQuery = defaultWipeQuery;

IdentityCore/src/cache/crypto/MSIDAssymetricKeyGeneratorFactory.m

+1-8
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,7 @@ @implementation MSIDAssymetricKeyGeneratorFactory
4949
#if !TARGET_OS_IPHONE
5050
+ (id<MSIDAssymetricKeyGenerating>)macDefaultKeyGeneratorWithCacheConfig:(MSIDCacheConfig *)cacheConfig error:(NSError *__autoreleasing*)error
5151
{
52-
if (@available(macOS 10.15, *))
53-
{
54-
return [[MSIDAssymetricKeyKeychainGenerator alloc] initWithGroup:cacheConfig.keychainGroup error:error];
55-
}
56-
else
57-
{
58-
return [[MSIDAssymetricKeyLoginKeychainGenerator alloc] initWithKeychainGroup:cacheConfig.keychainGroup accessRef:cacheConfig.accessRef error:error];
59-
}
52+
return [[MSIDAssymetricKeyKeychainGenerator alloc] initWithGroup:cacheConfig.keychainGroup error:error];
6053
}
6154
#endif
6255

IdentityCore/src/cache/crypto/MSIDAssymetricKeyKeychainGenerator.m

+1-6
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,8 @@ - (MSIDAssymetricKeyPair *)generateKeyPairForKeyDict:(NSDictionary *)attributes
268268
- (NSDictionary *)additionalPlatformKeychainAttributes
269269
{
270270
#ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
271-
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
272-
if (@available(macOS 10.15, *)) {
273-
return @{(id)kSecUseDataProtectionKeychain : @YES};
274-
}
275-
#endif
271+
return @{(id)kSecUseDataProtectionKeychain : @YES};
276272
#endif
277-
278273
return nil;
279274
}
280275

IdentityCore/src/cache/crypto/MSIDAssymetricKeyPair.m

-5
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,8 @@ - (NSDate *)creationDate
247247
privateKeyQuery[(id)kSecAttrLabel] = [self.privateKeyDict objectForKey:(id)kSecAttrLabel];
248248
privateKeyQuery[(id)kSecReturnRef] = @YES;
249249
privateKeyQuery[(id)kSecReturnAttributes] = @YES;
250-
251250
#ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
252-
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
253-
if (@available(macOS 10.15, *)) {
254251
privateKeyQuery[(id)kSecUseDataProtectionKeychain] = @YES;
255-
}
256-
#endif
257252
#endif
258253

259254
CFDictionaryRef result = nil;

IdentityCore/src/cache/mac/MSIDMacKeychainTokenCache.m

+17-36
Original file line numberDiff line numberDiff line change
@@ -367,25 +367,17 @@ + (MSIDMacKeychainTokenCache *)defaultKeychainCache
367367

368368
- (BOOL)shouldUseLoginKeychain
369369
{
370-
if (@available(macOS 10.15, *))
370+
if ([[NSUserDefaults standardUserDefaults] boolForKey:kLoginKeychainEmptyKey])
371371
{
372-
373-
if ([[NSUserDefaults standardUserDefaults] boolForKey:kLoginKeychainEmptyKey])
374-
{
375372
#if MS_INTERNAL_BUILD
376-
return ![MSIDKeychainUtil sharedInstance].isAppEntitled;
373+
return ![MSIDKeychainUtil sharedInstance].isAppEntitled;
377374
#else
378-
return NO;
375+
return NO;
379376
#endif
380-
}
381-
else
382-
{
383-
// if kLoginKeychainEmptyKey is not set
384-
return YES;
385-
}
386377
}
387378
else
388379
{
380+
// if kLoginKeychainEmptyKey is not set
389381
return YES;
390382
}
391383
}
@@ -411,18 +403,15 @@ - (nullable instancetype)initWithGroup:(nullable NSString *)keychainGroup
411403
self = [super initWithTrustedApplications:trustedApplications accessLabel:s_defaultKeychainLabel error:error];
412404
if (self)
413405
{
414-
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
415406
if (![self shouldUseLoginKeychain]) {
416-
if (error)
417-
{
418-
*error = MSIDCreateError(MSIDErrorDomain, MSIDErrorInternal, @"Not creating login keychain for performance optimization on macOS 10.15, because no items where previously found in it", nil, nil, nil, nil, nil, NO);
419-
}
420-
421-
MSID_LOG_WITH_CTX(MSIDLogLevelWarning, nil, @"Not creating login keychain for performance optimization on macOS 10.15, because no items where previously found in it");
422-
return nil;
407+
if (error)
408+
{
409+
*error = MSIDCreateError(MSIDErrorDomain, MSIDErrorInternal, @"Not creating login keychain for performance optimization on macOS 10.15, because no items where previously found in it", nil, nil, nil, nil, nil, NO);
423410
}
424-
425-
#endif
411+
412+
MSID_LOG_WITH_CTX(MSIDLogLevelWarning, nil, @"Not creating login keychain for performance optimization on macOS 10.15, because no items where previously found in it");
413+
return nil;
414+
}
426415

427416
self.appStorageItem = [MSIDMacCredentialStorageItem new];
428417
self.sharedStorageItem = [MSIDMacCredentialStorageItem new];
@@ -825,14 +814,12 @@ - (MSIDMacCredentialStorageItem *)queryStorageItem:(BOOL)isShared
825814
error:(NSError *__autoreleasing*)error
826815
{
827816
MSID_TRACE;
828-
829-
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
817+
830818
if (![self shouldUseLoginKeychain])
831819
{
832820
MSID_LOG_WITH_CTX(MSIDLogLevelWarning, context, @"Skipping login keychain read because it has been previously marked as empty on 10.15");
833821
return nil;
834822
}
835-
#endif
836823

837824
MSIDMacCredentialStorageItem *storageItem = nil;
838825
NSMutableDictionary *query = [self.defaultCacheQuery mutableCopy];
@@ -869,18 +856,12 @@ - (MSIDMacCredentialStorageItem *)queryStorageItem:(BOOL)isShared
869856
{
870857
storageItemIsEmpty = YES;
871858
}
872-
873-
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
874-
if (@available(macOS 10.15, *)) {
875-
876-
// Performance optimization on 10.15. If we've read shared item once and we didn't find it, or it was empty, save a flag into user defaults such as we stop looking into the login keychain altogether
877-
if (isShared && storageItemIsEmpty)
878-
{
879-
MSID_LOG_WITH_CTX(MSIDLogLevelWarning, context, @"Saving a flag to stop looking into login keychain, as it doesn't contain any items");
880-
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kLoginKeychainEmptyKey];
881-
}
859+
860+
if (isShared && storageItemIsEmpty)
861+
{
862+
MSID_LOG_WITH_CTX(MSIDLogLevelWarning, context, @"Saving a flag to stop looking into login keychain, as it doesn't contain any items");
863+
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kLoginKeychainEmptyKey];
882864
}
883-
#endif
884865

885866
return storageItem;
886867
}

0 commit comments

Comments
 (0)