#include "libavutil/blowfish.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/rc4.h"
#include "libavutil/xtea.h"
#include "internal.h"
#include "rtmp.h"
#include "rtmpdh.h"
#include "rtmpcrypt.h"
#include "url.h"
Go to the source code of this file.
Data Structures | |
struct | RTMPEContext |
Defines | |
#define | OFFSET(x) offsetof(RTMPEContext, x) |
#define | DEC AV_OPT_FLAG_DECODING_PARAM |
Functions | |
int | ff_rtmpe_gen_pub_key (URLContext *h, uint8_t *buf) |
Initialize the Diffie-Hellmann context and generate the public key. | |
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. | |
static void | rtmpe8_sig (const uint8_t *in, uint8_t *out, int key_id) |
static void | rtmpe9_sig (const uint8_t *in, uint8_t *out, int key_id) |
void | ff_rtmpe_encrypt_sig (URLContext *h, uint8_t *sig, const uint8_t *digest, int type) |
Encrypt the signature. | |
int | ff_rtmpe_update_keystream (URLContext *h) |
Update the keystream and set RC4 keys for encryption. | |
static int | rtmpe_close (URLContext *h) |
static int | rtmpe_open (URLContext *h, const char *uri, int flags) |
static int | rtmpe_read (URLContext *h, uint8_t *buf, int size) |
static int | rtmpe_write (URLContext *h, const uint8_t *buf, int size) |
Variables | |
static const uint8_t | rtmpe8_keys [16][16] |
static const uint8_t | rtmpe9_keys [16][24] |
static const AVOption | ffrtmpcrypt_options [] |
static const AVClass | ffrtmpcrypt_class |
URLProtocol | ff_ffrtmpcrypt_protocol |
Definition in file rtmpcrypt.c.
#define DEC AV_OPT_FLAG_DECODING_PARAM |
Definition at line 313 of file rtmpcrypt.c.
#define OFFSET | ( | x | ) | offsetof(RTMPEContext, x) |
Definition at line 312 of file rtmpcrypt.c.
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.
h | an URLContext | |
serverdata | server data (1536 bytes) | |
clientdata | client data (1536 bytes) | |
type | the position of the server digest |
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.
h | an URLContext | |
signature | the signature to encrypt | |
digest | the digest used for finding the encryption key | |
type | type of encryption (8 for XTEA, 9 for Blowfish) |
Definition at line 207 of file rtmpcrypt.c.
Referenced by rtmp_handshake().
int ff_rtmpe_gen_pub_key | ( | URLContext * | h, | |
uint8_t * | buf | |||
) |
Initialize the Diffie-Hellmann context and generate the public key.
h | an URLContext | |
buf | handshake data (1536 bytes) |
Definition at line 122 of file rtmpcrypt.c.
Referenced by rtmp_handshake().
int ff_rtmpe_update_keystream | ( | URLContext * | h | ) |
Update the keystream and set RC4 keys for encryption.
h | an URLContext |
Definition at line 223 of file rtmpcrypt.c.
Referenced by rtmp_handshake().
static int rtmpe_close | ( | URLContext * | h | ) | [static] |
static int rtmpe_open | ( | URLContext * | h, | |
const char * | uri, | |||
int | flags | |||
) | [static] |
Definition at line 248 of file rtmpcrypt.c.
static int rtmpe_read | ( | URLContext * | h, | |
uint8_t * | buf, | |||
int | size | |||
) | [static] |
Definition at line 276 of file rtmpcrypt.c.
static int rtmpe_write | ( | URLContext * | h, | |
const uint8_t * | buf, | |||
int | size | |||
) | [static] |
Definition at line 296 of file rtmpcrypt.c.
Initial value:
{ .name = "ffrtmpcrypt", .url_open = rtmpe_open, .url_read = rtmpe_read, .url_write = rtmpe_write, .url_close = rtmpe_close, .priv_data_size = sizeof(RTMPEContext), .flags = URL_PROTOCOL_FLAG_NETWORK, .priv_data_class = &ffrtmpcrypt_class, }
Definition at line 327 of file rtmpcrypt.c.
const AVClass ffrtmpcrypt_class [static] |
Initial value:
{ .class_name = "ffrtmpcrypt", .item_name = av_default_item_name, .option = ffrtmpcrypt_options, .version = LIBAVUTIL_VERSION_INT, }
Definition at line 320 of file rtmpcrypt.c.
const AVOption ffrtmpcrypt_options[] [static] |
Initial value:
{ {"ffrtmpcrypt_tunneling", "Use a HTTP tunneling connection (RTMPTE).", OFFSET(tunneling), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC}, { NULL }, }
Definition at line 315 of file rtmpcrypt.c.
const uint8_t rtmpe8_keys[16][16] [static] |
const uint8_t rtmpe9_keys[16][24] [static] |