@@ -1832,28 +1832,11 @@ create_binders(Context, [#ticket_data{
18321832% % } OfferedPsks;
18331833truncate_client_hello (HelloBin0 ) ->
18341834 <<? BYTE (Type ), ? UINT24 (_Length ), Body /binary >> = HelloBin0 ,
1835- CH0 = # client_hello {
1836- extensions = #{pre_shared_key := PSK0 } = Extensions0 } =
1835+ # client_hello {
1836+ extensions = #{pre_shared_key := PSK0 }} =
18371837 tls_handshake :decode_handshake (? TLS_1_3 , Type , Body ),
1838- # pre_shared_key_client_hello {offered_psks = OfferedPsks0 } = PSK0 ,
1839- OfferedPsks = OfferedPsks0 # offered_psks {binders = []},
1840- PSK = PSK0 # pre_shared_key_client_hello {offered_psks = OfferedPsks },
1841- Extensions = Extensions0 #{pre_shared_key => PSK },
1842- CH = CH0 # client_hello {extensions = Extensions },
1843-
1844- % % Decoding a ClientHello from an another TLS implementation can contain
1845- % % unsupported extensions and thus executing decoding and encoding on
1846- % % the input can result in a different handshake binary.
1847- % % The original length of the binders can still be determined by
1848- % % re-encoding the original ClientHello and using its size as reference
1849- % % when we subtract the size of the truncated binary.
1850- TruncatedSize = iolist_size (tls_handshake :encode_handshake (CH , ? TLS_1_3 )),
1851- RefSize = iolist_size (tls_handshake :encode_handshake (CH0 , ? TLS_1_3 )),
1852- BindersSize = RefSize - TruncatedSize ,
1853-
1854- % % Return the truncated ClientHello by cutting of the binders from the original
1855- % % ClientHello binary.
1856- {Truncated , _ } = split_binary (HelloBin0 , byte_size (HelloBin0 ) - BindersSize - 2 ),
1838+ # pre_shared_key_client_hello {binder_length = BinderLen } = PSK0 ,
1839+ {Truncated , _ } = split_binary (HelloBin0 , byte_size (HelloBin0 ) - BinderLen ),
18571840 Truncated .
18581841
18591842maybe_add_early_data_indication (# client_hello {
0 commit comments