| author | |
| committer | |
| log | 006afece53af66401b941e25eba03efab6e9251f |
| tree | 6f9e22b97a6cfee83aecf3fcc3bc5cd5f2a76806 |
| parent | 5d0929c40dcb0456cbef88fe10197af81e984142 |
2 files changed, 4 insertions(+), 2 deletions(-)
lib/std/crypto/tls/Client.zig+3-1| ... | ... | @@ -109,7 +109,7 @@ pub const Options = struct { |
| 109 | 109 | read_buffer: []u8, |
| 110 | 110 | /// Cryptographically secure random bytes. The pointer is not captured; data is only |
| 111 | 111 | /// read during `init`. |
| 112 | entropy: *const [240]u8, | |
| 112 | entropy: *const [entropy_len]u8, | |
| 113 | 113 | /// Current time according to the wall clock / calendar, in seconds. |
| 114 | 114 | realtime_now_seconds: i64, |
| 115 | 115 | |
| ... | ... | @@ -130,6 +130,8 @@ pub const Options = struct { |
| 130 | 130 | allow_truncation_attacks: bool = false, |
| 131 | 131 | /// Populated when `error.TlsAlert` is returned from `init`. |
| 132 | 132 | alert: ?*tls.Alert = null, |
| 133 | ||
| 134 | pub const entropy_len = 240; | |
| 133 | 135 | }; |
| 134 | 136 | |
| 135 | 137 | const InitError = error{ |
lib/std/http/Client.zig+1-1| ... | ... | @@ -321,7 +321,7 @@ pub const Connection = struct { |
| 321 | 321 | assert(base.ptr + alloc_len == socket_read_buffer.ptr + socket_read_buffer.len); |
| 322 | 322 | @memcpy(host_buffer, remote_host.bytes); |
| 323 | 323 | const tls: *Tls = @ptrCast(base); |
| 324 | var random_buffer: [240]u8 = undefined; | |
| 324 | var random_buffer: [std.crypto.tls.Client.Options.entropy_len]u8 = undefined; | |
| 325 | 325 | io.random(&random_buffer); |
| 326 | 326 | tls.* = .{ |
| 327 | 327 | .connection = .{ |