package otr

  1. Overview
  2. Docs

Module Otr.StateSource

States and types

Type definitions and predicates

Sourcetype ret = [
  1. | `Warning of string
  2. | `Received_error of string
  3. | `Received of string
  4. | `Established_encrypted_session of string
  5. | `Received_encrypted of string
  6. | `SMP_awaiting_secret
  7. | `SMP_received_question of string
  8. | `SMP_success
  9. | `SMP_failure
]

Return values of functions in the Engine module.

Sourcetype policy = [
  1. | `REQUIRE_ENCRYPTION
  2. | `SEND_WHITESPACE_TAG
  3. | `WHITESPACE_START_AKE
  4. | `ERROR_START_AKE
  5. | `REVEAL_MACS
]

OTR policies, as defined in the protocol.

Sourceval sexp_of_policy : policy -> Sexplib0.Sexp.t
Sourceval policy_of_sexp : Sexplib0.Sexp.t -> policy
Sourceval policy_to_string : policy -> string

policy_to_string policy is string, the string representation of the given policy.

Sourceval string_to_policy : string -> policy option

string_to_policy string is policy, the policy matching the string (None if none matches).

Sourceval all_policies : policy list

all_policies returns a list of all defined policies.

Sourcetype version = [
  1. | `V2
  2. | `V3
]

OTR protocol versions supported by this library

Sourceval sexp_of_version : version -> Sexplib0.Sexp.t
Sourceval version_of_sexp : Sexplib0.Sexp.t -> version
Sourceval version_to_string : version -> string

version_to_string version is string, the string representation of the version.

Sourceval string_to_version : string -> version option

string_to_version string is version, the version matching the string (None if none matches).

Sourceval all_versions : version list

all_versions returns a list of all supported versions.

Sourcetype config = {
  1. policies : policy list;
  2. versions : version list;
}

OTR configuration consisting of a set of policies and versions.

Sourceval sexp_of_config : config -> Sexplib0.Sexp.t
Sourceval config_of_sexp : Sexplib0.Sexp.t -> config
Sourceval config : version list -> policy list -> config

config versions policies is config, the configuration with the given versions and policies.

Sourcetype session

An abstract OTR session

Sourceval session_to_string : session -> string

session_to_string session is string, the string representation of the session.

Sourceval version : session -> version

version session is version, the current active protocol version of this session.

Sourceval is_encrypted : session -> bool

is_encrypted session is true if the session is established.

Sourceval their_dsa : session -> Mirage_crypto_pk.Dsa.pub option

their_dsa session is dsa, the public DSA key used by the communication partner (if the session is established).

Sourceval new_session : config -> Mirage_crypto_pk.Dsa.priv -> unit -> session

new_session configuration dsa () is session, a fresh session given the configuration and dsa private key.

Sourceval update_config : config -> session -> session

update_config config session is session, the session adjusted to the config. Note: the session might not conform to the config anymore!