|
libwebsockets
Lightweight C library for HTML5 websockets
|
Go to the source code of this file.
Data Structures | |
| struct | lws_srtp_ctx |
| struct | lws_srtp_ctx::lws_srtp_src_ctx |
Macros | |
| #define | lws_srtp_protect lws_srtp_protect_rtp |
Enumerations | |
| enum | lws_srtp_profiles { LWS_SRTP_PROFILE_AES128_CM_HMAC_SHA1_80 = 0x01 , LWS_SRTP_PROFILE_AES128_CM_HMAC_SHA1_32 = 0x02 } |
Functions | |
| LWS_VISIBLE LWS_EXTERN int | lws_srtp_init (struct lws_srtp_ctx *ctx, enum lws_srtp_profiles profile, const uint8_t *master_key, const uint8_t *master_salt) |
| LWS_VISIBLE LWS_EXTERN int | lws_srtp_protect_rtp (struct lws_srtp_ctx *ctx, uint8_t *pkt, size_t *len, size_t max_len) |
| LWS_VISIBLE LWS_EXTERN int | lws_srtp_protect_rtcp (struct lws_srtp_ctx *ctx, uint8_t *pkt, size_t *len, size_t max_len) |
| LWS_VISIBLE LWS_EXTERN int | lws_srtp_unprotect_rtp (struct lws_srtp_ctx *ctx, uint8_t *pkt, size_t *len) |
| LWS_VISIBLE LWS_EXTERN int | lws_srtp_unprotect_rtcp (struct lws_srtp_ctx *ctx, uint8_t *pkt, size_t *len) |
| struct lws_srtp_ctx |
Definition at line 33 of file lws-srtp.h.
Collaboration diagram for lws_srtp_ctx:| Data Fields | ||
|---|---|---|
| uint8_t | master_key[16] | |
| uint8_t | master_salt[14] | |
| uint8_t | session_key[16] | |
| uint8_t | session_salt[14] | |
| uint8_t | session_auth[20] | |
| uint8_t | srtcp_session_key[16] | |
| uint8_t | srtcp_session_salt[14] | |
| uint8_t | srtcp_session_auth[20] | |
| struct lws_srtp_src_ctx | src[4] | |
| uint32_t | srtcp_index | |
| enum lws_srtp_profiles | profile | |
| int | keys_derived | |
| struct lws_srtp_ctx::lws_srtp_src_ctx |
| #define lws_srtp_protect lws_srtp_protect_rtp |
Definition at line 95 of file lws-srtp.h.
| enum lws_srtp_profiles |
| Enumerator | |
|---|---|
| LWS_SRTP_PROFILE_AES128_CM_HMAC_SHA1_80 | |
| LWS_SRTP_PROFILE_AES128_CM_HMAC_SHA1_32 | |
Definition at line 28 of file lws-srtp.h.
| LWS_VISIBLE LWS_EXTERN int lws_srtp_init | ( | struct lws_srtp_ctx * | ctx, |
| enum lws_srtp_profiles | profile, | ||
| const uint8_t * | master_key, | ||
| const uint8_t * | master_salt ) |
lws_srtp_init() - Initialize SRTP context
| ctx | SRTP context |
| profile | SRTP profile to use |
| master_key | 16-byte master key |
| master_salt | 14-byte master salt |
References LWS_EXTERN, and LWS_VISIBLE.
| LWS_VISIBLE LWS_EXTERN int lws_srtp_protect_rtp | ( | struct lws_srtp_ctx * | ctx, |
| uint8_t * | pkt, | ||
| size_t * | len, | ||
| size_t | max_len ) |
lws_srtp_protect() - Encrypt and authenticate RTP packet
| ctx | SRTP context |
| pkt | RTP packet (header + payload), must have space for auth tag |
| len | Pointer to packet length (updated on success) |
| max_len | Maximum size of pkt buffer |
Returns 0 for OK or nonzero for error. lws_srtp_protect_rtp() - Encrypt and authenticate RTP packet
| ctx | SRTP context |
| pkt | RTP packet (header + payload), must have space for auth tag |
| len | Pointer to packet length (updated on success) |
| max_len | Maximum size of pkt buffer |
Returns 0 for OK or nonzero for error. Note: lws_srtp_protect() is an alias for this.
| LWS_VISIBLE LWS_EXTERN int lws_srtp_protect_rtcp | ( | struct lws_srtp_ctx * | ctx, |
| uint8_t * | pkt, | ||
| size_t * | len, | ||
| size_t | max_len ) |
lws_srtp_protect_rtcp() - Encrypt and authenticate RTCP packet
| ctx | SRTP context |
| pkt | RTCP packet (header + payload), must have space for index and tag |
| len | Pointer to packet length (updated on success) |
| max_len | Maximum size of pkt buffer |
Returns 0 for OK or nonzero for error.
References LWS_EXTERN, and LWS_VISIBLE.
| LWS_VISIBLE LWS_EXTERN int lws_srtp_unprotect_rtp | ( | struct lws_srtp_ctx * | ctx, |
| uint8_t * | pkt, | ||
| size_t * | len ) |
lws_srtp_unprotect_rtp() - Decrypt and authenticate RTP packet
| ctx | SRTP context |
| pkt | Protected RTP packet (header + payload + tag) |
| len | Pointer to packet length (updated on success to reflect decrypted payload) |
Returns 0 for OK or nonzero for error.
References LWS_EXTERN, and LWS_VISIBLE.
| LWS_VISIBLE LWS_EXTERN int lws_srtp_unprotect_rtcp | ( | struct lws_srtp_ctx * | ctx, |
| uint8_t * | pkt, | ||
| size_t * | len ) |
lws_srtp_unprotect_rtcp() - Decrypt and authenticate RTCP packet
| ctx | SRTP context |
| pkt | Protected RTCP packet (header + payload + index/E + tag) |
| len | Pointer to packet length (updated on success to reflect decrypted payload) |
Returns 0 for OK or nonzero for error.