[erlang-questions] use_srtp extension for DTLS

Ben Browitt ben.browitt@REDACTED
Mon Oct 1 10:27:54 CEST 2018


DTLS is missing the use_srtp extension required for DTLS-SRTP [1].
What's the best way to add it?

We need to encode the extension in ssl_handshake.erl
encode_hello_extensions([use_srtp | Rest], Acc) ->
    ExtData = <<0,2,0,1,0>>,
    Len = byte_size(ExtData),
    encode_hello_extensions(Rest, <<?UINT16(?USE_SRTP_EXT), ?UINT16(Len),
ExtData/binary, Acc/binary>>).
https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L657

Define USE_SRTP_EXT in ssl_handshake.hrl
-define(USE_SRTP_EXT, 14).

Add use_srtp to the hello_extensions record:
https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.hrl#L100

Add use_srtp to hello_extensions_list
https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L1826

Add use_srtp to client_hello_extensions
https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_handshake.erl#L968

Add use_srtp to the #ssl_options record
https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_internal.hrl#L111

[1] https://tools.ietf.org/html/rfc5764#section-4.1

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181001/dcbd74b7/attachment.htm>


More information about the erlang-questions mailing list