authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-05-20 14:43:04+02:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-05-20 14:43:04+02:00
log992c02ab95e8297a1558bcf011f15a5cf1cd8e1b
tree09887b8a4e4b39f8acd85bf0c4849b5413bb34ea
parent9910bfa6d887cd28dba3ac99ac0f0acf8d6e5056

std: Fix error in tlcsprng init sequence

The fallback case was actually switched with the success one.

1 files changed, 2 insertions(+), 6 deletions(-)

lib/std/crypto/tlcsprng.zig+2-6
...@@ -107,13 +107,9 @@ fn tlsCsprngFill(_: *const std.rand.Random, buffer: []u8) void {...@@ -107,13 +107,9 @@ fn tlsCsprngFill(_: *const std.rand.Random, buffer: []u8) void {
107 break :wof;107 break :wof;
108 } else |_| {}108 } else |_| {}
109109
110 os.madvise(110 if (os.madvise(wipe_mem.ptr, wipe_mem.len, os.MADV_WIPEONFORK)) |_| {
111 wipe_mem.ptr,
112 wipe_mem.len,
113 os.MADV_WIPEONFORK,
114 ) catch {
115 return initAndFill(buffer);111 return initAndFill(buffer);
116 };112 } else |_| {}
117 }113 }
118114
119 if (std.Thread.use_pthreads) {115 if (std.Thread.use_pthreads) {