libzrtp types for developers
[ZRTP API REFERENCE ( for the library developers )]

Collaboration diagram for libzrtp types for developers:

Data Structures

struct  zrtp_global_ctx
 Library global context Compilers and linkers on some operating systems don't support the declaration of global variables in c files. Storing a context allows us to solve this problem in a way that unifies component use. The context is created by calling zrtp_init(), and is destroyed with zrtp_down(). It contains data necessary for crypto-component algorithms, including hash schemes, cipher types, SAS schemes etc. Context data can be divided into three groups:
  • ID of client ZRTP peer;
  • RNG related fields (hash context for entropy computing);
  • DH scheme related fields(internal data used for DH exchange);
  • headers of the lists of every crypto-component type used for component management. All of this data, except for "RNG related fields", is for internal use only and set automatically. All that is needed is to link every created session to global context.
More...
struct  zrtp_rtp_info
 RTP packet structure used in libzrtp Used for conveniently working with RTP/ZRTP packets. A binary RTP/ZRTP packet is converted into a zrtp_rtp_info_t structure before processing by _zrtp_preparse_packet(). More...
struct  zrtp_shared_secret
 Shared secret structure This structure stores ZRTP shared secret values used in the protocol. More...
struct  zrtp_secrets
 Retained secrets container Contains the session's shared secret values and related flags restored from the cache. Every subsequent stream within a session uses these values through zrtp_proto_secret_t pointers. By definition, different ZRTP streams can't change secret values. Secret flags are protected against race conditions by the mutex _protector. For internal use only. More...
struct  zrtp_proto_secret
 Protocol shared secret Wrapper around the session shared secrets zrtp_shared_secret. Used for ID storing and secret sorting according to ZRTP ID sec. 5.4.4. More...
struct  zrtp_stream_mescache
 ZRTP messages cache This structure contains ZRTP messages prepared for sending or received from the other side. This scheme allows speed-ups the resending of packets and computing message hashes, and makes resending thread-safe. Besides packets, tasks retries are stored as well. More...
struct  zrtp_dh_crypto_context
 Crypto context for Diffie-Hellman calculations Used only by DH streams to store Diffie-Hellman calculations. Allocated on protocol initialization and released on switching to SECURE mode. More...
struct  zrtp_dsa_crypto_context
 Crypto context for ECDSA calculations Used to store ECDSA keys and calculations. Allocated on protocol initialization and released on switching to SECURE mode. More...
struct  zrtp_proto_crypto
 Protocol crypto context Used as temporary storage for ZRTP crypto data during protocol running. Unlike zrtp_stream_crypto_t this context is needed only during key negotiation and destroyed on switching to SECURE state. More...
struct  zrtp_protocol
 ZRTP protocol structure Protocol structure is responsible for ZRTP protocol logic (CLEAR-SECURE switching) and RTP media encrypting/decrypting. The protocol is created right after the discovery phase and destroyed on stream closing. More...
struct  zrtp_stream_crypto
 Stream-persistent crypto options. Unlike zrtp_proto_crypto_t these data are kept after switching to Secure state or stopping the protocol; used to sign/verify Confirm and GoClear packets. More...
struct  zrtp_media_context
 stream media context. Contains all RTP media-related information. More...

Typedefs

typedef enum zrtp_stream_mode zrtp_stream_mode_t
 Enumeration for ZRTP stream mode definition.
typedef enum zrtp_mitm_mode zrtp_mitm_mode_t
 Lists MitM roles on PBX call transferring Enumeration type for the ZRTP modes based on the role of the MitM.
typedef enum zrtp_statemachine_type zrtp_statemachine_type_t
 enumeration for protocol state-machine roles Protocol role fully defines it's behavior. ZRTP peer chooses a role according to specification. For details see internal developers documentation
typedef zrtp_rtp_info zrtp_rtp_info_t
 RTP packet structure used in libzrtp Used for conveniently working with RTP/ZRTP packets. A binary RTP/ZRTP packet is converted into a zrtp_rtp_info_t structure before processing by _zrtp_preparse_packet().
typedef zrtp_secrets zrtp_secrets_t
 Retained secrets container Contains the session's shared secret values and related flags restored from the cache. Every subsequent stream within a session uses these values through zrtp_proto_secret_t pointers. By definition, different ZRTP streams can't change secret values. Secret flags are protected against race conditions by the mutex _protector. For internal use only.
typedef zrtp_proto_secret zrtp_proto_secret_t
 Protocol shared secret Wrapper around the session shared secrets zrtp_shared_secret. Used for ID storing and secret sorting according to ZRTP ID sec. 5.4.4.
typedef zrtp_stream_mescache zrtp_stream_mescache_t
 ZRTP messages cache This structure contains ZRTP messages prepared for sending or received from the other side. This scheme allows speed-ups the resending of packets and computing message hashes, and makes resending thread-safe. Besides packets, tasks retries are stored as well.
typedef zrtp_dh_crypto_context zrtp_dh_crypto_context_t
 Crypto context for Diffie-Hellman calculations Used only by DH streams to store Diffie-Hellman calculations. Allocated on protocol initialization and released on switching to SECURE mode.
typedef zrtp_dsa_crypto_context zrtp_dsa_crypto_context_t
 Crypto context for ECDSA calculations Used to store ECDSA keys and calculations. Allocated on protocol initialization and released on switching to SECURE mode.
typedef zrtp_proto_crypto zrtp_proto_crypto_t
 Protocol crypto context Used as temporary storage for ZRTP crypto data during protocol running. Unlike zrtp_stream_crypto_t this context is needed only during key negotiation and destroyed on switching to SECURE state.
typedef zrtp_stream_crypto zrtp_stream_crypto_t
 Stream-persistent crypto options. Unlike zrtp_proto_crypto_t these data are kept after switching to Secure state or stopping the protocol; used to sign/verify Confirm and GoClear packets.
typedef zrtp_media_context zrtp_media_context_t
 stream media context. Contains all RTP media-related information.

Enumerations

enum  zrtp_state_t {
  ZRTP_STATE_NONE = 0, ZRTP_STATE_ACTIVE, ZRTP_STATE_START, ZRTP_STATE_WAIT_HELLOACK,
  ZRTP_STATE_WAIT_HELLO, ZRTP_STATE_CLEAR, ZRTP_STATE_START_INITIATINGSECURE, ZRTP_STATE_INITIATINGSECURE,
  ZRTP_STATE_WAIT_CONFIRM1, ZRTP_STATE_WAIT_CONFIRMACK, ZRTP_STATE_PENDINGSECURE, ZRTP_STATE_WAIT_CONFIRM2,
  ZRTP_STATE_SECURE, ZRTP_STATE_SASRELAYING, ZRTP_STATE_INITIATINGCLEAR, ZRTP_STATE_PENDINGCLEAR,
  ZRTP_STATE_INITIATINGERROR, ZRTP_STATE_PENDINGERROR, ZRTP_STATE_ERROR, ZRTP_STATE_NO_ZRTP,
  ZRTP_STATE_COUNT
}
 Defines ZRTP state-machine states The conditions for switching from one state to another, and libzrtp behavior in every state is described in detail in 7.2 Protocol scenarios and depicted in diagram 1.6 and 1.7. The current stream state is stored in the zrtp_stream_ctx_t::state variable and available for reading at any time. More...
enum  zrtp_stream_mode {
  ZRTP_STREAM_MODE_UNKN = 0, ZRTP_STREAM_MODE_CLEAR = 1, ZRTP_STREAM_MODE_DH = 2, ZRTP_STREAM_MODE_PRESHARED = 3,
  ZRTP_STREAM_MODE_MULT = 4, ZRTP_STREAM_MODE_COUNT = 5
}
 Enumeration for ZRTP stream mode definition. More...
enum  zrtp_msg_type_t {
  ZRTP_UNPARSED = -1, ZRTP_NONE = 0, ZRTP_HELLO = 1, ZRTP_HELLOACK = 2,
  ZRTP_COMMIT = 3, ZRTP_DHPART1 = 4, ZRTP_DHPART2 = 5, ZRTP_CONFIRM1 = 6,
  ZRTP_CONFIRM2 = 7, ZRTP_CONFIRM2ACK = 8, ZRTP_GOCLEAR = 9, ZRTP_GOCLEARACK = 10,
  ZRTP_ERROR = 11, ZRTP_ERRORACK = 12, ZRTP_PROCESS = 13, ZRTP_SASRELAY = 14,
  ZRTP_RELAYACK = 15, ZRTP_MSG_TYPE_COUNT = 16
}
 Enumeration for ZRTP protocol packets type definition. More...
enum  zrtp_mitm_mode {
  ZRTP_MITM_MODE_UNKN = 0, ZRTP_MITM_MODE_RECONFIRM_SERVER = 1, ZRTP_MITM_MODE_RECONFIRM_CLIENT = 2, ZRTP_MITM_MODE_SERVER_REG = 3,
  ZRTP_MITM_MODE_CLIENT_REG = 4
}
 Lists MitM roles on PBX call transferring Enumeration type for the ZRTP modes based on the role of the MitM. More...
enum  zrtp_statemachine_type { ZRTP_STATEMACHINE_NONE = 0, ZRTP_STATEMACHINE_INITIATOR = 1, ZRTP_STATEMACHINE_RESPONDER = 2 }
 enumeration for protocol state-machine roles Protocol role fully defines it's behavior. ZRTP peer chooses a role according to specification. For details see internal developers documentation More...


Detailed Description

The data types used in inside libzrte. This section is for libzrtp developers

Typedef Documentation

typedef struct zrtp_dh_crypto_context zrtp_dh_crypto_context_t

Crypto context for Diffie-Hellman calculations Used only by DH streams to store Diffie-Hellman calculations. Allocated on protocol initialization and released on switching to SECURE mode.

typedef struct zrtp_dsa_crypto_context zrtp_dsa_crypto_context_t

Crypto context for ECDSA calculations Used to store ECDSA keys and calculations. Allocated on protocol initialization and released on switching to SECURE mode.

typedef struct zrtp_media_context zrtp_media_context_t

stream media context. Contains all RTP media-related information.

typedef enum zrtp_mitm_mode zrtp_mitm_mode_t

Lists MitM roles on PBX call transferring Enumeration type for the ZRTP modes based on the role of the MitM.

typedef struct zrtp_proto_crypto zrtp_proto_crypto_t

Protocol crypto context Used as temporary storage for ZRTP crypto data during protocol running. Unlike zrtp_stream_crypto_t this context is needed only during key negotiation and destroyed on switching to SECURE state.

typedef struct zrtp_proto_secret zrtp_proto_secret_t

Protocol shared secret Wrapper around the session shared secrets zrtp_shared_secret. Used for ID storing and secret sorting according to ZRTP ID sec. 5.4.4.

typedef struct zrtp_rtp_info zrtp_rtp_info_t

RTP packet structure used in libzrtp Used for conveniently working with RTP/ZRTP packets. A binary RTP/ZRTP packet is converted into a zrtp_rtp_info_t structure before processing by _zrtp_preparse_packet().

typedef struct zrtp_secrets zrtp_secrets_t

Retained secrets container Contains the session's shared secret values and related flags restored from the cache. Every subsequent stream within a session uses these values through zrtp_proto_secret_t pointers. By definition, different ZRTP streams can't change secret values. Secret flags are protected against race conditions by the mutex _protector. For internal use only.

typedef enum zrtp_statemachine_type zrtp_statemachine_type_t

enumeration for protocol state-machine roles Protocol role fully defines it's behavior. ZRTP peer chooses a role according to specification. For details see internal developers documentation

typedef struct zrtp_stream_crypto zrtp_stream_crypto_t

Stream-persistent crypto options. Unlike zrtp_proto_crypto_t these data are kept after switching to Secure state or stopping the protocol; used to sign/verify Confirm and GoClear packets.

typedef struct zrtp_stream_mescache zrtp_stream_mescache_t

ZRTP messages cache This structure contains ZRTP messages prepared for sending or received from the other side. This scheme allows speed-ups the resending of packets and computing message hashes, and makes resending thread-safe. Besides packets, tasks retries are stored as well.

typedef enum zrtp_stream_mode zrtp_stream_mode_t

Enumeration for ZRTP stream mode definition.

Warning:
! Don't change order of these definition without synchronizing with print* functions (see zrtp_log.h)


Enumeration Type Documentation

enum zrtp_mitm_mode

Lists MitM roles on PBX call transferring Enumeration type for the ZRTP modes based on the role of the MitM.

Enumerator:
ZRTP_MITM_MODE_UNKN  MitM is not supported or not activated.
ZRTP_MITM_MODE_RECONFIRM_SERVER  Server-side mode to transfer SAS to the registrant. Libzrtp switches to this state on starting zrtp_update_remote_options().
ZRTP_MITM_MODE_RECONFIRM_CLIENT  Client-side mode accepted SAS transfer from the trusted MiTM. Libzrtp activates this state on receiving an SASRELAY from a trusted MiTM endpoint.
ZRTP_MITM_MODE_SERVER_REG  Server-side mode to accept the user's registration requests. Libzrtp switches to this state on starting a registration stream by zrtp_start_registration_stream() or zrtp_secure_registration_stream().
ZRTP_MITM_MODE_CLIENT_REG  User-side mode to confirm the registration ritual. The library enables this state when a remote party invites it to the registration ritual by a special flag in the Confirm packet.

Definition at line 120 of file zrtp_types.h.

enum zrtp_msg_type_t

Enumeration for ZRTP protocol packets type definition.

Warning:
! Don't change order of these definition without synchronizing with print* functions (see zrtp_log.h)
Enumerator:
ZRTP_UNPARSED 
ZRTP_NONE  Unparsed packet
ZRTP_HELLO  Not ZRTP packet
ZRTP_HELLOACK  ZRTP protocol HELLO packet
ZRTP_COMMIT  ZRTP protocol HELLOACK packet
ZRTP_DHPART1  ZRTP protocol COMMIT packet
ZRTP_DHPART2  ZRTP protocol DHPART1 packet
ZRTP_CONFIRM1  ZRTP protocol DHPART2 packet
ZRTP_CONFIRM2  ZRTP protocol CONFIRM1 packet
ZRTP_CONFIRM2ACK  ZRTP protocol CONFIRM2 packet
ZRTP_GOCLEAR  ZRTP protocol CONFIRM2ACK packet
ZRTP_GOCLEARACK  ZRTP protocol GOCLEAR packet
ZRTP_ERROR  ZRTP protocol GOCLEARACK packet
ZRTP_ERRORACK  ZRTP protocol ERROR packet
ZRTP_PROCESS  ZRTP protocol ERRORACK packet
ZRTP_SASRELAY  This is not a packet type but type of task for scheduler
ZRTP_RELAYACK  ZRTP protocol SASRELAY packet
ZRTP_MSG_TYPE_COUNT  ZRTP protocol RELAYACK packet

Definition at line 93 of file zrtp_types.h.

enum zrtp_state_t

Defines ZRTP state-machine states The conditions for switching from one state to another, and libzrtp behavior in every state is described in detail in 7.2 Protocol scenarios and depicted in diagram 1.6 and 1.7. The current stream state is stored in the zrtp_stream_ctx_t::state variable and available for reading at any time.

Warning:
! Don't change order of these definition without synchronizing with print* functions (see zrtp_log.h)
Enumerator:
ZRTP_STATE_NONE 
ZRTP_STATE_ACTIVE 
ZRTP_STATE_START 
ZRTP_STATE_WAIT_HELLOACK 
ZRTP_STATE_WAIT_HELLO 
ZRTP_STATE_CLEAR 
ZRTP_STATE_START_INITIATINGSECURE 
ZRTP_STATE_INITIATINGSECURE 
ZRTP_STATE_WAIT_CONFIRM1 
ZRTP_STATE_WAIT_CONFIRMACK 
ZRTP_STATE_PENDINGSECURE 
ZRTP_STATE_WAIT_CONFIRM2 
ZRTP_STATE_SECURE 
ZRTP_STATE_SASRELAYING 
ZRTP_STATE_INITIATINGCLEAR 
ZRTP_STATE_PENDINGCLEAR 
ZRTP_STATE_INITIATINGERROR 
ZRTP_STATE_PENDINGERROR 
ZRTP_STATE_ERROR 
ZRTP_STATE_NO_ZRTP 
ZRTP_STATE_COUNT 

Definition at line 42 of file zrtp_types.h.

enum zrtp_statemachine_type

enumeration for protocol state-machine roles Protocol role fully defines it's behavior. ZRTP peer chooses a role according to specification. For details see internal developers documentation

Enumerator:
ZRTP_STATEMACHINE_NONE 
ZRTP_STATEMACHINE_INITIATOR  Unknown type. Used as error value
ZRTP_STATEMACHINE_RESPONDER  Defines initiator's protocol logic

Definition at line 153 of file zrtp_types.h.

enum zrtp_stream_mode

Enumeration for ZRTP stream mode definition.

Warning:
! Don't change order of these definition without synchronizing with print* functions (see zrtp_log.h)
Enumerator:
ZRTP_STREAM_MODE_UNKN 
ZRTP_STREAM_MODE_CLEAR  Unused stream - unknown mode
ZRTP_STREAM_MODE_DH  Just after stream attaching - mode is undefined
ZRTP_STREAM_MODE_PRESHARED  FULL DH ZRTP stream mode
ZRTP_STREAM_MODE_MULT  PRESHARED ZRTP stream mode
ZRTP_STREAM_MODE_COUNT  MULTISTREAM ZRTP stream mode

Definition at line 77 of file zrtp_types.h.


This file is part of the documentation for Zfone.
Copyright ©  2006-2008 Philip R. Zimmermann. All rights reserved.
Generated on Mon November 10 2008 by doxygen 1.5.7-20060202. Written by Viktor Krikun, © 2006-2008