ReviewOS

also looking at this

zig-utils/zig-tls

fix: Zig 0.16.0-dev.2565 compatibility

#1
Open glennmichael123 wants to merge main into main
3 files +8 -11
src/handshake_common.zigmodified+3-5
Changes to src/handshake_common.zig
@@ -76,7 +76,7 @@ pub const CertKeyPair = struct {
7676 key_path: []const u8,
7777 ) !CertKeyPair {
7878 var bundle: cert.Bundle = .{};
79 const now = Io.Clock.real.now(io) catch Io.Timestamp.zero;
79 const now = Io.Clock.real.now(io);
8080 try bundle.addCertsFromFilePathAbsolute(allocator, io, now, cert_path);
8181
8282 const key_file = try std.Io.Dir.openFileAbsolute(io, key_path, .{});
@@ -337,11 +337,9 @@ pub const CertificateParser = struct {
337337
338338 pub fn parseCertificate(h: *CertificateParser, d: *record.Decoder, tls_version: proto.Version) !void {
339339 if (h.now_sec == 0) {
340 // Zig 0.16 compatibility: use posix clock
341 if (std.posix.clock_gettime(.REALTIME)) |ts| {
340 var ts: std.c.timespec = undefined;
341 if (std.c.clock_gettime(.REALTIME, &ts) == 0) {
342342 h.now_sec = ts.sec;
343 } else |_| {
344 h.now_sec = 0;
345343 }
346344 }
347345 if (tls_version == .tls_1_3) {