webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Macros | Typedefs | Enumerations | Functions
srtp.h File Reference
#include <stdint.h>

Go to the source code of this file.

Classes

struct  srtp_hdr_t
 
struct  srtp_hdr_xtnd_t
 
struct  srtcp_hdr_t
 
struct  srtcp_trailer_t
 
struct  srtp_crypto_policy_t
 srtp_crypto_policy_t describes a particular crypto policy that can be applied to an SRTP stream. More...
 
struct  srtp_ssrc_t
 An srtp_ssrc_t represents a particular SSRC value, or a `wildcard' SSRC. More...
 
struct  srtp_policy_t
 represents the policy for an SRTP session. More...
 
struct  srtp_event_data_t
 srtp_event_data_t is the structure passed as a callback to the event handler function More...
 

Macros

#define SRTP_MASTER_KEY_LEN   30
 
#define SRTP_MAX_KEY_LEN   64
 
#define SRTP_MAX_TAG_LEN   16
 
#define SRTP_MAX_TRAILER_LEN   SRTP_MAX_TAG_LEN
 the maximum number of octets added by srtp_protect(). More...
 
#define SRTP_AEAD_SALT_LEN   12
 
#define SRTP_AES_128_GCM_KEYSIZE_WSALT   SRTP_AEAD_SALT_LEN + 16
 
#define SRTP_AES_192_GCM_KEYSIZE_WSALT   SRTP_AEAD_SALT_LEN + 24
 
#define SRTP_AES_256_GCM_KEYSIZE_WSALT   SRTP_AEAD_SALT_LEN + 32
 
#define srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(p)   srtp_crypto_policy_set_rtp_default(p)
 srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80() sets a crypto policy structure to the SRTP default policy for RTP protection. More...
 
#define SRTCP_E_BIT   0x80000000
 
#define SRTCP_E_BYTE_BIT   0x80
 
#define SRTCP_INDEX_MASK   0x7fffffff
 

Typedefs

typedef uint32_t srtp_cipher_type_id_t
 A srtp_cipher_type_id_t is an identifier for a particular cipher type. More...
 
typedef uint32_t srtp_auth_type_id_t
 An srtp_auth_type_id_t is an identifier for a particular authentication function. More...
 
typedef struct srtp_stream_ctx_t_ srtp_stream_ctx_t
 
typedef struct srtp_ctx_t_ srtp_ctx_t
 
typedef struct srtp_crypto_policy_t srtp_crypto_policy_t
 srtp_crypto_policy_t describes a particular crypto policy that can be applied to an SRTP stream. More...
 
typedef struct srtp_ekt_policy_ctx_tsrtp_ekt_policy_t
 points to an EKT policy More...
 
typedef struct srtp_ekt_stream_ctx_tsrtp_ekt_stream_t
 points to EKT stream data More...
 
typedef struct srtp_policy_t srtp_policy_t
 represents the policy for an SRTP session. More...
 
typedef srtp_ctx_tsrtp_t
 An srtp_t points to an SRTP session structure. More...
 
typedef srtp_stream_ctx_tsrtp_stream_t
 An srtp_stream_t points to an SRTP stream structure. More...
 
typedef struct srtp_event_data_t srtp_event_data_t
 srtp_event_data_t is the structure passed as a callback to the event handler function More...
 
typedef void() srtp_event_handler_func_t(srtp_event_data_t *data)
 srtp_event_handler_func_t is the function prototype for the event handler. More...
 

Enumerations

enum  srtp_err_status_t {
  srtp_err_status_ok = 0, srtp_err_status_fail = 1, srtp_err_status_bad_param = 2, srtp_err_status_alloc_fail = 3,
  srtp_err_status_dealloc_fail = 4, srtp_err_status_init_fail = 5, srtp_err_status_terminus = 6, srtp_err_status_auth_fail = 7,
  srtp_err_status_cipher_fail = 8, srtp_err_status_replay_fail = 9, srtp_err_status_replay_old = 10, srtp_err_status_algo_fail = 11,
  srtp_err_status_no_such_op = 12, srtp_err_status_no_ctx = 13, srtp_err_status_cant_check = 14, srtp_err_status_key_expired = 15,
  srtp_err_status_socket_err = 16, srtp_err_status_signal_err = 17, srtp_err_status_nonce_bad = 18, srtp_err_status_read_fail = 19,
  srtp_err_status_write_fail = 20, srtp_err_status_parse_err = 21, srtp_err_status_encode_err = 22, srtp_err_status_semaphore_err = 23,
  srtp_err_status_pfkey_err = 24
}
 
enum  srtp_sec_serv_t { sec_serv_none = 0, sec_serv_conf = 1, sec_serv_auth = 2, sec_serv_conf_and_auth = 3 }
 srtp_sec_serv_t describes a set of security services. More...
 
enum  srtp_ssrc_type_t { ssrc_undefined = 0, ssrc_specific = 1, ssrc_any_inbound = 2, ssrc_any_outbound = 3 }
 srtp_ssrc_type_t describes the type of an SSRC. More...
 
enum  srtp_profile_t {
  srtp_profile_reserved = 0, srtp_profile_aes128_cm_sha1_80 = 1, srtp_profile_aes128_cm_sha1_32 = 2, srtp_profile_aes256_cm_sha1_80 = 3,
  srtp_profile_aes256_cm_sha1_32 = 4, srtp_profile_null_sha1_80 = 5, srtp_profile_null_sha1_32 = 6
}
 
enum  srtp_event_t { event_ssrc_collision, event_key_soft_limit, event_key_hard_limit, event_packet_index_limit }
 srtp_event_t defines events that need to be handled More...
 

Functions

srtp_err_status_t srtp_init (void)
 srtp_init() initializes the srtp library. More...
 
srtp_err_status_t srtp_shutdown (void)
 srtp_shutdown() de-initializes the srtp library. More...
 
srtp_err_status_t srtp_protect (srtp_t ctx, void *rtp_hdr, int *len_ptr)
 srtp_protect() is the Secure RTP sender-side packet processing function. More...
 
srtp_err_status_t srtp_unprotect (srtp_t ctx, void *srtp_hdr, int *len_ptr)
 srtp_unprotect() is the Secure RTP receiver-side packet processing function. More...
 
srtp_err_status_t srtp_create (srtp_t *session, const srtp_policy_t *policy)
 srtp_create() allocates and initializes an SRTP session. More...
 
srtp_err_status_t srtp_add_stream (srtp_t session, const srtp_policy_t *policy)
 srtp_add_stream() allocates and initializes an SRTP stream within a given SRTP session. More...
 
srtp_err_status_t srtp_remove_stream (srtp_t session, unsigned int ssrc)
 srtp_remove_stream() deallocates an SRTP stream. More...
 
srtp_err_status_t srtp_update (srtp_t session, const srtp_policy_t *policy)
 srtp_update() udpates all streams in the session. More...
 
srtp_err_status_t srtp_update_stream (srtp_t session, const srtp_policy_t *policy)
 srtp_update_stream() udpates a SRTP stream. More...
 
void srtp_crypto_policy_set_rtp_default (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_rtp_default() sets a crypto policy structure to the SRTP default policy for RTP protection. More...
 
void srtp_crypto_policy_set_rtcp_default (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_rtcp_default() sets a crypto policy structure to the SRTP default policy for RTCP protection. More...
 
void srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32 (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32() sets a crypto policy structure to a short-authentication tag policy More...
 
void srtp_crypto_policy_set_aes_cm_128_null_auth (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_aes_cm_128_null_auth() sets a crypto policy structure to an encryption-only policy More...
 
void srtp_crypto_policy_set_null_cipher_hmac_sha1_80 (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_null_cipher_hmac_sha1_80() sets a crypto policy structure to an authentication-only policy More...
 
void srtp_crypto_policy_set_null_cipher_hmac_null (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_null_cipher_hmac_null() sets a crypto policy structure to use no encryption or authentication. More...
 
void srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80() sets a crypto policy structure to a encryption and authentication policy using AES-256 for RTP protection. More...
 
void srtp_crypto_policy_set_aes_cm_256_hmac_sha1_32 (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_aes_cm_256_hmac_sha1_32() sets a crypto policy structure to a short-authentication tag policy using AES-256 encryption. More...
 
void srtp_crypto_policy_set_aes_cm_256_null_auth (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_aes_cm_256_null_auth() sets a crypto policy structure to an encryption-only policy More...
 
void srtp_crypto_policy_set_aes_gcm_128_8_auth (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_aes_gcm_128_8_auth() sets a crypto policy structure to an AEAD encryption policy. More...
 
void srtp_crypto_policy_set_aes_gcm_256_8_auth (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_aes_gcm_256_8_auth() sets a crypto policy structure to an AEAD encryption policy More...
 
void srtp_crypto_policy_set_aes_gcm_128_8_only_auth (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_aes_gcm_128_8_only_auth() sets a crypto policy structure to an AEAD authentication-only policy More...
 
void srtp_crypto_policy_set_aes_gcm_256_8_only_auth (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_aes_gcm_256_8_only_auth() sets a crypto policy structure to an AEAD authentication-only policy More...
 
void srtp_crypto_policy_set_aes_gcm_128_16_auth (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_aes_gcm_128_16_auth() sets a crypto policy structure to an AEAD encryption policy. More...
 
void srtp_crypto_policy_set_aes_gcm_256_16_auth (srtp_crypto_policy_t *p)
 srtp_crypto_policy_set_aes_gcm_256_16_auth() sets a crypto policy structure to an AEAD encryption policy More...
 
srtp_err_status_t srtp_dealloc (srtp_t s)
 srtp_dealloc() deallocates storage for an SRTP session context. More...
 
srtp_err_status_t srtp_crypto_policy_set_from_profile_for_rtp (srtp_crypto_policy_t *policy, srtp_profile_t profile)
 srtp_crypto_policy_set_from_profile_for_rtp() sets a crypto policy structure to the appropriate value for RTP based on an srtp_profile_t More...
 
srtp_err_status_t srtp_crypto_policy_set_from_profile_for_rtcp (srtp_crypto_policy_t *policy, srtp_profile_t profile)
 srtp_crypto_policy_set_from_profile_for_rtcp() sets a crypto policy structure to the appropriate value for RTCP based on an srtp_profile_t More...
 
unsigned int srtp_profile_get_master_key_length (srtp_profile_t profile)
 returns the master key length for a given SRTP profile More...
 
unsigned int srtp_profile_get_master_salt_length (srtp_profile_t profile)
 returns the master salt length for a given SRTP profile More...
 
void srtp_append_salt_to_key (unsigned char *key, unsigned int bytes_in_key, unsigned char *salt, unsigned int bytes_in_salt)
 appends the salt to the key More...
 
srtp_err_status_t srtp_protect_rtcp (srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len)
 srtp_protect_rtcp() is the Secure RTCP sender-side packet processing function. More...
 
srtp_err_status_t srtp_unprotect_rtcp (srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len)
 srtp_unprotect_rtcp() is the Secure RTCP receiver-side packet processing function. More...
 
void srtp_set_user_data (srtp_t ctx, void *data)
 srtp_set_user_data() stores the given pointer into the SRTP session for later retrieval. More...
 
voidsrtp_get_user_data (srtp_t ctx)
 srtp_get_user_data() retrieves the pointer to the custom data previously stored with srtp_set_user_data(). More...
 
srtp_err_status_t srtp_install_event_handler (srtp_event_handler_func_t func)
 sets the event handler to the function supplied by the caller. More...
 
const char * srtp_get_version_string (void)
 Returns the version string of the library. More...
 
unsigned int srtp_get_version (void)
 Returns the numeric representation of the library version. More...
 
srtp_err_status_t srtp_set_debug_module (char *mod_name, int v)
 srtp_set_debug_module(mod_name, v) More...
 
srtp_err_status_t srtp_list_debug_modules (void)
 srtp_list_debug_modules() outputs a list of debugging modules More...
 

Macro Definition Documentation

◆ SRTCP_E_BIT

#define SRTCP_E_BIT   0x80000000

◆ SRTCP_E_BYTE_BIT

#define SRTCP_E_BYTE_BIT   0x80

◆ SRTCP_INDEX_MASK

#define SRTCP_INDEX_MASK   0x7fffffff