| ... | @@ -257,7 +257,7 @@ pub fn init(stream: anytype, ca_bundle: Certificate.Bundle, host: []const u8) In | ... | @@ -257,7 +257,7 @@ pub fn init(stream: anytype, ca_bundle: Certificate.Bundle, host: []const u8) In |
| 257 | if (handshake_type != .server_hello) return error.TlsUnexpectedMessage; | 257 | if (handshake_type != .server_hello) return error.TlsUnexpectedMessage; |
| 258 | const length = ptd.decode(u24); | 258 | const length = ptd.decode(u24); |
| 259 | var hsd = try ptd.sub(length); | 259 | var hsd = try ptd.sub(length); |
| 260 | try hsd.ensure(2 + 32 + 1 + 32 + 2 + 1); | 260 | try hsd.ensure(2 + 32 + 1); |
| 261 | const legacy_version = hsd.decode(u16); | 261 | const legacy_version = hsd.decode(u16); |
| 262 | @memcpy(&server_hello_rand, hsd.array(32)); | 262 | @memcpy(&server_hello_rand, hsd.array(32)); |
| 263 | if (mem.eql(u8, &server_hello_rand, &tls.hello_retry_request_sequence)) { | 263 | if (mem.eql(u8, &server_hello_rand, &tls.hello_retry_request_sequence)) { |
| ... | @@ -266,8 +266,8 @@ pub fn init(stream: anytype, ca_bundle: Certificate.Bundle, host: []const u8) In | ... | @@ -266,8 +266,8 @@ pub fn init(stream: anytype, ca_bundle: Certificate.Bundle, host: []const u8) In |
| 266 | return error.TlsUnexpectedMessage; | 266 | return error.TlsUnexpectedMessage; |
| 267 | } | 267 | } |
| 268 | const legacy_session_id_echo_len = hsd.decode(u8); | 268 | const legacy_session_id_echo_len = hsd.decode(u8); |
| 269 | if (legacy_session_id_echo_len != 32) return error.TlsIllegalParameter; | 269 | try hsd.ensure(legacy_session_id_echo_len + 2 + 1); |
| 270 | const legacy_session_id_echo = hsd.array(32); | 270 | const legacy_session_id_echo = hsd.slice(legacy_session_id_echo_len); |
| 271 | cipher_suite_tag = hsd.decode(tls.CipherSuite); | 271 | cipher_suite_tag = hsd.decode(tls.CipherSuite); |
| 272 | hsd.skip(1); // legacy_compression_method | 272 | hsd.skip(1); // legacy_compression_method |
| 273 | var supported_version: ?u16 = null; | 273 | var supported_version: ?u16 = null; |