SecTrustEvaluate/SecTrustEvaluateWithError behavior change in iOS 14b2 and 13.6b3

With iOS 13.6 beta 3 and iOS 14.0 beta 2 we have observed a change in behavior for SecTrustEvaluate(_:_:)/SecTrustEvaluateWithError(_:_:) when evaluating trust chains with custom CAs. Previously when evaluating certificates issued from our own CA, we would expect a result of kSecTrustResultUnspecified as the CA wasn't explicitly trusted by the user. We now see that kSecTrustRecoverableTrustFailure is returned and if we inspect the error from SecTrustEvaluateWithError(_:_:) we see can see that the error is errSecNoBasicConstraintsCA.

Upon closer investigation of our CA cert we see that the "Basic Constraints" extension has been set twice:

Code Block
X509v3 Basic Constraints: critical
CA:TRUE
X509v3 Basic Constraints:
CA:FALSE

This is clearly an issue with our certificate, however it has been working for the past 2+ years. As the CA cert is bundled with our apps, this will require all apps to be updated and re-released. Critically, because the trust evaluation has changed apps treat it as a security error and immediately exit.

Is this behavior change intended and permanent?
Accepted Answer

Is this behavior change intended and permanent?

I don’t know for sure, but I suspect so. Our platforms have been getting steadily more rigorous about rejecting malformed certificates over the past few releases.

Still, if this change is causing you serious grief, you should file a bug about it, explaining clearly the level of grief it’s causing. That’s kinda why we have a beta cycle (-:

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Thanks for the quick reply! I've filed a bug with sample code and the ID is FB7878529.

We also raised a DTS request which we can provide a reference for, although I'm not sure they'll look at it as it's a beta issue.
SecTrustEvaluate/SecTrustEvaluateWithError behavior change in iOS 14b2 and 13.6b3
 
 
Q