FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
rtmpcrypt.h File Reference
#include <stdint.h>
#include "url.h"

Go to the source code of this file.

Functions

int ff_rtmpe_gen_pub_key (URLContext *h, uint8_t *buf)
 Initialize the Diffie-Hellmann context and generate the public key. More...
 
int ff_rtmpe_compute_secret_key (URLContext *h, const uint8_t *serverdata, const uint8_t *clientdata, int type)
 Compute the shared secret key and initialize the RC4 encryption. More...
 
void ff_rtmpe_encrypt_sig (URLContext *h, uint8_t *signature, const uint8_t *digest, int type)
 Encrypt the signature. More...
 
int ff_rtmpe_update_keystream (URLContext *h)
 Update the keystream and set RC4 keys for encryption. More...
 

Function Documentation

int ff_rtmpe_gen_pub_key ( URLContext h,
uint8_t buf 
)

Initialize the Diffie-Hellmann context and generate the public key.

Parameters
han URLContext
bufhandshake data (1536 bytes)
Returns
zero on success, negative value otherwise

Definition at line 122 of file rtmpcrypt.c.

Referenced by rtmp_handshake().

int ff_rtmpe_compute_secret_key ( URLContext h,
const uint8_t serverdata,
const uint8_t clientdata,
int  type 
)

Compute the shared secret key and initialize the RC4 encryption.

Parameters
han URLContext
serverdataserver data (1536 bytes)
clientdataclient data (1536 bytes)
typethe position of the server digest
Returns
zero on success, negative value otherwise

Definition at line 145 of file rtmpcrypt.c.

Referenced by rtmp_handshake().

void ff_rtmpe_encrypt_sig ( URLContext h,
uint8_t signature,
const uint8_t digest,
int  type 
)

Encrypt the signature.

Parameters
han URLContext
signaturethe signature to encrypt
digestthe digest used for finding the encryption key
typetype of encryption (8 for XTEA, 9 for Blowfish)

Definition at line 207 of file rtmpcrypt.c.

Referenced by rtmp_handshake().

int ff_rtmpe_update_keystream ( URLContext h)

Update the keystream and set RC4 keys for encryption.

Parameters
han URLContext
Returns
zero on success, negative value otherwise

Definition at line 223 of file rtmpcrypt.c.

Referenced by rtmp_handshake().