<div dir="ltr"><div><div><div>I first tried to copy just the ssl app from your new_crypto_dtls branch and got the error in the previous email.<br></div>Now I tried to use your complete branch and it works<br>but I'm getting a bad match error somewhere else in my code when trying to encrypt a media stream:<br>
<br>State = crypto:stream_init(aes_ctr, MasterKey, <<IVec/binary, 0:16>>),<br>{_State2, CipherText} = crypto:stream_encrypt(State, <<0:Size>>),<br><br>line error:<br>{crypto,stream_encrypt,2,[{file,"crypto.erl"},{line,776}<br>
<br></div>You said your ssl app prototype should be compatible with R16B01.<br></div>Shouldn't I be able to just copy the ssl app and use the crypto app in R16B01?<br><br>Thanks<br><div><div><br><br></div></div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 5, 2014 at 6:22 PM, pablo platt <span dir="ltr"><<a href="mailto:pablo.platt@gmail.com" target="_blank">pablo.platt@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<br><div><br>I'm using R16B01.<br><br>I'm getting an error even when adding the Ciphers:<br>{{badmatch,{error,{options,{ciphers,[{ecdhe_rsa,aes_128_cbc,sha},{dhe_rsa,aes_128_cbc,sha},{rsa,aes_128_cbc,sha},{ecdhe_rsa,aes_256_cbc,sha},{dhe_rsa,aes_256_cbc,sha},{rsa,aes_256_cbc,sha},{ecdhe_psk,aes_128_cbc,sha},{dhe_psk,aes_128_cbc,sha},{ecdhe_psk,aes_256_cbc,sha},{dhe_psk,aes_256_cbc,sha}]}}}}<br>
<br>Port = 5070,<br>Ciphers = [{ecdhe_rsa, aes_128_cbc, sha},<div class=""><br> {dhe_rsa, aes_128_cbc, sha},<br> {rsa, aes_128_cbc, sha},<br> {ecdhe_rsa, aes_256_cbc, sha},<br>
{dhe_rsa, aes_256_cbc, sha},<br>
{rsa, aes_256_cbc, sha},<br> {ecdhe_psk, aes_128_cbc, sha},<br> {dhe_psk, aes_128_cbc,sha},<br> {ecdhe_psk, aes_256_cbc, sha},<br></div> {dhe_psk, aes_256_cbc,sha}],<div class="">
<br>
Options = [{versions, ['dtlsv1.2', dtlsv1]},<br> {cb_info, ssl_udp},<br> {reuseaddr, true},<br> {active, false},<br></div> {ciphers, Ciphers},<div class="">
<br> {certfile,Cert},<br>
{keyfile, Key}],<br>{ok, LSocket} = ssl:listen(Port, Options)<br><br></div></div><span class="HOEnZb"><font color="#888888"><div>Pablo<br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Mar 5, 2014 at 6:02 PM, Andreas Schultz <span dir="ltr"><<a href="mailto:aschultz@tpip.net" target="_blank">aschultz@tpip.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Pablo,<br>
<div><br>
<br>
----- Original Message -----<br>
> Now I'm getting an error:<br>
> {error,{options,{ciphers,[]}}}<br>
><br>
> When calling:<br>
><br>
> Options = [{versions, ['dtlsv1.2', dtlsv1]},<br>
> {cb_info, ssl_udp},<br>
> {reuseaddr, true},<br>
> {active, false},<br>
> {certfile,Cert},<br>
> {keyfile, Key}],<br>
> {ok, LSocket} = ssl:listen(Port, Options).<br>
><br>
> Do I need to pass ciphers to the ssl options?<br>
<br>
<br>
</div>I seems that DTLS was never tested without the ciphers.<br>
option. In my project I use this list:<br>
<br>
{ciphers,[{ecdhe_rsa, aes_128_cbc, sha},<br>
{dhe_rsa, aes_128_cbc, sha},<br>
{rsa, aes_128_cbc, sha},<br>
{ecdhe_rsa, aes_256_cbc, sha},<br>
{dhe_rsa, aes_256_cbc, sha},<br>
{rsa, aes_256_cbc, sha},<br>
{ecdhe_psk, aes_128_cbc, sha},<br>
{dhe_psk, aes_128_cbc,sha},<br>
{ecdhe_psk, aes_256_cbc, sha},<br>
{dhe_psk, aes_256_cbc,sha}]}<br>
<div><br>
> On Wed, Mar 5, 2014 at 12:46 AM, pablo platt < <a href="mailto:pablo.platt@gmail.com" target="_blank">pablo.platt@gmail.com</a> > wrote:<br>
><br>
> Hi,<br>
><br>
> I'm trying to use the dtls prototype from:<br>
> <a href="https://github.com/RoadRunnr/otp/tree/new_crypto_dtls" target="_blank">https://github.com/RoadRunnr/otp/tree/new_crypto_dtls</a><br>
><br>
> I'm getting an exception when trying to use a simple example.<br>
> What am I doing wrong?<br>
><br>
> Is there an example how to use this modified ssl app with R16 or R17?<br>
> I see that the branch adds crypto:algorithms/0<br>
> Is it the only modification needed except for the ssl app?<br>
<br>
</div>No, Ingela started refactoring the SSL application and incorporating bits of my<br>
DTLS stuff after R16B01. So, you can not apply my modifications to anything after<br>
R16B01.<br>
<br>
Andreas<br>
<div><div><br>
><br>
> Thanks<br>
><br>
> test<br>
> ---------------<br>
><br>
> init() -><br>
> Port = 5070,<br>
> Cert = filename:join([dtls:priv_dir(webrtc), "cert.pem"]),<br>
> Key = filename:join([dtls:priv_dir(webrtc), "key.pem"]),<br>
> Options = [{versions, ['dtlsv1.2', dtlsv1]},<br>
> {cb_info, ssl_udp},<br>
> {reuseaddr, true},<br>
> {active, false},<br>
> {certfile,Cert},<br>
> {keyfile, Key}],<br>
> {ok, LSocket} = ssl:listen(Port,Options),<br>
> spawn(?MODULE, accept, [LSocket]),<br>
> {ok, #state{}}.<br>
><br>
> accept(LSocket) -><br>
> {ok, Socket} = ssl_udp:accept(LSocket, 5000),<br>
> Pid = spawn(?MODULE, loop, [Socket]),<br>
> ssl:controlling_process(Socket, Pid),<br>
> accept(LSocket).<br>
><br>
> loop(Socket) -><br>
> inet:setopts(Socket, [{active, once}]),<br>
> receive<br>
> R -><br>
> error_logger:info_msg("~p~n", [R]),<br>
> loop(Socket)<br>
> end.<br>
><br>
><br>
> exception<br>
> ---------------------------<br>
> {'EXIT',<br>
> {function_clause,<br>
> [{ssl_udp,call,<br>
> [{sslsocket,nil,<br>
> {<0.103.0>,<br>
> {config,<br>
> {ssl_options,<br>
> [{254,253},{254,255}],<br>
> verify_none,<br>
> {#Fun<ssl.1.555667>,[]},<br>
> false,false,false,undefined,1,<br>
> <<"cert.pem">>,<br>
> undefined,<br>
> <<"key.pem">>,<br>
> undefined,[],undefined,<<>>,undefined,undefined,<br>
> undefined,undefined,undefined,<br>
> [<<"À$">>,<<"À(">>,<<"À&">>,<<"À*">>,<br>
> <<0,107>>,<br>
> <<0,106>>,<br>
> <<0,61>>,<br>
> <<"À#">>,<<"À'">>,<<"À%">>,<<"À)">>,<br>
> <<0,103>>,<br>
> <<0,64>>,<br>
> <<0,60>>,<br>
> <<"À\n">>,<br>
> <<192,20>>,<br>
> <<0,57>>,<br>
> <<0,56>>,<br>
> <<192,5>>,<br>
> <<192,15>>,<br>
> <<0,53>>,<br>
> <<"À\b">>,<br>
> <<192,18>>,<br>
> <<0,22>>,<br>
> <<0,19>>,<br>
> <<192,3>>,<br>
> <<"À\r">>,<br>
> <<0,10>>,<br>
> <<"À\t">>,<br>
> <<192,19>>,<br>
> <<0,51>>,<br>
> <<0,50>>,<br>
> <<192,4>>,<br>
> <<192,14>>,<br>
> <<0,47>>,<br>
> <<192,7>>,<br>
> <<192,17>>,<br>
> <<0,5>>,<br>
> <<0,4>>,<br>
> <<0,21>>,<br>
> <<192,2>>,<br>
> <<"À\f">>,<br>
> <<0,9>>],<br>
> #Fun<ssl.0.555667>,true,268435456,false,undefined,<br>
> undefined,false,undefined,undefined},<br>
> [{reuseaddr,true},{active,false}],<br>
> {socket_options,list,0,0,0,false},<br>
> [{reuseaddr,true},<br>
> {packet_size,0},<br>
> {packet,0},<br>
> {header,0},<br>
> {active,false},<br>
> {mode,binary}],<br>
> {ssl_udp,ssl_udp,udp_closed,udp_error}}}},<br>
> accept,10000,infinity],<br>
> [{file,"ssl_udp.erl"},{line,149}]},<br>
> {dtls_test,accept,1,<br>
> [{file,"src/dtls_test.erl"},{line,70}]}]}}<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
><br>
<br>
--<br>
--<br>
Dipl. Inform.<br>
Andreas Schultz<br>
<br>
email: <a href="mailto:as@travelping.com" target="_blank">as@travelping.com</a><br>
phone: <a href="tel:%2B49-391-819099-224" value="+49391819099224" target="_blank">+49-391-819099-224</a><br>
mobil: <a href="tel:%2B49-170-2226073" value="+491702226073" target="_blank">+49-170-2226073</a><br>
<br>
------------------- enabling your networks -------------------<br>
<br>
Travelping GmbH phone: <a href="tel:%2B49-391-819099229" value="+49391819099229" target="_blank">+49-391-819099229</a><br>
Roentgenstr. 13 fax: <a href="tel:%2B49-391-819099299" value="+49391819099299" target="_blank">+49-391-819099299</a><br>
D-39108 Magdeburg email: <a href="mailto:info@travelping.com" target="_blank">info@travelping.com</a><br>
GERMANY web: <a href="http://www.travelping.com" target="_blank">http://www.travelping.com</a><br>
<br>
Company Registration: Amtsgericht Stendal Reg No.: HRB 10578<br>
Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780<br>
--------------------------------------------------------------<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>