std.crypto.tls: support more key share params

This condition is already checked less restrictively in
`KeyShare.exchange`.
This commit is contained in:
Jacob Young 2024-11-01 01:48:25 -04:00
parent e184b15a66
commit 4466f145d6

View File

@ -636,7 +636,6 @@ pub fn init(stream: anytype, ca_bundle: Certificate.Bundle, host: []const u8) In
const curve_type = hsd.decode(u8); const curve_type = hsd.decode(u8);
if (curve_type != 0x03) return error.TlsIllegalParameter; // named_curve if (curve_type != 0x03) return error.TlsIllegalParameter; // named_curve
const named_group = hsd.decode(tls.NamedGroup); const named_group = hsd.decode(tls.NamedGroup);
if (named_group != .secp256r1) return error.TlsIllegalParameter;
const key_size = hsd.decode(u8); const key_size = hsd.decode(u8);
try hsd.ensure(key_size); try hsd.ensure(key_size);
const server_pub_key = hsd.slice(key_size); const server_pub_key = hsd.slice(key_size);