#include "zrtp_config.h"#include "bn.h"#include "zrtp_base.h"#include "zrtp_iface.h"#include "zrtp_list.h"#include "zrtp_legal.h"#include "zrtp_string.h"#include "zrtp_protocol.h"Go to the source code of this file.
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:
| |
| 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... | |
| struct | zrtp_rtp_hdr_t |
| struct | zrtp_rtcp_hdr_t |
| struct | zrtp_rtcp_trailer_t |
| struct | zrtp_rtp_hdr_xtnd_t |
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... | |