FFmpeg
Loading...
Searching...
No Matches
srtp.c File Reference
#include "libavutil/base64.h"
#include "libavutil/aes.h"
#include "libavutil/hmac.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "rtp.h"
#include "rtpdec.h"
#include "srtp.h"

Go to the source code of this file.

Functions

void ff_srtp_free (struct SRTPContext *s)
 
static void encrypt_counter (struct AVAES *aes, uint8_t *iv, uint8_t *outbuf, int outlen)
 
static void derive_key (struct AVAES *aes, const uint8_t *salt, int label, uint8_t *out, int outlen)
 
int ff_srtp_set_crypto (struct SRTPContext *s, const char *suite, const char *params)
 
static void create_iv (uint8_t *iv, const uint8_t *salt, uint64_t index, uint32_t ssrc)
 
int ff_srtp_decrypt (struct SRTPContext *s, uint8_t *buf, int *lenptr)
 
int ff_srtp_encrypt (struct SRTPContext *s, const uint8_t *in, int len, uint8_t *out, int outlen)
 

Function Documentation

◆ ff_srtp_free()

void ff_srtp_free ( struct SRTPContext * s)

◆ encrypt_counter()

static void encrypt_counter ( struct AVAES * aes,
uint8_t * iv,
uint8_t * outbuf,
int outlen )
static

Definition at line 42 of file srtp.c.

Referenced by derive_key(), ff_srtp_decrypt(), and ff_srtp_encrypt().

◆ derive_key()

static void derive_key ( struct AVAES * aes,
const uint8_t * salt,
int label,
uint8_t * out,
int outlen )
static

Definition at line 55 of file srtp.c.

Referenced by ff_srtp_set_crypto().

◆ ff_srtp_set_crypto()

int ff_srtp_set_crypto ( struct SRTPContext * s,
const char * suite,
const char * params )

Definition at line 66 of file srtp.c.

Referenced by ff_rtp_parse_set_crypto(), main(), setup_srtp(), srtp_open(), and test_encrypt().

◆ create_iv()

static void create_iv ( uint8_t * iv,
const uint8_t * salt,
uint64_t index,
uint32_t ssrc )
static

Definition at line 113 of file srtp.c.

Referenced by ff_srtp_decrypt(), and ff_srtp_encrypt().

◆ ff_srtp_decrypt()

int ff_srtp_decrypt ( struct SRTPContext * s,
uint8_t * buf,
int * lenptr )

Definition at line 127 of file srtp.c.

Referenced by ff_rtp_parse_packet(), handle_nack_rtx(), srtp_read(), test_decrypt(), and test_encrypt().

◆ ff_srtp_encrypt()

int ff_srtp_encrypt ( struct SRTPContext * s,
const uint8_t * in,
int len,
uint8_t * out,
int outlen )

Definition at line 239 of file srtp.c.

Referenced by handle_rtx_packet(), on_rtp_write_packet(), srtp_write(), and test_encrypt().