Post

Replies

Boosts

Views

Activity

SecKeyIsAlgorithmSupported crashes on macOS
When calling SecKeyIsAlgorithmSupported (https://developer.apple.com/documentation/security/1644057-seckeyisalgorithmsupported?language=objc) with private key from secure enclave and parameters for algorithms and operations commonly not used for private keys causes crash on macOS. Same call with same parameters work on iOS. I'm unit testing a utility with private key stored in secure enclave. When I call SecKeyIsAlgorithmSupported(:::) as below causes crash on macOS but not on iOS SecKeyIsAlgorithmSupported(self.eccPrivateKey, kSecKeyOperationTypeVerify, kSecKeyAlgorithmECDSASignatureDigestX962SHA256); //where self.eccPrivateKey is key in secure enclave on my mac book pro. Also crashes for these parameters : SecKeyIsAlgorithmSupported(self.eccPrivateKey, kSecKeyOperationTypeEncrypt, kSecKeyAlgorithmECIESEncryptionCofactorX963SHA256AESGCM); Crash `2021-09-29 22:36:28.949061-0700 MSIDTestHostAppMac[98643:1430360] *** Assertion failure in CFTypeRef TKTokenCopyOperationResult(TKTokenRef, CFDataRef, CFIndex, CFArrayRef, CFIndex, CFTypeRef, CFTypeRef, CFErrorRef *)(), ctkclient.m:519 2021-09-29 22:36:28.955505-0700 MSIDTestHostAppMac[98643:1430360] [General] An uncaught exception was raised 2021-09-29 22:36:28.955662-0700 MSIDTestHostAppMac[98643:1430360] [General] Invalid keyOperation 1 requested 2021-09-29 22:36:28.955802-0700 MSIDTestHostAppMac[98643:1430360] [General] ( 0 CoreFoundation 0x00007fff206641db __exceptionPreprocess + 242 1 libobjc.A.dylib 0x00007fff2039dd92 objc_exception_throw + 48 2 CoreFoundation 0x00007fff2068d352 +[NSException raise:format:arguments:] + 88 3 Foundation 0x00007fff214892ec -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 166 4 Security 0x00007fff223fc7bd TKTokenCopyOperationResult + 381 5 Security 0x00007fff2245abcf __SecCTKKeyCopyOperationResult_block_invoke + 453 6 Security 0x00007fff224522b8 SecItemAuthDo + 103 7 Security 0x00007fff2245a6d2 SecCTKKeyCopyOperationResult + 480 8 Security 0x00007fff2245f13a SecKeyRunAlgorithmAndCopyResult + 251 9 Security 0x00007fff22460db5 SecKeyIsAlgorithmSupported + 100 10 IdentityCoreTests 0x0000000110130445 +[MSIDKeyOperationUtil isOperationSupportedByKey:algorithm:key:context:error:] + 325 11 IdentityCoreTests 0x000000010fe3cde7 -[MSIDKeyOperationUtilTest testIfOperationIsSupportedByKey] + 7287 12 CoreFoundation 0x00007fff205cd6fc __invoking___ + 140 13 CoreFoundation 0x00007fff205cd59d -[NSInvocation invoke] + 305 14 XCTest 0x000000010edc61f7 +[XCTFailableInvocation invokeStandardConventionInvocation:completion:] + 64 15 XCTest 0x000000010edc61b5 __65+[XCTFailableInvocation invokeInvocation:lastObservedErrorIssue:]_block_invoke_3 + 23 16 XCTest 0x000000010edc5c5b __81+[XCTFailableInvocation invokeWithAsynchronousWait:lastObservedErrorIssue:block:]_block_invoke.11 + 71 17 XCTest 0x000000010ee8ab0d +[XCTSwiftErrorObservation observeErrorsInBlock:] + 113` The same calls do not crash on iOS and correctly return NO Have opened a feedback : 9665871 as well
0
0
610
Sep ’21
Different SSO behavior for ASWebAuthenticationSession in iOS 14
In our app we're performing authentication using ASWebAuthenticationSession. SSO seems to work fine in iOS 13 for different paths for the same domain but when running the same app in iOS 14, cookies don't seem to be attached to subsequent requests once authenticated in safari window. I'm not sure if it helps : Looking at the logging in instruments when running the app in iOS 14 device, I can see : 00:09.690.903 Default iOS B2c Sample (1691) CFNetwork Default iOS B2c Sample 0x1631f Faulting in NSHTTPCookieStorage singleton 00:09.690.929 Default iOS B2c Sample (1691) CFNetwork Default iOS B2c Sample 0x1631f Faulting in CFHTTPCookieStorage singleton 00:09.690.944 Default iOS B2c Sample (1691) CFNetwork Default iOS B2c Sample 0x1631f Creating default cookie storage with default identifier (Above logs don't happen in iOS 13) and later in iOS 14: 00:10.113.701 Debug iOS B2c Sample (1691) CFNetwork Default iOS B2c Sample 0x1631c Task <88E60E41-6B7B-4787-ABF6-B65C92C8FF4E>.<1> request https://testb2c.b2clogin.com/testb2c.onmicrosoft.com/b2c_1_susi/oauth2/v2.0/token is NOT allowed to set HSTS for main doc  In iOS 13 : 00:15.570.171 Debug iOSB2C (5320) CFNetwork Default iOSB2C 0x24045d Task <79A2078B-718D-4D4D-A46D-1FF1B2238431>.<6> request n/a is NOT allowed to set HSTS for main doc  00:23.139.303 Debug iOSB2C (5320) CFNetwork Default iOSB2C 0x24045d Task <88D45825-FB1E-4C38-8EFF-87A8528B61E3>.<7> request n/a is NOT allowed to set HSTS for main doc  Has anyone noticed similar issue with ASWebAuthenticationSession?
19
0
8.9k
Oct ’20