package tls

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Core type definitions

type tls_version =
  1. | TLS_1_0
  2. | TLS_1_1
  3. | TLS_1_2
val tls_version_of_sexp : Sexplib.Sexp.t -> tls_version
val sexp_of_tls_version : tls_version -> Sexplib.Sexp.t
val pair_of_tls_version : tls_version -> int * int
val tls_version_of_pair : (int * int) -> tls_version option
type tls_any_version =
  1. | SSL_3
  2. | Supported of tls_version
  3. | TLS_1_X of int
val tls_any_version_of_sexp : Sexplib.Sexp.t -> tls_any_version
val sexp_of_tls_any_version : tls_any_version -> Sexplib.Sexp.t
val any_version_to_version : tls_any_version -> tls_version option
val version_eq : tls_any_version -> tls_version -> bool
val version_ge : tls_any_version -> tls_version -> bool
val tls_any_version_of_pair : (int * int) -> tls_any_version option
val pair_of_tls_any_version : tls_any_version -> int * int
val max_protocol_version : ('a * 'b) -> 'b
val min_protocol_version : ('a * 'b) -> 'a
type tls_hdr = {
  1. content_type : Packet.content_type;
  2. version : tls_any_version;
}
val tls_hdr_of_sexp : Sexplib.Sexp.t -> tls_hdr
val sexp_of_tls_hdr : tls_hdr -> Sexplib.Sexp.t
module SessionID : sig ... end
type client_extension = [
  1. | `Hostname of string
  2. | `MaxFragmentLength of Packet.max_fragment_length
  3. | `EllipticCurves of Packet.named_curve_type list
  4. | `ECPointFormats of Packet.ec_point_format list
  5. | `SecureRenegotiation of Cstruct.t
  6. | `Padding of int
  7. | `SignatureAlgorithms of (Nocrypto.Hash.hash * Packet.signature_algorithm_type) list
  8. | `UnknownExtension of int * Cstruct.t
  9. | `ExtendedMasterSecret
]
val __client_extension_of_sexp__ : Sexplib.Sexp.t -> client_extension
val client_extension_of_sexp : Sexplib.Sexp.t -> client_extension
val sexp_of_client_extension : client_extension -> Sexplib.Sexp.t
type server_extension = [
  1. | `Hostname
  2. | `MaxFragmentLength of Packet.max_fragment_length
  3. | `ECPointFormats of Packet.ec_point_format list
  4. | `SecureRenegotiation of Cstruct.t
  5. | `UnknownExtension of int * Cstruct.t
  6. | `ExtendedMasterSecret
]
val __server_extension_of_sexp__ : Sexplib.Sexp.t -> server_extension
val server_extension_of_sexp : Sexplib.Sexp.t -> server_extension
val sexp_of_server_extension : server_extension -> Sexplib.Sexp.t
type client_hello = {
  1. client_version : tls_any_version;
  2. client_random : Cstruct.t;
  3. sessionid : SessionID.t option;
  4. ciphersuites : Packet.any_ciphersuite list;
  5. extensions : client_extension list;
}
val client_hello_of_sexp : Sexplib.Sexp.t -> client_hello
val sexp_of_client_hello : client_hello -> Sexplib.Sexp.t
type server_hello = {
  1. server_version : tls_version;
  2. server_random : Cstruct.t;
  3. sessionid : SessionID.t option;
  4. ciphersuite : Ciphersuite.ciphersuite;
  5. extensions : server_extension list;
}
val server_hello_of_sexp : Sexplib.Sexp.t -> server_hello
val sexp_of_server_hello : server_hello -> Sexplib.Sexp.t
type dh_parameters = {
  1. dh_p : Cstruct.t;
  2. dh_g : Cstruct.t;
  3. dh_Ys : Cstruct.t;
}
val dh_parameters_of_sexp : Sexplib.Sexp.t -> dh_parameters
val sexp_of_dh_parameters : dh_parameters -> Sexplib.Sexp.t
type ec_curve = {
  1. a : Cstruct.t;
  2. b : Cstruct.t;
}
val ec_curve_of_sexp : Sexplib.Sexp.t -> ec_curve
val sexp_of_ec_curve : ec_curve -> Sexplib.Sexp.t
type ec_prime_parameters = {
  1. prime : Cstruct.t;
  2. curve : ec_curve;
  3. base : Cstruct.t;
  4. order : Cstruct.t;
  5. cofactor : Cstruct.t;
  6. public : Cstruct.t;
}
val ec_prime_parameters_of_sexp : Sexplib.Sexp.t -> ec_prime_parameters
val sexp_of_ec_prime_parameters : ec_prime_parameters -> Sexplib.Sexp.t
type ec_char_parameters = {
  1. m : int;
  2. basis : Packet.ec_basis_type;
  3. ks : Cstruct.t list;
  4. curve : ec_curve;
  5. base : Cstruct.t;
  6. order : Cstruct.t;
  7. cofactor : Cstruct.t;
  8. public : Cstruct.t;
}
val ec_char_parameters_of_sexp : Sexplib.Sexp.t -> ec_char_parameters
val sexp_of_ec_char_parameters : ec_char_parameters -> Sexplib.Sexp.t
type ec_parameters =
  1. | ExplicitPrimeParameters of ec_prime_parameters
  2. | ExplicitCharParameters of ec_char_parameters
  3. | NamedCurveParameters of Packet.named_curve_type * Cstruct.t
val ec_parameters_of_sexp : Sexplib.Sexp.t -> ec_parameters
val sexp_of_ec_parameters : ec_parameters -> Sexplib.Sexp.t
type tls_handshake =
  1. | HelloRequest
  2. | ServerHelloDone
  3. | ClientHello of client_hello
  4. | ServerHello of server_hello
  5. | Certificate of Cstruct.t list
  6. | ServerKeyExchange of Cstruct.t
  7. | CertificateRequest of Cstruct.t
  8. | ClientKeyExchange of Cstruct.t
  9. | CertificateVerify of Cstruct.t
  10. | Finished of Cstruct.t
val tls_handshake_of_sexp : Sexplib.Sexp.t -> tls_handshake
val sexp_of_tls_handshake : tls_handshake -> Sexplib.Sexp.t
val tls_alert_of_sexp : Sexplib.Sexp.t -> tls_alert
val sexp_of_tls_alert : tls_alert -> Sexplib.Sexp.t
type tls_body =
  1. | TLS_ChangeCipherSpec
  2. | TLS_ApplicationData
  3. | TLS_Alert of tls_alert
  4. | TLS_Handshake of tls_handshake
val tls_body_of_sexp : Sexplib.Sexp.t -> tls_body
val sexp_of_tls_body : tls_body -> Sexplib.Sexp.t
type master_secret = Cstruct.t

the master secret of a TLS connection

val master_secret_of_sexp : Sexplib.Sexp.t -> master_secret
val sexp_of_master_secret : master_secret -> Sexplib.Sexp.t
type epoch_data = {
  1. protocol_version : tls_version;
  2. ciphersuite : Ciphersuite.ciphersuite;
  3. peer_random : Cstruct.t;
  4. peer_certificate_chain : X509.t list;
  5. peer_certificate : X509.t option;
  6. peer_name : string option;
  7. trust_anchor : X509.t option;
  8. received_certificates : X509.t list;
  9. own_random : Cstruct.t;
  10. own_certificate : X509.t list;
  11. own_private_key : Nocrypto.Rsa.priv option;
  12. own_name : string option;
  13. master_secret : master_secret;
  14. session_id : SessionID.t;
  15. extended_ms : bool;
}

information about an open session

val epoch_data_of_sexp : Sexplib.Sexp.t -> epoch_data
val sexp_of_epoch_data : epoch_data -> Sexplib.Sexp.t
OCaml

Innovation. Community. Security.