Skip to content

Commit 51f1bbc

Browse files
authored
Merge branch 'dev' into sedemche/browser_core_mats
2 parents 926eb3d + 8d78d3c commit 51f1bbc

17 files changed

+281
-11
lines changed

IdentityCore/IdentityCore.xcodeproj/project.pbxproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,9 @@
746746
728209D026FEA0F600B5F018 /* MSIDKeyOperationUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 728209CF26FEA0F600B5F018 /* MSIDKeyOperationUtil.m */; };
747747
728209D126FEA0F600B5F018 /* MSIDKeyOperationUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 728209CF26FEA0F600B5F018 /* MSIDKeyOperationUtil.m */; };
748748
728209D62702AF8900B5F018 /* MSIDBackgroundTaskManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 728209D32702AE9300B5F018 /* MSIDBackgroundTaskManagerTests.m */; };
749+
728ABACC2E5A3B4E00FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 728ABACB2E5A3B2800FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.h */; };
750+
728ABACE2E5A41A800FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m in Sources */ = {isa = PBXBuildFile; fileRef = 728ABACD2E5A418F00FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m */; };
751+
728ABACF2E5A41A800FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m in Sources */ = {isa = PBXBuildFile; fileRef = 728ABACD2E5A418F00FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m */; };
749752
728D9E4628245DD7001D990F /* MSIDTestSecureEnclaveKeyPairGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 728D9E4528245DD7001D990F /* MSIDTestSecureEnclaveKeyPairGenerator.m */; };
750753
728D9E4728245DD7001D990F /* MSIDTestSecureEnclaveKeyPairGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 728D9E4528245DD7001D990F /* MSIDTestSecureEnclaveKeyPairGenerator.m */; };
751754
728D9E492824A323001D990F /* MSIDPkeyAuthHelperTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CA0C5E220A68D400768729 /* MSIDPkeyAuthHelperTests.m */; };
@@ -2662,6 +2665,8 @@
26622665
728209CD26FEA0D800B5F018 /* MSIDKeyOperationUtil.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDKeyOperationUtil.h; sourceTree = "<group>"; };
26632666
728209CF26FEA0F600B5F018 /* MSIDKeyOperationUtil.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDKeyOperationUtil.m; sourceTree = "<group>"; };
26642667
728209D32702AE9300B5F018 /* MSIDBackgroundTaskManagerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDBackgroundTaskManagerTests.m; sourceTree = "<group>"; };
2668+
728ABACB2E5A3B2800FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MSIDWPJKeyPairWithCert+TransportKey.h"; sourceTree = "<group>"; };
2669+
728ABACD2E5A418F00FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "MSIDWPJKeyPairWithCert+TransportKey.m"; sourceTree = "<group>"; };
26652670
728D9E4528245DD7001D990F /* MSIDTestSecureEnclaveKeyPairGenerator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDTestSecureEnclaveKeyPairGenerator.m; sourceTree = "<group>"; };
26662671
728D9E4828247D4C001D990F /* MSIDTestSecureEnclaveKeyPairGenerator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDTestSecureEnclaveKeyPairGenerator.h; sourceTree = "<group>"; };
26672672
729357E72DD810C70001D03C /* MSIDNonceTokenRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDNonceTokenRequest.h; sourceTree = "<group>"; };
@@ -5181,6 +5186,8 @@
51815186
B2C0747E246B70DC0008D701 /* crypto */ = {
51825187
isa = PBXGroup;
51835188
children = (
5189+
728ABACD2E5A418F00FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m */,
5190+
728ABACB2E5A3B2800FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.h */,
51845191
B27893792470CAF200627C28 /* mac */,
51855192
B2C0748E246B71470008D701 /* MSIDAssymetricKeyGenerating.h */,
51865193
B2C07490246B735B0008D701 /* MSIDAssymetricKeyKeychainGenerator.h */,
@@ -6143,6 +6150,7 @@
61436150
A07EB427259D0C6B00783943 /* MSIDThrottlingService.h in Headers */,
61446151
9658103120C7E1180025F4A4 /* MSIDWebviewResponse.h in Headers */,
61456152
1E707FDF2407335700716148 /* MSIDBrokerNativeAppOperationResponse.h in Headers */,
6153+
728ABACC2E5A3B4E00FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.h in Headers */,
61466154
B28BDA7F217E964B003E5670 /* MSIDB2CTokenResponse.h in Headers */,
61476155
96B8D57D20946D2600E3F4A6 /* MSIDPkce.h in Headers */,
61486156
B286B9912389DC47007833AD /* MSIDIndividualClaimRequest.h in Headers */,
@@ -7390,6 +7398,7 @@
73907398
23C8981A2C892A3800071482 /* MSIDBrowserNativeMessageGetSupportedContractsResponse.m in Sources */,
73917399
B286B9992389DC9D007833AD /* MSIDSSOExtensionSilentTokenRequest.m in Sources */,
73927400
B2C7089921991D0000D917B8 /* MSIDAADV2BrokerResponse.m in Sources */,
7401+
728ABACE2E5A41A800FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m in Sources */,
73937402
B20E3CB61FC4FE400029C097 /* MSIDOAuth2Constants.m in Sources */,
73947403
B2BE924D21A2331A00F5AB8C /* MSIDTelemetryAuthorityValidationEvent.m in Sources */,
73957404
B2807FF9204CAFDF00944D89 /* MSIDHelpers.m in Sources */,
@@ -8097,6 +8106,7 @@
80978106
239E3BBF23E1004F00F7A50A /* MSIDClientSDKType.m in Sources */,
80988107
23B39ABD209BD47D000AA905 /* MSIDB2CAuthorityResolver.m in Sources */,
80998108
B2F671E92467A34400649855 /* MSIDAuthorizationCodeResult.m in Sources */,
8109+
728ABACF2E5A41A800FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m in Sources */,
81008110
23C10A9F2B40D9350063D97C /* MSIDBrowserNativeMessageSignOutResponse.m in Sources */,
81018111
23FB5C2B225517AA002BF1EB /* MSIDIndividualClaimRequestAdditionalInfo.m in Sources */,
81028112
1E707FDD2406FA9200716148 /* MSIDBrokerBrowserOperationResponse.m in Sources */,

IdentityCore/src/broker_operation/request/token_request/MSIDBrokerOperationTokenRequest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN
5050
@property (nonatomic) BOOL skipValidateResultAccount;
5151
@property (nonatomic) BOOL forceRefresh;
5252
@property (nonatomic) BOOL ignoreScopeValidation;
53-
53+
@property (nonatomic) BOOL bypassRedirectURIValidation;
5454

5555
+ (BOOL)fillRequest:(MSIDBrokerOperationTokenRequest *)request
5656
withParameters:(MSIDRequestParameters *)parameters

IdentityCore/src/broker_operation/request/token_request/MSIDBrokerOperationTokenRequest.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ + (BOOL)fillRequest:(MSIDBrokerOperationTokenRequest *)request
6868
request.platformSequence = parameters.platformSequence;
6969
request.allowAnyExtraURLQueryParameters = parameters.allowAnyExtraURLQueryParameters;
7070
request.ignoreScopeValidation = parameters.ignoreScopeValidation;
71+
request.bypassRedirectURIValidation = parameters.bypassRedirectURIValidation;
7172
return YES;
7273
}
7374

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// Copyright (c) Microsoft Corporation.
3+
// All rights reserved.
4+
//
5+
// This code is licensed under the MIT License.
6+
//
7+
// Permission is hereby granted, free of charge, to any person obtaining a copy
8+
// of this software and associated documentation files(the "Software"), to deal
9+
// in the Software without restriction, including without limitation the rights
10+
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
11+
// copies of the Software, and to permit persons to whom the Software is
12+
// furnished to do so, subject to the following conditions :
13+
//
14+
// The above copyright notice and this permission notice shall be included in
15+
// all copies or substantial portions of the Software.
16+
//
17+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
// THE SOFTWARE.
24+
25+
#import <Foundation/Foundation.h>
26+
27+
NS_ASSUME_NONNULL_BEGIN
28+
@interface MSIDWPJKeyPairWithCert (TransportKey)
29+
30+
@property (nonatomic) SecKeyRef privateTransportKeyRef;
31+
32+
@end
33+
NS_ASSUME_NONNULL_END
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
//
2+
// Copyright (c) Microsoft Corporation.
3+
// All rights reserved.
4+
//
5+
// This code is licensed under the MIT License.
6+
//
7+
// Permission is hereby granted, free of charge, to any person obtaining a copy
8+
// of this software and associated documentation files(the "Software"), to deal
9+
// in the Software without restriction, including without limitation the rights
10+
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
11+
// copies of the Software, and to permit persons to whom the Software is
12+
// furnished to do so, subject to the following conditions :
13+
//
14+
// The above copyright notice and this permission notice shall be included in
15+
// all copies or substantial portions of the Software.
16+
//
17+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
// THE SOFTWARE.
24+
25+
#import "MSIDWPJKeyPairWithCert.h"
26+
#import "MSIDWPJKeyPairWithCert+TransportKey.h"
27+
28+
@implementation MSIDWPJKeyPairWithCert (TransportKey)
29+
30+
- (void)setPrivateTransportKeyRef:(SecKeyRef)privateTransportKeyRef
31+
{
32+
if (_privateTransportKeyRef != privateTransportKeyRef)
33+
{
34+
if (_privateTransportKeyRef)
35+
{
36+
CFRelease(_privateTransportKeyRef);
37+
_privateTransportKeyRef = NULL;
38+
}
39+
40+
_privateTransportKeyRef = privateTransportKeyRef;
41+
42+
if (_privateTransportKeyRef)
43+
{
44+
CFRetain(_privateTransportKeyRef);
45+
}
46+
}
47+
}
48+
49+
@end

IdentityCore/src/cache/crypto/MSIDWPJKeyPairWithCert.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ typedef NS_ENUM(NSInteger, MSIDWPJKeychainAccessGroup)
4747
NSString *_certificateSubject;
4848
NSString *_certificateIssuer;
4949
SecKeyRef _privateKeyRef;
50+
SecKeyRef _privateTransportKeyRef;
5051
}
5152

5253
@property (nonatomic, readonly) SecKeyRef privateKeyRef;
@@ -55,6 +56,8 @@ typedef NS_ENUM(NSInteger, MSIDWPJKeychainAccessGroup)
5556
@property (nonatomic, readonly) NSString *certificateSubject;
5657
@property (nonatomic, readonly) NSString *certificateIssuer;
5758
@property (nonatomic) MSIDWPJKeychainAccessGroup keyChainVersion;
59+
// The private session transport key. Only populated if the private STK is stored in the secure enclave.
60+
@property (nonatomic, readonly) SecKeyRef privateTransportKeyRef;
5861

5962
- (nullable instancetype)initWithPrivateKey:(SecKeyRef)privateKey
6063
certificate:(SecCertificateRef)certificate

IdentityCore/src/cache/crypto/MSIDWPJKeyPairWithCert.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ - (void)dealloc
101101
CFRelease(_privateKeyRef);
102102
_privateKeyRef = NULL;
103103
}
104+
105+
if (_privateTransportKeyRef)
106+
{
107+
CFRelease(_privateTransportKeyRef);
108+
_privateTransportKeyRef = NULL;
109+
}
104110
}
105111

106112
@end

IdentityCore/src/oauth2/MSIDExternalSSOContext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
3737
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 130000
3838
@property (nonatomic, nullable, strong) ASAuthorizationProviderExtensionLoginManager *loginManager API_AVAILABLE(macos(13.0));
3939
@property (nonatomic) BOOL isDeviceRegistered API_AVAILABLE(macos(13.0));
40+
@property (nonatomic) BOOL isPlatformSSORegistrationFlow API_AVAILABLE(macos(13.0));
4041
#endif
4142
#endif
4243

IdentityCore/src/oauth2/token/MSIDPrimaryRefreshToken.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ typedef NS_ENUM(NSInteger, MSIDExternalPRTKeyLocationType)
4949
@property (nonatomic) MSIDExternalPRTKeyLocationType externalKeyLocationType;
5050

5151
- (BOOL)isDevicelessPRT;
52+
- (BOOL)isDevicelessPRTv3;
5253
- (BOOL)shouldRefreshWithInterval:(NSUInteger)refreshInterval;
5354
- (NSUInteger)prtId;
5455

IdentityCore/src/oauth2/token/MSIDPrimaryRefreshToken.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ - (BOOL)isDevicelessPRT
216216
return prtVersion >= 3.0 && [NSString msidIsStringNilOrBlank:self.deviceID];
217217
}
218218

219+
- (BOOL)isDevicelessPRTv3
220+
{
221+
CGFloat prtVersion = [self.prtProtocolVersion floatValue];
222+
return prtVersion == 3.0 && [NSString msidIsStringNilOrBlank:self.deviceID];
223+
}
224+
219225
- (BOOL)shouldRefreshWithInterval:(NSUInteger)refreshInterval
220226
{
221227
if (!self.expiresOn)

0 commit comments

Comments
 (0)