FFmpeg
Functions
rtmpdigest.c File Reference
#include <stdint.h>
#include "libavutil/error.h"
#include "libavutil/hmac.h"
#include "rtmp.h"

Go to the source code of this file.

Functions

int ff_rtmp_calc_digest (const uint8_t *src, int len, int gap, const uint8_t *key, int keylen, uint8_t *dst)
 Calculate HMAC-SHA2 digest for RTMP handshake packets. More...
 
int ff_rtmp_calc_digest_pos (const uint8_t *buf, int off, int mod_val, int add_val)
 Calculate digest position for RTMP handshake packets. More...
 

Detailed Description

RTMP protocol digest

Definition in file rtmpdigest.c.

Function Documentation

◆ ff_rtmp_calc_digest()

int ff_rtmp_calc_digest ( const uint8_t src,
int  len,
int  gap,
const uint8_t key,
int  keylen,
uint8_t dst 
)

Calculate HMAC-SHA2 digest for RTMP handshake packets.

Parameters
srcinput buffer
leninput buffer length (should be 1536)
gapoffset in buffer where 32 bytes should not be taken into account when calculating digest (since it will be used to store that digest)
keydigest key
keylendigest key length
dstbuffer where calculated digest will be stored (32 bytes)

Definition at line 34 of file rtmpdigest.c.

Referenced by ff_rtmpe_compute_secret_key(), rtmp_calc_swf_verification(), rtmp_calc_swfhash(), rtmp_handshake(), rtmp_handshake_imprint_with_digest(), and rtmp_validate_digest().

◆ ff_rtmp_calc_digest_pos()

int ff_rtmp_calc_digest_pos ( const uint8_t buf,
int  off,
int  mod_val,
int  add_val 
)

Calculate digest position for RTMP handshake packets.

Parameters
bufinput buffer (should be 1536 bytes)
offoffset in buffer where to start calculating digest position
mod_valvalue used for computing modulo
add_valvalue added at the end (after computing modulo)

Definition at line 57 of file rtmpdigest.c.

Referenced by ff_rtmpe_compute_secret_key(), ff_rtmpe_gen_pub_key(), rtmp_handshake_imprint_with_digest(), and rtmp_validate_digest().