webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
libSRTP provides functions for protecting RTP and RTCP. See Section Overview for an introduction to the use of the library. More...
Modules | |
Secure RTCP | |
Secure RTCP functions are used to protect RTCP traffic. | |
data associated to a SRTP session. | |
Store custom user data within a SRTP session. | |
SRTP events and callbacks | |
libSRTP can use a user-provided callback function to handle events. | |
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... | |
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... | |
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_t * | srtp_ekt_policy_t |
points to an EKT policy More... | |
typedef struct srtp_ekt_stream_ctx_t * | srtp_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_t * | srtp_t |
An srtp_t points to an SRTP session structure. More... | |
typedef srtp_stream_ctx_t * | srtp_stream_t |
An srtp_stream_t points to an SRTP stream structure. More... | |
libSRTP provides functions for protecting RTP and RTCP. See Section Overview for an introduction to the use of the library.
#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.
p | is a pointer to the policy structure to be set |
The function srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80() is a synonym for srtp_crypto_policy_set_rtp_default(). It conforms to the naming convention used in RFC 4568 (SDP Security Descriptions for Media Streams).
#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().
SRTP_MAX_TRAILER_LEN is the maximum length of the SRTP trailer (authentication tag and MKI) supported by libSRTP. This value is the maximum number of octets that will be added to an RTP packet by srtp_protect().
An srtp_auth_type_id_t is an identifier for a particular authentication function.
An srtp_auth_type_id_t is an integer that represents a particular authentication function type, e.g. HMAC-SHA1. A SRTP_NULL_AUTH is avaliable; this authentication function performs no computation, and can be selected to indicate that no authentication is to take place.
A srtp_cipher_type_id_t is an identifier for a particular cipher type.
A srtp_cipher_type_id_t is an integer that represents a particular cipher type, e.g. the Advanced Encryption Standard (AES). A SRTP_NULL_CIPHER is avaliable; this cipher leaves the data unchanged, and can be selected to indicate that no encryption is to take place.
srtp_crypto_policy_t describes a particular crypto policy that can be applied to an SRTP stream.
A srtp_crypto_policy_t describes a particular cryptographic policy that can be applied to an SRTP or SRTCP stream. An SRTP session policy consists of a list of these policies, one for each SRTP stream in the session.
typedef struct srtp_ctx_t_ srtp_ctx_t |
points to an EKT policy
points to EKT stream data
typedef struct srtp_policy_t srtp_policy_t |
represents the policy for an SRTP session.
A single srtp_policy_t struct represents the policy for a single SRTP stream, and a linked list of these elements represents the policy for an entire SRTP session. Each element contains the SRTP and SRTCP crypto policies for that stream, a pointer to the SRTP master key for that stream, the SSRC describing that stream, or a flag indicating a `wildcard' SSRC value, and a `next' field that holds a pointer to the next element in the list of policy elements, or NULL if it is the last element.
The wildcard value SSRC_ANY_INBOUND matches any SSRC from an inbound stream that for which there is no explicit SSRC entry in another policy element. Similarly, the value SSRC_ANY_OUTBOUND will matches any SSRC from an outbound stream that does not appear in another policy element. Note that wildcard SSRCs &b cannot be used to match both inbound and outbound traffic. This restriction is intentional, and it allows libSRTP to ensure that no security lapses result from accidental re-use of SSRC values during key sharing.
An srtp_stream_t points to an SRTP stream structure.
The typedef srtp_stream_t is a pointer to a structure that represents an SRTP stream. This datatype is intentionally opaque in order to separate the interface from the implementation.
An SRTP stream consists of all of the traffic sent to an SRTP session by a single participant. A session can be viewed as a set of streams.
An srtp_t points to an SRTP session structure.
The typedef srtp_t is a pointer to a structure that represents an SRTP session. This datatype is intentially opaque in order to separate the interface from the implementation.
An SRTP session consists of all of the traffic sent to the RTP and RTCP destination transport addresses, using the RTP/SAVP (Secure Audio/Video Profile). A session can be viewed as a set of SRTP streams, each of which originates with a different participant.
srtp_sec_serv_t describes a set of security services.
A srtp_sec_serv_t enumeration is used to describe the particular security services that will be applied by a particular crypto policy (or other mechanism).
Enumerator | |
---|---|
sec_serv_none | no services |
sec_serv_conf | confidentiality |
sec_serv_auth | authentication |
sec_serv_conf_and_auth | confidentiality and authentication |
srtp_ssrc_type_t describes the type of an SSRC.
An srtp_ssrc_type_t enumeration is used to indicate a type of SSRC. See srtp_policy_t for more informataion.
Enumerator | |
---|---|
ssrc_undefined | Indicates an undefined SSRC type. |
ssrc_specific | Indicates a specific SSRC value |
ssrc_any_inbound | Indicates any inbound SSRC value (i.e. a value that is used in the function srtp_unprotect()) |
ssrc_any_outbound | Indicates any outbound SSRC value (i.e. a value that is used in the function srtp_protect()) |
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.
The function call srtp_add_stream(session, policy) allocates and initializes a new SRTP stream within a given, previously created session, applying the policy given as the other argument to that stream.
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
The function call srtp_append_salt_to_key(k, klen, s, slen) copies the string s to the location at klen bytes following the location k.
srtp_err_status_t srtp_create | ( | srtp_t * | session, |
const srtp_policy_t * | policy | ||
) |
srtp_create() allocates and initializes an SRTP session.
The function call srtp_create(session, policy) allocates and initializes an SRTP session context, applying the given policy.
session | is a pointer to the SRTP session to which the policy is to be added. |
policy | is the srtp_policy_t struct that describes the policy for the session. The struct may be a single element, or it may be the head of a list, in which case each element of the list is processed. It may also be NULL, in which case streams should be added later using srtp_add_stream(). The final element of the list must have its `next' field set to NULL. |
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
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32(&p) sets the srtp_crypto_policy_t at location p to use policy AES_CM_128_HMAC_SHA1_32 as defined in RFC 4568. This policy uses AES-128 Counter Mode encryption and HMAC-SHA1 authentication, with an authentication tag that is only 32 bits long. This length is considered adequate only for protecting audio and video media that use a stateless playback function. See Section 7.5 of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt).
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_aes_cm_128_null_auth(&p) sets the srtp_crypto_policy_t at location p to use the SRTP default cipher (AES-128 Counter Mode), but to use no authentication method. This policy is NOT RECOMMENDED unless it is unavoidable; see Section 7.5 of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt).
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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.
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_aes_cm_256_hmac_sha1_32(&p) sets the srtp_crypto_policy_t at location p to use policy AES_CM_256_HMAC_SHA1_32 as defined in draft-ietf-avt-srtp-big-aes-03.txt. This policy uses AES-256 Counter Mode encryption and HMAC-SHA1 authentication, with an authentication tag that is only 32 bits long. This length is considered adequate only for protecting audio and video media that use a stateless playback function. See Section 7.5 of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt).
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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.
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80(&p) sets the srtp_crypto_policy_t at location p to use policy AES_CM_256_HMAC_SHA1_80 as defined in draft-ietf-avt-srtp-big-aes-03.txt. This policy uses AES-256 Counter Mode encryption and HMAC-SHA1 authentication, with an 80 bit authentication tag.
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_aes_cm_256_null_auth(&p) sets the srtp_crypto_policy_t at location p to use the SRTP default cipher (AES-256 Counter Mode), but to use no authentication method. This policy is NOT RECOMMENDED unless it is unavoidable; see Section 7.5 of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt).
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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.
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_aes_gcm_128_16_auth(&p) sets the srtp_crypto_policy_t at location p to use the SRTP default cipher (AES-128 Galois Counter Mode) with 16 octet auth tag. This policy applies confidentiality and authentication to both the RTP and RTCP packets.
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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.
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_aes_gcm_128_8_auth(&p) sets the srtp_crypto_policy_t at location p to use the SRTP default cipher (AES-128 Galois Counter Mode) with 8 octet auth tag. This policy applies confidentiality and authentication to both the RTP and RTCP packets.
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_aes_gcm_128_8_only_auth(&p) sets the srtp_crypto_policy_t at location p to use the SRTP default cipher (AES-128 Galois Counter Mode) with 8 octet auth tag. This policy applies confidentiality and authentication to the RTP packets, but only authentication to the RTCP packets.
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_aes_gcm_256_16_auth(&p) sets the srtp_crypto_policy_t at location p to use the SRTP default cipher (AES-256 Galois Counter Mode) with 16 octet auth tag. This policy applies confidentiality and authentication to both the RTP and RTCP packets.
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_aes_gcm_256_8_auth(&p) sets the srtp_crypto_policy_t at location p to use the SRTP default cipher (AES-256 Galois Counter Mode) with 8 octet auth tag. This policy applies confidentiality and authentication to both the RTP and RTCP packets.
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_aes_gcm_256_8_only_auth(&p) sets the srtp_crypto_policy_t at location p to use the SRTP default cipher (AES-256 Galois Counter Mode) with 8 octet auth tag. This policy applies confidentiality and authentication to the RTP packets, but only authentication to the RTCP packets.
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_rtcp_default(&policy, profile) sets the srtp_crypto_policy_t at location policy to the policy for RTCP protection, as defined by the srtp_profile_t profile.
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_rtp_default(&policy, profile) sets the srtp_crypto_policy_t at location policy to the policy for RTP protection, as defined by the srtp_profile_t profile.
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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.
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_null_cipher_hmac_null(&p) sets the srtp_crypto_policy_t at location p to use no encryption and no authentication. This policy should only be used for testing and troubleshootingl.
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_null_cipher_hmac_sha1_80(&p) sets the srtp_crypto_policy_t at location p to use HMAC-SHA1 with an 80 bit authentication tag to provide message authentication, but to use no encryption. This policy is NOT RECOMMENDED for SRTP unless there is a requirement to forego encryption.
This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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.
p | is a pointer to the policy structure to be set |
The function call srtp_crypto_policy_set_rtcp_default(&p) sets the srtp_crypto_policy_t at location p to the SRTP default policy for RTCP protection, as defined in the specification. This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the srtp_crypto_policy_t datatype.
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.
p | is a pointer to the policy structure to be set |
The function call crypto_policy_set_rtp_default(&p) sets the crypto_policy_t at location p to the SRTP default policy for RTP protection, as defined in the specification. This function is a convenience that helps to avoid dealing directly with the policy data structure. You are encouraged to initialize policy elements with this function call. Doing so may allow your code to be forward compatible with later versions of libSRTP that include more elements in the crypto_policy_t datatype.
srtp_err_status_t srtp_dealloc | ( | srtp_t | s | ) |
srtp_dealloc() deallocates storage for an SRTP session context.
The function call srtp_dealloc(s) deallocates storage for the SRTP session context s. This function should be called no more than one time for each of the contexts allocated by the function srtp_create().
s | is the srtp_t for the session to be deallocated. |
srtp_err_status_t srtp_init | ( | void | ) |
srtp_init() initializes the srtp library.
unsigned int srtp_profile_get_master_key_length | ( | srtp_profile_t | profile | ) |
returns the master key length for a given SRTP profile
unsigned int srtp_profile_get_master_salt_length | ( | srtp_profile_t | profile | ) |
returns the master salt length for a given SRTP profile
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.
The function call srtp_protect(ctx, rtp_hdr, len_ptr) applies SRTP protection to the RTP packet rtp_hdr (which has length *len_ptr) using the SRTP context ctx. If srtp_err_status_ok is returned, then rtp_hdr points to the resulting SRTP packet and *len_ptr is the number of octets in that packet; otherwise, no assumptions should be made about the value of either data elements.
The sequence numbers of the RTP packets presented to this function need not be consecutive, but they must be out of order by less than 2^15 = 32,768 packets.
ctx | is the SRTP context to use in processing the packet. |
rtp_hdr | is a pointer to the RTP packet (before the call); after the function returns, it points to the srtp packet. |
len_ptr | is a pointer to the length in octets of the complete RTP packet (header and body) before the function call, and of the complete SRTP packet after the call, if srtp_err_status_ok was returned. Otherwise, the value of the data to which it points is undefined. |
srtp_err_status_t srtp_remove_stream | ( | srtp_t | session, |
unsigned int | ssrc | ||
) |
srtp_remove_stream() deallocates an SRTP stream.
The function call srtp_remove_stream(session, ssrc) removes the SRTP stream with the SSRC value ssrc from the SRTP session context given by the argument session.
session | is the SRTP session from which the stream will be removed. |
ssrc | is the SSRC value of the stream to be removed in network byte order. |
srtp_err_status_t srtp_shutdown | ( | void | ) |
srtp_shutdown() de-initializes the srtp library.
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.
The function call srtp_unprotect(ctx, srtp_hdr, len_ptr) verifies the Secure RTP protection of the SRTP packet pointed to by srtp_hdr (which has length *len_ptr), using the SRTP context ctx. If srtp_err_status_ok is returned, then srtp_hdr points to the resulting RTP packet and *len_ptr is the number of octets in that packet; otherwise, no assumptions should be made about the value of either data elements.
The sequence numbers of the RTP packets presented to this function need not be consecutive, but they must be out of order by less than 2^15 = 32,768 packets.
ctx | is the SRTP session which applies to the particular packet. |
srtp_hdr | is a pointer to the header of the SRTP packet (before the call). after the function returns, it points to the rtp packet if srtp_err_status_ok was returned; otherwise, the value of the data to which it points is undefined. |
len_ptr | is a pointer to the length in octets of the complete srtp packet (header and body) before the function call, and of the complete rtp packet after the call, if srtp_err_status_ok was returned. Otherwise, the value of the data to which it points is undefined. |
srtp_err_status_t srtp_update | ( | srtp_t | session, |
const srtp_policy_t * | policy | ||
) |
srtp_update() udpates all streams in the session.
The function call srtp_update(session, policy) updates all the streams in the session applying the given policy and key. The exsisting ROC value of all streams will be preserved.
session | is the SRTP session that contains the streams to be updated. |
policy | is the srtp_policy_t struct that describes the policy for the session. The struct may be a single element, or it may be the head of a list, in which case each element of the list is processed. The final element of the list must have its `next' field set to NULL. |
srtp_err_status_t srtp_update_stream | ( | srtp_t | session, |
const srtp_policy_t * | policy | ||
) |
srtp_update_stream() udpates a SRTP stream.
The function call srtp_update_stream(session, policy) updates the stream(s) in the session that match applying the given policy and key. The exsisting ROC value of all stream(s) will be preserved.
session | is the SRTP session that contains the streams to be updated. |
policy | is the srtp_policy_t struct that describes the policy for the session. |