libSRTP  2.1.0-pre
srtp.h
1 /*
2  * srtp.h
3  *
4  * interface to libsrtp
5  *
6  * David A. McGrew
7  * Cisco Systems, Inc.
8  */
9 /*
10  *
11  * Copyright (c) 2001-2006, Cisco Systems, Inc.
12  * All rights reserved.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions
16  * are met:
17  *
18  * Redistributions of source code must retain the above copyright
19  * notice, this list of conditions and the following disclaimer.
20  *
21  * Redistributions in binary form must reproduce the above
22  * copyright notice, this list of conditions and the following
23  * disclaimer in the documentation and/or other materials provided
24  * with the distribution.
25  *
26  * Neither the name of the Cisco Systems, Inc. nor the names of its
27  * contributors may be used to endorse or promote products derived
28  * from this software without specific prior written permission.
29  *
30  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
33  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
34  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
35  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
36  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
37  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
41  * OF THE POSSIBILITY OF SUCH DAMAGE.
42  *
43  */
44 
45 
46 #ifndef SRTP_SRTP_H
47 #define SRTP_SRTP_H
48 
49 #include <stdint.h>
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
64 /*
65  * SRTP_MASTER_KEY_LEN is the nominal master key length supported by libSRTP
66  */
67 
68 #define SRTP_MASTER_KEY_LEN 30
69 
70 /*
71  * SRTP_MAX_KEY_LEN is the maximum key length supported by libSRTP
72  */
73 #define SRTP_MAX_KEY_LEN 64
74 
75 /*
76  * SRTP_MAX_TAG_LEN is the maximum tag length supported by libSRTP
77  */
78 
79 #define SRTP_MAX_TAG_LEN 16
80 
85 #define SRTP_MAX_MKI_LEN 128
86 
87 
96 #define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN + SRTP_MAX_MKI_LEN
97 
103 #define SRTP_MAX_NUM_MASTER_KEYS 16
104 
105 /*
106  * SRTP_AEAD_SALT_LEN is the length of the SALT values used with
107  * GCM mode. GCM mode requires an IV. The SALT value is used
108  * as part of the IV formation logic applied to each RTP packet.
109  */
110 #define SRTP_AEAD_SALT_LEN 12
111 #define SRTP_AES_128_GCM_KEYSIZE_WSALT SRTP_AEAD_SALT_LEN + 16
112 #define SRTP_AES_192_GCM_KEYSIZE_WSALT SRTP_AEAD_SALT_LEN + 24
113 #define SRTP_AES_256_GCM_KEYSIZE_WSALT SRTP_AEAD_SALT_LEN + 32
114 
115 /*
116  * an srtp_hdr_t represents the srtp header
117  *
118  * in this implementation, an srtp_hdr_t is assumed to be 32-bit aligned
119  *
120  * (note that this definition follows that of RFC 1889 Appendix A, but
121  * is not identical)
122  */
123 
124 #ifndef WORDS_BIGENDIAN
125 
126 /*
127  * srtp_hdr_t represents an RTP or SRTP header. The bit-fields in
128  * this structure should be declared "unsigned int" instead of
129  * "unsigned char", but doing so causes the MS compiler to not
130  * fully pack the bit fields.
131  */
132 
133 typedef struct {
134  unsigned char cc:4; /* CSRC count */
135  unsigned char x:1; /* header extension flag */
136  unsigned char p:1; /* padding flag */
137  unsigned char version:2; /* protocol version */
138  unsigned char pt:7; /* payload type */
139  unsigned char m:1; /* marker bit */
140  uint16_t seq; /* sequence number */
141  uint32_t ts; /* timestamp */
142  uint32_t ssrc; /* synchronization source */
143 } srtp_hdr_t;
144 
145 #else /* BIG_ENDIAN */
146 
147 typedef struct {
148  unsigned char version:2; /* protocol version */
149  unsigned char p:1; /* padding flag */
150  unsigned char x:1; /* header extension flag */
151  unsigned char cc:4; /* CSRC count */
152  unsigned char m:1; /* marker bit */
153  unsigned char pt:7; /* payload type */
154  uint16_t seq; /* sequence number */
155  uint32_t ts; /* timestamp */
156  uint32_t ssrc; /* synchronization source */
157 } srtp_hdr_t;
158 
159 #endif
160 
161 typedef struct {
162  uint16_t profile_specific; /* profile-specific info */
163  uint16_t length; /* number of 32-bit words in extension */
165 
166 
167 /*
168  * srtcp_hdr_t represents a secure rtcp header
169  *
170  * in this implementation, an srtcp header is assumed to be 32-bit
171  * alinged
172  */
173 
174 #ifndef WORDS_BIGENDIAN
175 
176 typedef struct {
177  unsigned char rc:5; /* reception report count */
178  unsigned char p:1; /* padding flag */
179  unsigned char version:2; /* protocol version */
180  unsigned char pt:8; /* payload type */
181  uint16_t len; /* length */
182  uint32_t ssrc; /* synchronization source */
183 } srtcp_hdr_t;
184 
185 typedef struct {
186  unsigned int index:31; /* srtcp packet index in network order! */
187  unsigned int e:1; /* encrypted? 1=yes */
188  /* optional mikey/etc go here */
189  /* and then the variable-length auth tag */
191 
192 
193 #else /* BIG_ENDIAN */
194 
195 typedef struct {
196  unsigned char version:2; /* protocol version */
197  unsigned char p:1; /* padding flag */
198  unsigned char rc:5; /* reception report count */
199  unsigned char pt:8; /* payload type */
200  uint16_t len; /* length */
201  uint32_t ssrc; /* synchronization source */
202 } srtcp_hdr_t;
203 
204 typedef struct {
205  unsigned int version:2; /* protocol version */
206  unsigned int p:1; /* padding flag */
207  unsigned int count:5; /* varies by packet type */
208  unsigned int pt:8; /* payload type */
209  uint16_t length; /* len of uint32s of packet less header */
210 } rtcp_common_t;
211 
212 typedef struct {
213  unsigned int e:1; /* encrypted? 1=yes */
214  unsigned int index:31; /* srtcp packet index */
215  /* optional mikey/etc go here */
216  /* and then the variable-length auth tag */
218 
219 #endif
220 
221 
222 
235 typedef uint32_t srtp_cipher_type_id_t;
236 
249 typedef uint32_t srtp_auth_type_id_t;
250 
251 /*
252  * @brief srtp_err_status_t defines error codes.
253  *
254  * The enumeration srtp_err_status_t defines error codes. Note that the
255  * value of srtp_err_status_ok is equal to zero, which can simplify error
256  * checking somewhat.
257  *
258  */
259 typedef enum {
287 
288 
289 typedef struct srtp_ctx_t_ srtp_ctx_t;
290 
299 typedef enum {
305 
316 typedef struct srtp_crypto_policy_t {
317  srtp_cipher_type_id_t cipher_type;
321  srtp_auth_type_id_t auth_type;
330 
331 
339 typedef enum {
349 
360 typedef struct {
362  unsigned int value;
363 } srtp_ssrc_t;
364 
365 
369 typedef struct srtp_ekt_policy_ctx_t *srtp_ekt_policy_t;
370 
371 
375 typedef struct srtp_ekt_stream_ctx_t *srtp_ekt_stream_t;
376 
383 typedef struct srtp_master_key_t {
384  unsigned char *key;
385  unsigned char *mki_id;
386  unsigned int mki_size;
388 
416 typedef struct srtp_policy_t {
424  unsigned char *key;
426  srtp_master_key_t **keys;
427  unsigned long num_master_keys;
428  srtp_ekt_policy_t ekt;
430  unsigned long window_size;
438  int *enc_xtn_hdr;
440  struct srtp_policy_t *next;
441 } srtp_policy_t;
442 
443 
444 
445 
459 typedef srtp_ctx_t *srtp_t;
460 
461 
470 
478 
520 srtp_err_status_t srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
521 
570 srtp_err_status_t srtp_protect_mki(srtp_ctx_t *ctx, void *rtp_hdr,
571  int *pkt_octet_len, unsigned int use_mki,
572  unsigned int mki_index);
573 
615 srtp_err_status_t srtp_unprotect(srtp_t ctx, void *srtp_hdr, int *len_ptr);
616 
659 srtp_err_status_t srtp_unprotect_mki(srtp_t ctx, void *srtp_hdr, int *len_ptr,
660  unsigned int use_mki);
661 
684 srtp_err_status_t srtp_create(srtp_t *session, const srtp_policy_t *policy);
685 
686 
702 srtp_err_status_t srtp_add_stream(srtp_t session, const srtp_policy_t *policy);
703 
704 
727 srtp_err_status_t srtp_remove_stream(srtp_t session, unsigned int ssrc);
728 
754 srtp_err_status_t srtp_update(srtp_t session, const srtp_policy_t *policy);
755 
778 srtp_err_status_t srtp_update_stream(srtp_t session, const srtp_policy_t *policy);
779 
800 
821 
837 #define srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(p) srtp_crypto_policy_set_rtp_default(p)
838 
839 
872 
873 
874 
902 
903 
929 
954 
955 
981 
982 
1016 
1043 
1066 
1089 
1112 
1135 
1158 
1181 
1182 
1200 
1201 
1202 /*
1203  * @brief identifies a particular SRTP profile
1204  *
1205  * An srtp_profile_t enumeration is used to identify a particular SRTP
1206  * profile (that is, a set of algorithms and parameters). These
1207  * profiles are defined in the DTLS-SRTP draft.
1208  */
1209 
1210 typedef enum {
1211  srtp_profile_reserved = 0,
1212  srtp_profile_aes128_cm_sha1_80 = 1,
1213  srtp_profile_aes128_cm_sha1_32 = 2,
1214  srtp_profile_aes256_cm_sha1_80 = 3,
1215  srtp_profile_aes256_cm_sha1_32 = 4,
1216  srtp_profile_null_sha1_80 = 5,
1217  srtp_profile_null_sha1_32 = 6,
1218 } srtp_profile_t;
1219 
1220 
1243 
1244 
1245 
1246 
1269 
1273 unsigned int
1274 srtp_profile_get_master_key_length(srtp_profile_t profile);
1275 
1276 
1280 unsigned int
1281 srtp_profile_get_master_salt_length(srtp_profile_t profile);
1282 
1295 void
1296 srtp_append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
1297  unsigned char *salt, unsigned int bytes_in_salt);
1298 
1299 
1300 
1365 srtp_err_status_t srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
1366 
1367 
1413 srtp_err_status_t srtp_protect_rtcp_mki(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len,
1414  unsigned int use_mki, unsigned int mki_index);
1415 
1455 srtp_err_status_t srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
1456 
1497 srtp_err_status_t srtp_unprotect_rtcp_mki(srtp_t ctx, void *srtcp_hdr,
1498  int *pkt_octet_len,
1499  unsigned int use_mki);
1500 
1529 void
1530 srtp_set_user_data(srtp_t ctx, void *data);
1531 
1548 void*
1549 srtp_get_user_data(srtp_t ctx);
1550 
1598 typedef enum {
1611 } srtp_event_t;
1612 
1621 typedef struct srtp_event_data_t {
1622  srtp_t session;
1623  uint32_t ssrc;
1626 
1639 
1654 
1659 const char *srtp_get_version_string(void);
1660 
1665 unsigned int srtp_get_version(void);
1666 
1675 srtp_err_status_t srtp_set_debug_module(char *mod_name, int v);
1676 
1682 
1692 srtp_err_status_t srtp_get_protect_trailer_length(srtp_t session, uint32_t use_mki,
1693  uint32_t mki_index, uint32_t *length);
1694 
1704 srtp_err_status_t srtp_get_protect_rtcp_trailer_length(srtp_t session, uint32_t use_mki,
1705  uint32_t mki_index, uint32_t *length);
1706 
1707 
1711 /* in host order, so outside the #if */
1712 #define SRTCP_E_BIT 0x80000000
1713 /* for byte-access */
1714 #define SRTCP_E_BYTE_BIT 0x80
1715 #define SRTCP_INDEX_MASK 0x7fffffff
1716 
1717 #ifdef __cplusplus
1718 }
1719 #endif
1720 
1721 #endif /* SRTP_SRTP_H */
Definition: srtp.h:303
uint32_t ssrc
Definition: srtp.h:1623
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
Definition: srtp.h:267
srtp_t session
Definition: srtp.h:1622
struct srtp_ekt_policy_ctx_t * srtp_ekt_policy_t
points to an EKT policy
Definition: srtp.h:369
srtp_err_status_t srtp_dealloc(srtp_t s)
srtp_dealloc() deallocates storage for an SRTP session context.
srtp_err_status_t srtp_protect_rtcp_mki(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len, unsigned int use_mki, unsigned int mki_index)
srtp_protect_rtcp_mki() is the Secure RTCP sender-side packet processing function that can utilize mk...
Definition: srtp.h:270
srtp_crypto_policy_t describes a particular crypto policy that can be applied to an SRTP stream...
Definition: srtp.h:316
int cipher_key_len
Definition: srtp.h:319
srtp_err_status_t srtp_shutdown(void)
srtp_shutdown() de-initializes the srtp library.
srtp_ssrc_type_t type
Definition: srtp.h:361
int * enc_xtn_hdr
Definition: srtp.h:438
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...
Definition: srtp.h:278
Definition: srtp.h:276
srtp_err_status_t srtp_set_debug_module(char *mod_name, int v)
srtp_set_debug_module(mod_name, v)
unsigned int srtp_get_version(void)
Returns the numeric representation of the library version.
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...
srtp_crypto_policy_t rtcp
Definition: srtp.h:423
struct srtp_policy_t * next
Definition: srtp.h:440
srtp_event_t event
Definition: srtp.h:1624
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 pol...
srtp_master_key_t represents a master key. There will be a Master Key Index and the Master Key associ...
Definition: srtp.h:383
uint32_t srtp_cipher_type_id_t
A srtp_cipher_type_id_t is an identifier for a particular cipher type.
Definition: srtp.h:235
srtp_err_status_t srtp_update_stream(srtp_t session, const srtp_policy_t *policy)
srtp_update_stream() udpates a SRTP stream.
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-authentica...
srtp_err_status_t srtp_list_debug_modules(void)
srtp_list_debug_modules() outputs a list of debugging modules
struct srtp_master_key_t srtp_master_key_t
srtp_master_key_t represents a master key. There will be a Master Key Index and the Master Key associ...
Definition: srtp.h:342
Definition: srtp.h:300
Definition: srtp.h:263
Definition: srtp.h:285
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 valu...
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 poli...
Definition: srtp.h:345
Definition: srtp.h:279
Definition: srtp.h:268
srtp_ekt_policy_t ekt
Definition: srtp.h:428
Definition: srtp.h:1608
int auth_tag_len
Definition: srtp.h:325
Definition: srtp.h:275
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 ...
srtp_err_status_t srtp_create(srtp_t *session, const srtp_policy_t *policy)
srtp_create() allocates and initializes an SRTP session.
struct srtp_policy_t srtp_policy_t
represents the policy for an SRTP session.
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...
unsigned char * key
Definition: srtp.h:424
Definition: srtp.h:284
srtp_event_data_t is the structure passed as a callback to the event handler function ...
Definition: srtp.h:1621
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...
Definition: srtp.h:301
Definition: srtp.h:185
Definition: srtp.h:269
void( srtp_event_handler_func_t)(srtp_event_data_t *data)
srtp_event_handler_func_t is the function prototype for the event handler.
Definition: srtp.h:1638
srtp_event_t
srtp_event_t defines events that need to be handled
Definition: srtp.h:1598
srtp_err_status_t srtp_get_protect_rtcp_trailer_length(srtp_t session, uint32_t use_mki, uint32_t mki_index, uint32_t *length)
srtp_get_protect_rtcp_trailer_length(session, use_mki, mki_index, length)
Definition: srtp.h:273
unsigned int srtp_profile_get_master_key_length(srtp_profile_t profile)
returns the master key length for a given SRTP profile
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 po...
Definition: srtp.h:280
srtp_cipher_type_id_t cipher_type
Definition: srtp.h:317
srtp_crypto_policy_t rtp
Definition: srtp.h:422
srtp_err_status_t srtp_unprotect_rtcp_mki(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len, unsigned int use_mki)
srtp_unprotect_rtcp() is the Secure RTCP receiver-side packet processing function.
srtp_ssrc_type_t
srtp_ssrc_type_t describes the type of an SSRC.
Definition: srtp.h:339
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.
Definition: srtp.h:283
Definition: srtp.h:176
Definition: srtp.h:133
unsigned long num_master_keys
Definition: srtp.h:427
uint32_t srtp_auth_type_id_t
An srtp_auth_type_id_t is an identifier for a particular authentication function. ...
Definition: srtp.h:249
srtp_err_status_t srtp_protect_mki(srtp_ctx_t *ctx, void *rtp_hdr, int *pkt_octet_len, unsigned int use_mki, unsigned int mki_index)
srtp_protect_mki() is the Secure RTP sender-side packet processing function that can utilize MKI...
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 pol...
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.
srtp_ssrc_t ssrc
Definition: srtp.h:417
Definition: srtp.h:281
Definition: srtp.h:266
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 authentica...
int enc_xtn_hdr_count
Definition: srtp.h:439
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 poli...
srtp_err_status_t srtp_unprotect_mki(srtp_t ctx, void *srtp_hdr, int *len_ptr, unsigned int use_mki)
srtp_unprotect_mki() is the Secure RTP receiver-side packet processing function that checks for MKI...
Definition: srtp.h:262
srtp_err_status_t
Definition: srtp.h:259
Definition: srtp.h:264
srtp_auth_type_id_t auth_type
Definition: srtp.h:321
unsigned int srtp_profile_get_master_salt_length(srtp_profile_t profile)
returns the master salt length for a given SRTP profile
Definition: srtp.h:161
srtp_ctx_t * srtp_t
An srtp_t points to an SRTP session structure.
Definition: srtp.h:459
Definition: srtp.h:265
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.
void * srtp_get_user_data(srtp_t ctx)
srtp_get_user_data() retrieves the pointer to the custom data previously stored with srtp_set_user_da...
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 R...
srtp_sec_serv_t
srtp_sec_serv_t describes a set of security services.
Definition: srtp.h:299
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 authentica...
Definition: srtp.h:271
srtp_err_status_t srtp_init(void)
srtp_init() initializes the srtp library.
const char * srtp_get_version_string(void)
Returns the version string of the library.
unsigned int value
Definition: srtp.h:362
struct srtp_ekt_stream_ctx_t * srtp_ekt_stream_t
points to EKT stream data
Definition: srtp.h:375
unsigned long window_size
Definition: srtp.h:430
represents the policy for an SRTP session.
Definition: srtp.h:416
Definition: srtp.h:277
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.
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 po...
Definition: srtp.h:261
Definition: srtp.h:260
Definition: srtp.h:341
Definition: srtp.h:1602
srtp_err_status_t srtp_get_protect_trailer_length(srtp_t session, uint32_t use_mki, uint32_t mki_index, uint32_t *length)
srtp_get_protect_trailer_length(session, use_mki, mki_index, length)
int allow_repeat_tx
Definition: srtp.h:432
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-authentica...
Definition: srtp.h:272
Definition: srtp.h:1605
srtp_sec_serv_t sec_serv
Definition: srtp.h:327
srtp_err_status_t srtp_remove_stream(srtp_t session, unsigned int ssrc)
srtp_remove_stream() deallocates an SRTP stream.
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.
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 RT...
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.
Definition: srtp.h:282
int auth_key_len
Definition: srtp.h:323
Definition: srtp.h:340
Definition: srtp.h:302
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 a...
Definition: srtp.h:1599
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.
Definition: srtp.h:274
srtp_err_status_t srtp_update(srtp_t session, const srtp_policy_t *policy)
srtp_update() udpates all streams in the session.
An srtp_ssrc_t represents a particular SSRC value, or a `wildcard' SSRC.
Definition: srtp.h:360