SSL.Crypto.TLS12KeySchedule (ex_ssl v0.16.7)

Copy Markdown View Source

Pure TLS 1.2 PRF and Extended Master Secret derivation for the bounded ECDHE-GCM subset.

Summary

Functions

derive(id, premaster, transcript, client_random, server_random)

@spec derive(term(), binary(), binary(), binary(), binary()) ::
  {:ok,
   %{
     master_secret: binary(),
     read_state: SSL.Protocol.TLS12Record.t(),
     write_state: SSL.Protocol.TLS12Record.t()
   }}
  | {:error, term()}

finished(id, master, role, transcript)

@spec finished(term(), binary(), :client | :server, binary()) ::
  {:ok, <<_::96>>} | {:error, term()}

prf(hash, secret, label, seed, length)

@spec prf(:sha256 | :sha384, binary(), binary(), binary(), non_neg_integer()) ::
  {:ok, binary()} | {:error, term()}

suite(id)

@spec suite(term()) ::
  {:error, {:unsupported_cipher_suite, term()}}
  | {:ok,
     %{
       :id => term(),
       :key_exchange => :ecdsa | :rsa,
       :version => 771,
       optional(term()) => term()
     }}