Skip to content

honour Keychain trust settings when loading macOS system CAs - #2641

Merged
yhirose merged 2 commits into
yhirose:masterfrom
metsw24-max:macos-keychain-trust-settings
Oct 26, 2026
Merged

yhirose merged 2 commits into
yhirose:masterfrom
metsw24-max:macos-keychain-trust-settings

Conversation

@metsw24-max

Copy link
Copy Markdown
Contributor

Distrusted Keychain roots loaded as trusted CAs on macOS
The system CA loader takes every certificate that has Trust Settings in the system, admin or user domain as a trusted root without reading those settings, so a root set to "Never Trust" in Keychain Access, or trusted only for S/MIME or code signing, still verifies TLS servers. The loader now evaluates the settings for the SSL policy, with the user domain overriding admin and system, and the OpenSSL path shares the helper Mbed TLS and wolfSSL use.

Reviewer note: the decision follows SecTrustSettings.h (empty array means TrustRoot, first applicable usage constraint decides) and matches what Go's crypto/x509 did for the same issue; the unit test covers the shapes Keychain Access writes, since trust settings cannot be changed from a test without a GUI authorisation prompt.

@yhirose
yhirose merged commit ba32b46 into yhirose:master Oct 26, 2026
27 of 29 checks passed
@yhirose

yhirose commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants