summaryrefslogtreecommitdiff
path: root/libavformat/rtmpproto.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-24 20:43:07 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-24 21:15:57 +0200
commit93342de1d88081822dad55af70dd4738cd15d242 (patch)
tree7dd3f6fe644743880f7be2554570bda7497688c7 /libavformat/rtmpproto.c
parent3ccf22c64a0065fa08fe642500f193394fd83d01 (diff)
parent6a433fdba82ff241be2e9193f66a43689766e4d7 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: rtmp: Add credit/copyright to librtmp authors for parts of the RTMPE code rtmp: Move the CONFIG_ condition into the if conditions aac: Mention abbreviation as well in long_name build: Skip compiling rtmpdh.h if ffrtmpcrypt protocol is not enabled doc: Add Git configuration section configure: Add a dependency on https for rtmpts rtp: Only choose static payload types if the sample rate and channels are right Conflicts: doc/git-howto.texi libavformat/rtmpproto.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtmpproto.c')
-rw-r--r--libavformat/rtmpproto.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index a85ed31a5f..4ffd48eeec 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -719,7 +719,6 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
int i;
int server_pos, client_pos;
uint8_t digest[32], signature[32];
-#define encrypted (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted)
int ret, type = 0;
av_log(s, AV_LOG_DEBUG, "Handshaking...\n");
@@ -729,7 +728,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
for (i = 9; i <= RTMP_HANDSHAKE_PACKET_SIZE; i++)
tosend[i] = av_lfg_get(&rnd) >> 24;
- if (encrypted) {
+ if (rt->encrypted && CONFIG_FFRTMPCRYPT_PROTOCOL) {
/* When the client wants to use RTMPE, we have to change the command
* byte to 0x06 which means to use encrypted data and we have to set
* the flash version to at least 9.0.115.0. */
@@ -745,7 +744,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
return ret;
}
- client_pos = rtmp_handshake_imprint_with_digest(tosend + 1, encrypted);
+ client_pos = rtmp_handshake_imprint_with_digest(tosend + 1, rt->encrypted);
if (client_pos < 0)
return client_pos;
@@ -799,7 +798,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
if (ret < 0)
return ret;
- if (encrypted) {
+ if (rt->encrypted && CONFIG_FFRTMPCRYPT_PROTOCOL) {
/* Compute the shared secret key sent by the server and initialize
* the RC4 encryption. */
if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1,
@@ -829,7 +828,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
if (ret < 0)
return ret;
- if (encrypted) {
+ if (rt->encrypted && CONFIG_FFRTMPCRYPT_PROTOCOL) {
/* Encrypt the signature to be send to the server. */
ff_rtmpe_encrypt_sig(rt->stream, tosend +
RTMP_HANDSHAKE_PACKET_SIZE - 32, digest,
@@ -841,13 +840,13 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
return ret;
- if (encrypted) {
+ if (rt->encrypted && CONFIG_FFRTMPCRYPT_PROTOCOL) {
/* Set RC4 keys for encryption and update the keystreams. */
if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
return ret;
}
} else {
- if (encrypted) {
+ if (rt->encrypted && CONFIG_FFRTMPCRYPT_PROTOCOL) {
/* Compute the shared secret key sent by the server and initialize
* the RC4 encryption. */
if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1,
@@ -865,7 +864,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
return ret;
- if (encrypted) {
+ if (rt->encrypted && CONFIG_FFRTMPCRYPT_PROTOCOL) {
/* Set RC4 keys for encryption and update the keystreams. */
if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
return ret;
@@ -874,7 +873,6 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
return 0;
}
-#undef encrypted
/**
* Parse received packet and possibly perform some action depending on