mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
std.crypto.Certificate.Bundle: clear bundle before macOS rescan
This commit is contained in:
parent
f3107e2cb2
commit
40c400ec9e
@ -6,6 +6,9 @@ const Allocator = std.mem.Allocator;
|
||||
const Bundle = @import("../Bundle.zig");
|
||||
|
||||
pub fn rescanMac(cb: *Bundle, gpa: Allocator) !void {
|
||||
cb.bytes.clearRetainingCapacity();
|
||||
cb.map.clearRetainingCapacity();
|
||||
|
||||
const file = try fs.openFileAbsolute("/System/Library/Keychains/SystemRootCertificates.keychain", .{});
|
||||
defer file.close();
|
||||
|
||||
@ -63,6 +66,8 @@ pub fn rescanMac(cb: *Bundle, gpa: Allocator) !void {
|
||||
try cb.parseCert(gpa, cert_start, now_sec);
|
||||
}
|
||||
}
|
||||
|
||||
cb.bytes.shrinkAndFree(gpa, cb.bytes.items.len);
|
||||
}
|
||||
|
||||
const ApplDbHeader = extern struct {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user