authorgravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2026-04-11 13:39:49+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-04-12 00:13:59+02:00
logbc08199ef1f9419b5b8ed4165458783314934266
tree0acc889dae07e4712e0d314a1aa28f14424f6dba
parent41bc507688e21f8f8baffbb0da7026d6328beb1a

crypto TLS bundle: make AddCertsFromDirPathError compile

It's calling `addCertsFromDir`, which now requires a timestamp, so it didn't compile any more. Add a test by the way.

1 files changed, 15 insertions(+), 1 deletions(-)

lib/std/crypto/Certificate/Bundle.zig+15-1
......@@ -184,7 +184,8 @@ pub fn addCertsFromDirPath(
184184) AddCertsFromDirPathError!void {
185185 var iterable_dir = try dir.openDir(io, sub_dir_path, .{ .iterate = true });
186186 defer iterable_dir.close(io);
187 return addCertsFromDir(cb, gpa, io, iterable_dir);
187 const now = Io.Clock.real.now(io);
188 return addCertsFromDir(cb, gpa, io, now, iterable_dir);
188189}
189190
190191pub fn addCertsFromDirPathAbsolute(
......@@ -331,6 +332,19 @@ const MapContext = struct {
331332 }
332333};
333334
335test "addCertsFromDirPath compiles and accepts an empty directory" {
336 const io = std.testing.io;
337 const gpa = std.testing.allocator;
338
339 var tmp = std.testing.tmpDir(.{ .iterate = true });
340 defer tmp.cleanup();
341
342 var bundle: Bundle = .empty;
343 defer bundle.deinit(gpa);
344
345 try bundle.addCertsFromDirPath(gpa, io, tmp.dir, ".");
346}
347
334348test "scan for OS-provided certificates" {
335349 if (builtin.os.tag == .wasi) return error.SkipZigTest;
336350