authorgravatar for ryan@zinascii.comRyan Zezeski <ryan@zinascii.com> 2023-09-26 16:05:24-06:00
committergravatar for ryan@zinascii.comRyan Zezeski <ryan@zinascii.com> 2023-09-30 11:38:56-06:00
log68bcd7ddd44422b228852cd36158048becfbeea8
treee321cd4484f9969a388ddcb7962e696bc030ee4c
parentc17ebdca6afef9523a69caeaea090cd537d71945

solaris: load CA certs file


1 files changed, 10 insertions(+), 0 deletions(-)

lib/std/crypto/Certificate/Bundle.zig+10
...@@ -64,6 +64,7 @@ pub fn rescan(cb: *Bundle, gpa: Allocator) RescanError!void {...@@ -64,6 +64,7 @@ pub fn rescan(cb: *Bundle, gpa: Allocator) RescanError!void {
64 .netbsd => return rescanBSD(cb, gpa, "/etc/openssl/certs/ca-certificates.crt"),64 .netbsd => return rescanBSD(cb, gpa, "/etc/openssl/certs/ca-certificates.crt"),
65 .dragonfly => return rescanBSD(cb, gpa, "/usr/local/etc/ssl/cert.pem"),65 .dragonfly => return rescanBSD(cb, gpa, "/usr/local/etc/ssl/cert.pem"),
66 .windows => return rescanWindows(cb, gpa),66 .windows => return rescanWindows(cb, gpa),
67 .solaris => return rescanSolaris(cb, gpa, "/etc/ssl/cacert.pem"),
67 else => {},68 else => {},
68 }69 }
69}70}
...@@ -151,6 +152,15 @@ fn rescanWindows(cb: *Bundle, gpa: Allocator) RescanWindowsError!void {...@@ -151,6 +152,15 @@ fn rescanWindows(cb: *Bundle, gpa: Allocator) RescanWindowsError!void {
151 cb.bytes.shrinkAndFree(gpa, cb.bytes.items.len);152 cb.bytes.shrinkAndFree(gpa, cb.bytes.items.len);
152}153}
153154
155const RescanSolarisError = AddCertsFromFilePathError;
156
157fn rescanSolaris(cb: *Bundle, gpa: Allocator, cert_file_path: []const u8) RescanSolarisError!void {
158 cb.bytes.clearRetainingCapacity();
159 cb.map.clearRetainingCapacity();
160 try addCertsFromFilePathAbsolute(cb, gpa, cert_file_path);
161 cb.bytes.shrinkAndFree(gpa, cb.bytes.items.len);
162}
163
154pub const AddCertsFromDirPathError = fs.File.OpenError || AddCertsFromDirError;164pub const AddCertsFromDirPathError = fs.File.OpenError || AddCertsFromDirError;
155165
156pub fn addCertsFromDirPath(166pub fn addCertsFromDirPath(