[erlang-questions] SSL: Getting master_secret and client_random (or premaster_secret)

Ingela Andin <>
Wed Jan 11 20:12:46 CET 2017


Hi!

There is currently no supported way. ERL-166
https://bugs.erlang.org/browse/ERL-166 talks about the possibility to add
such a feature. We have not had time to look further into this as yet.
Of course, it is possible to provide such an API, although it seems to me
that the use case is violating the concept of using TLS in the first place.
It can, of course, be argued that if you have access to the erlang node you
may dig out the information anyway even if it might be a dirty hack.

Regards Ingela Erlang/OTP team - Ericsson AB


2017-01-06 0:13 GMT+01:00 Technion <>:

> Hi,
>
>
> Is it a solution to for you to deal with it on the client side?
>
>
> https://jimshaver.net/2015/02/11/decrypting-tls-browser-
> traffic-with-wireshark-the-easy-way/
>
> Chrome lets you write keys out.
>
>
> ------------------------------
> *From:*  <erlang-questions-bounces@
> erlang.org> on behalf of Roger Lipscombe <>
> *Sent:* Friday, 6 January 2017 1:20 AM
> *To:* 
> *Subject:* [erlang-questions] SSL: Getting master_secret and
> client_random (or premaster_secret)
>
> We're using ECDHE and DHE ciphers for our SSL connections. This
> provides perfect forward secrecy, which is good, but it makes it
> impossible to decipher packet captures in wireshark, which is
> expected, and also good, almost all of the time.
>
> Sometimes, however, we *do* need to decipher the traffic.
>
> Note that we own both the client (which is embedded) and the server
> (which uses Erlang -- otherwise I wouldn't be asking here -- and
> ranch). We *could* offer a different cipher suite on the server, which
> would disable PFS, but would do it for all connections. I'd prefer
> something a bit more fine-grained.
>
> You can feed a key log to Wireshark, as documented at
> https://developer.mozilla.org/en-US/docs/Mozilla/Projects/
> NSS/Key_Log_Format,
>
> <https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format>
> NSS Key Log Format - Mozilla | MDN
> <https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format>
> developer.mozilla.org
> Key logs can be written by NSS so that external programs can decrypt TLS
> connections. Wireshark 1.6.0 and above can use these log files to decrypt
> packets.
>
>
> and it'll correctly decipher the traffic for that connection.
>
> I'd like to find a way to generate a key log file. This requires
> either (client_random, master_secret) or (encrypted_premaster_secret,
> premaster_secret).
>
> Note that I'm looking at the OTP 17.5 source, because that's what we're
> using.
>
> It would seem that premaster_secret is not stored past the initial
> negotiation, but the client_random and master_secret values are in the
> #security_parameters record in the #connection_state record in the
> #connection_states record, which is in the #state record of the SSL
> connection pid.
>
> But I can't see any (clean) way to retrieve these values, in order to
> generate a key log suitable for Wireshark.
>
> Is there any clean way to do this in OTP 17.5, or is there a supported
> way to do this in OTP 18.x or 19.x?
>
> Regards,
> Roger.
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
> erlang-questions Info Page
> <http://erlang.org/mailman/listinfo/erlang-questions>
> erlang.org
> Mailing list for general discussions about Erlang/OTP, the language,
> implementation, usage, beginners questions, etc... To see the collection of
> prior postings to the ...
>
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170111/cbb22204/attachment.html>


More information about the erlang-questions mailing list