mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
openbsd: add root certificate scanning
patch by @bilaliscarioth, thank you! closes #16168
This commit is contained in:
parent
43c98dc115
commit
614bc6755e
1 changed files with 14 additions and 0 deletions
|
|
@ -60,6 +60,7 @@ pub fn rescan(cb: *Bundle, gpa: Allocator) RescanError!void {
|
||||||
switch (builtin.os.tag) {
|
switch (builtin.os.tag) {
|
||||||
.linux => return rescanLinux(cb, gpa),
|
.linux => return rescanLinux(cb, gpa),
|
||||||
.macos => return rescanMac(cb, gpa),
|
.macos => return rescanMac(cb, gpa),
|
||||||
|
.openbsd => return rescanOpenBSD(cb, gpa),
|
||||||
.windows => return rescanWindows(cb, gpa),
|
.windows => return rescanWindows(cb, gpa),
|
||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
|
|
@ -112,6 +113,19 @@ pub fn rescanLinux(cb: *Bundle, gpa: Allocator) RescanLinuxError!void {
|
||||||
cb.bytes.shrinkAndFree(gpa, cb.bytes.items.len);
|
cb.bytes.shrinkAndFree(gpa, cb.bytes.items.len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub const RescanOpenBSDError = AddCertsFromFilePathError;
|
||||||
|
|
||||||
|
pub fn rescanOpenBSD(cb: *Bundle, gpa: Allocator) RescanOpenBSDError!void {
|
||||||
|
const cert_file_path = "/etc/ssl/cert.pem";
|
||||||
|
|
||||||
|
cb.bytes.clearRetainingCapacity();
|
||||||
|
cb.map.clearRetainingCapacity();
|
||||||
|
|
||||||
|
addCertsFromFilePathAbsolute(cb, gpa, cert_file_path) catch |err| return err;
|
||||||
|
|
||||||
|
cb.bytes.shrinkAndFree(gpa, cb.bytes.items.len);
|
||||||
|
}
|
||||||
|
|
||||||
pub const RescanWindowsError = Allocator.Error || ParseCertError || std.os.UnexpectedError || error{FileNotFound};
|
pub const RescanWindowsError = Allocator.Error || ParseCertError || std.os.UnexpectedError || error{FileNotFound};
|
||||||
|
|
||||||
pub fn rescanWindows(cb: *Bundle, gpa: Allocator) RescanWindowsError!void {
|
pub fn rescanWindows(cb: *Bundle, gpa: Allocator) RescanWindowsError!void {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue