<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>DTLS is missing the use_srtp extension required for DTLS-SRTP [1].</div>What's the best way to add it?<br><div dir="ltr"><br></div><div>We need to encode the extension in ssl_handshake.erl<br></div><div dir="ltr">encode_hello_extensions([use_srtp | Rest], Acc) -><br>    ExtData = <<0,2,0,1,0>>,<br>    Len = byte_size(ExtData),<br>    encode_hello_extensions(Rest, <<?UINT16(?USE_SRTP_EXT), ?UINT16(Len), ExtData/binary, Acc/binary>>).</div><div dir="ltr"><a href="https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L657">https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L657</a><br></div><div dir="ltr"><br></div><div dir="ltr">
<div dir="ltr">Define 
USE_SRTP_EXT

in ssl_handshake.hrl<br></div><div dir="ltr">-define(USE_SRTP_EXT, 14).</div>

</div><div dir="ltr"><br></div><div dir="ltr">Add use_srtp to the hello_extensions record:<br></div><div dir="ltr"><a href="https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.hrl#L100">https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.hrl#L100</a></div><div dir="ltr"><br></div><div dir="ltr">Add <span class="gmail-pl-en">use_srtp to hello_extensions_list</span> <br></div><div dir="ltr"><a href="https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L1826">https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L1826</a></div><div dir="ltr"><br></div><div>Add use_srtp to 
<span class="gmail-pl-en">client_hello_extensions</span></div><div dir="ltr"><a href="https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L968">https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L968</a></div><div dir="ltr"><br></div><div dir="ltr">Add use_srtp to the <span class="gmail-pl-k">#</span><span class="gmail-pl-en">ssl_options</span> record</div><div dir="ltr"><a href="https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_internal.hrl#L111">https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_internal.hrl#L111</a><br></div><div dir="ltr"><br></div><div dir="ltr">[1] <a href="https://tools.ietf.org/html/rfc5764#section-4.1">https://tools.ietf.org/html/rfc5764#section-4.1</a></div><div dir="ltr"><br></div><div>Thanks<br></div></div></div></div></div></div></div></div></div></div></div></div>