@@ -512,7 +512,13 @@ impl ResolvesServerCert for ResolvesServerCertFromChoices {
512512///
513513/// `signature_schemes` carries the values supplied by the client or, if the
514514/// client did not send this TLS extension, the default schemes in the rustls library. See:
515- /// <https://docs.rs/rustls/latest/rustls/internal/msgs/enums/enum.SignatureScheme.html>.
515+ /// <https://docs.rs/rustls/latest/rustls/enum.SignatureScheme.html>.
516+ ///
517+ /// `named_groups` carries the values of the `named_groups` extension sent by the
518+ /// client. If the client did not send a `named_groups` extension, the length of
519+ /// this `rustls_slice_u16` will be 0. The meaning of this extension differ
520+ /// based on TLS version. See the Rustls documentation for more information:
521+ /// <https://rustls.dev/docs/server/struct.ClientHello.html#method.named_groups>
516522///
517523/// `alpn` carries the list of ALPN protocol names that the client proposed to
518524/// the server. Again, the length of this list will be 0 if none were supplied.
@@ -527,6 +533,7 @@ impl ResolvesServerCert for ResolvesServerCertFromChoices {
527533pub struct rustls_client_hello < ' a > {
528534 server_name : rustls_str < ' a > ,
529535 signature_schemes : rustls_slice_u16 < ' a > ,
536+ named_groups : rustls_slice_u16 < ' a > ,
530537 alpn : * const rustls_slice_slice_bytes < ' a > ,
531538}
532539
@@ -596,6 +603,10 @@ impl ResolvesServerCert for ClientHelloResolver {
596603 . iter ( )
597604 . map ( |s| u16:: from ( * s) )
598605 . collect ( ) ;
606+ let mapped_groups = match client_hello. named_groups ( ) {
607+ Some ( groups) => groups. iter ( ) . map ( |g| u16:: from ( * g) ) . collect ( ) ,
608+ None => Vec :: new ( ) ,
609+ } ;
599610 // Unwrap the Option. None becomes an empty slice.
600611 let alpn = match client_hello. alpn ( ) {
601612 Some ( iter) => iter. collect ( ) ,
@@ -604,9 +615,11 @@ impl ResolvesServerCert for ClientHelloResolver {
604615
605616 let alpn = rustls_slice_slice_bytes { inner : & alpn } ;
606617 let signature_schemes = ( & * mapped_sigs) . into ( ) ;
618+ let named_groups = ( & * mapped_groups) . into ( ) ;
607619 let hello = rustls_client_hello {
608620 server_name,
609621 signature_schemes,
622+ named_groups,
610623 alpn : & alpn,
611624 } ;
612625
0 commit comments