-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
MacOS CA Bundle regression after b3a11018ae1fe99190fb6fb7ae82a486c40f6f15 #22870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
FYI @dreilly1982 We'll have to revert that PR if this can't be fixed in time for 0.14.0. |
That is odd, I'll look into this today. |
The bundle properly loads if the order of the keychains is switched: diff --git a/lib/std/crypto/Certificate/Bundle/macos.zig b/lib/std/crypto/Certificate/Bundle/macos.zig
index 7fb16af543..4589adb217 100644
--- a/lib/std/crypto/Certificate/Bundle/macos.zig
+++ b/lib/std/crypto/Certificate/Bundle/macos.zig
@@ -12,8 +12,8 @@ pub fn rescanMac(cb: *Bundle, gpa: Allocator) RescanMacError!void {
cb.map.clearRetainingCapacity();
const keychainPaths = [2][]const u8{
- "/System/Library/Keychains/SystemRootCertificates.keychain",
"/Library/Keychains/System.keychain",
+ "/System/Library/Keychains/SystemRootCertificates.keychain",
};
for (keychainPaths) |keychainPath| { |
So I couldn't reproduce your issue on my end, but swapping the order didn't affect my functionality. What is weird, and I'm looking into it, is the cb.bytes.items.len IS different based of the order, which I find odd. I'm looking more into this tonight. |
If it helps, I can also try to repro this with and w/o this change. I seem to be hitting this regression too. I just don't know where to download aarch64 macOS builds of zig for past changes, I can only find the latest master. EDIT: I got some help finding the right nightlies. Here's a log of when the problem started happening:
|
…in for MacOS CA Bundle" This reverts commit b3a1101. Closes ziglang#22870.
In the original PR that implemented this (ziglang#14325), it included a list of references for the keychain format. Multiple of those references include the checks that are added in this commit, and empirically this fixes the loading of a real keychain file that was previously failing (it had both a record with offset 0 and a record with cert_size 0). Fixes ziglang#22870
In the original PR that implemented this (ziglang#14325), it included a list of references for the keychain format. Multiple of those references include the checks that are added in this commit, and empirically this fixes the loading of a real keychain file that was previously failing (it had both a record with offset 0 and a record with cert_size 0). Fixes ziglang#22870
Zig Version
0.14.0-dev.3213+53216d2f2
Steps to Reproduce and Observed Behavior
After b3a1101 , root CAs are not properly loaded any more on macOS.
Random example while trying to compile
zls
:Reverting b3a1101 fixes this.
Expected Behavior
root CAs can be loaded.
The text was updated successfully, but these errors were encountered: