SSL.Crypto.Finished (ex_ssl v0.16.7)

Copy Markdown View Source

TLS 1.3 Finished verify-data calculation and constant-time verification.

Summary

Types

error_reason()

@type error_reason() ::
  :unsupported_hash
  | :invalid_finished
  | {:invalid_input, :verify_data | :transcript_hash}
  | {:invalid_finished_length, non_neg_integer(), pos_integer()}
  | {:invalid_secret_length, atom(), pos_integer()}
  | {:invalid_transcript_hash_length, pos_integer()}

verify_data_error()

@type verify_data_error() ::
  :unsupported_hash
  | {:invalid_secret_length, :traffic_secret | :finished_key, 32 | 48}
  | {:invalid_input, :transcript_hash}
  | {:invalid_transcript_hash_length, 32 | 48}

Functions

client_verify_data(hash, traffic_secret, transcript_hash)

@spec client_verify_data(atom(), term(), term()) ::
  {:ok, binary()} | {:error, verify_data_error()}

verify_server(hash, traffic_secret, transcript_hash, received_verify_data)

@spec verify_server(atom(), term(), term(), term()) :: :ok | {:error, error_reason()}