@@ -1735,28 +1735,11 @@ create_binders(Context, [#ticket_data{
17351735% % } OfferedPsks;
17361736truncate_client_hello (HelloBin0 ) ->
17371737 <<? BYTE (Type ), ? UINT24 (_Length ), Body /binary >> = HelloBin0 ,
1738- CH0 = # client_hello {
1739- extensions = #{pre_shared_key := PSK0 } = Extensions0 } =
1738+ # client_hello {
1739+ extensions = #{pre_shared_key := PSK0 }} =
17401740 tls_handshake :decode_handshake (? TLS_1_3 , Type , Body ),
1741- # pre_shared_key_client_hello {offered_psks = OfferedPsks0 } = PSK0 ,
1742- OfferedPsks = OfferedPsks0 # offered_psks {binders = []},
1743- PSK = PSK0 # pre_shared_key_client_hello {offered_psks = OfferedPsks },
1744- Extensions = Extensions0 #{pre_shared_key => PSK },
1745- CH = CH0 # client_hello {extensions = Extensions },
1746-
1747- % % Decoding a ClientHello from an another TLS implementation can contain
1748- % % unsupported extensions and thus executing decoding and encoding on
1749- % % the input can result in a different handshake binary.
1750- % % The original length of the binders can still be determined by
1751- % % re-encoding the original ClientHello and using its size as reference
1752- % % when we subtract the size of the truncated binary.
1753- TruncatedSize = iolist_size (tls_handshake :encode_handshake (CH , ? TLS_1_3 )),
1754- RefSize = iolist_size (tls_handshake :encode_handshake (CH0 , ? TLS_1_3 )),
1755- BindersSize = RefSize - TruncatedSize ,
1756-
1757- % % Return the truncated ClientHello by cutting of the binders from the original
1758- % % ClientHello binary.
1759- {Truncated , _ } = split_binary (HelloBin0 , byte_size (HelloBin0 ) - BindersSize - 2 ),
1741+ # pre_shared_key_client_hello {binder_length = BinderLen } = PSK0 ,
1742+ {Truncated , _ } = split_binary (HelloBin0 , byte_size (HelloBin0 ) - BinderLen ),
17601743 Truncated .
17611744
17621745maybe_add_early_data_indication (# client_hello {
0 commit comments