[FFmpeg-cvslog] rtmpcrypt: Do the xtea decryption in little endian mode
ffmpeg | branch: release/2.4 | Martin Storsjö | Wed Nov 11 21:42:02 2015 +0200| [65d6748d9e42a868825901473bd228e32faf32ae] | committer: Michael Niedermayer rtmpcrypt: Do the xtea decryption in little endian mode The XTEA algorithm operates on 32 bit numbers, not on byte sequences. The XTEA implementation in libavutil is written assuming big endian numbers, while the rtmpe signature encryption assumes little endian. This fixes rtmpe communication with rtmpe servers that use signature type 8 (XTEA), e.g. crunchyroll. CC: libav-sta...@libav.org Signed-off-by: Martin Storsjö (cherry picked from commit e7728319b92dbb4fb949155e33de7ff5358ddff3) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=65d6748d9e42a868825901473bd228e32faf32ae --- libavformat/rtmpcrypt.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpcrypt.c b/libavformat/rtmpcrypt.c index 2312527..fb46449 100644 --- a/libavformat/rtmpcrypt.c +++ b/libavformat/rtmpcrypt.c @@ -184,9 +184,14 @@ int ff_rtmpe_compute_secret_key(URLContext *h, const uint8_t *serverdata, static void rtmpe8_sig(const uint8_t *in, uint8_t *out, int key_id) { struct AVXTEA ctx; +uint8_t tmpbuf[8]; av_xtea_init(&ctx, rtmpe8_keys[key_id]); -av_xtea_crypt(&ctx, out, in, 1, NULL, 0); +AV_WB32(tmpbuf, AV_RL32(in)); +AV_WB32(tmpbuf + 4, AV_RL32(in + 4)); +av_xtea_crypt(&ctx, tmpbuf, tmpbuf, 1, NULL, 0); +AV_WL32(out, AV_RB32(tmpbuf)); +AV_WL32(out + 4, AV_RB32(tmpbuf + 4)); } static void rtmpe9_sig(const uint8_t *in, uint8_t *out, int key_id) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] rtmpcrypt: Do the xtea decryption in little endian mode
ffmpeg | branch: release/2.5 | Martin Storsjö | Wed Nov 11 21:42:02 2015 +0200| [795908eff4a219c49d9e52be5ffb86765ab0a39e] | committer: Michael Niedermayer rtmpcrypt: Do the xtea decryption in little endian mode The XTEA algorithm operates on 32 bit numbers, not on byte sequences. The XTEA implementation in libavutil is written assuming big endian numbers, while the rtmpe signature encryption assumes little endian. This fixes rtmpe communication with rtmpe servers that use signature type 8 (XTEA), e.g. crunchyroll. CC: libav-sta...@libav.org Signed-off-by: Martin Storsjö (cherry picked from commit e7728319b92dbb4fb949155e33de7ff5358ddff3) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=795908eff4a219c49d9e52be5ffb86765ab0a39e --- libavformat/rtmpcrypt.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpcrypt.c b/libavformat/rtmpcrypt.c index 2312527..fb46449 100644 --- a/libavformat/rtmpcrypt.c +++ b/libavformat/rtmpcrypt.c @@ -184,9 +184,14 @@ int ff_rtmpe_compute_secret_key(URLContext *h, const uint8_t *serverdata, static void rtmpe8_sig(const uint8_t *in, uint8_t *out, int key_id) { struct AVXTEA ctx; +uint8_t tmpbuf[8]; av_xtea_init(&ctx, rtmpe8_keys[key_id]); -av_xtea_crypt(&ctx, out, in, 1, NULL, 0); +AV_WB32(tmpbuf, AV_RL32(in)); +AV_WB32(tmpbuf + 4, AV_RL32(in + 4)); +av_xtea_crypt(&ctx, tmpbuf, tmpbuf, 1, NULL, 0); +AV_WL32(out, AV_RB32(tmpbuf)); +AV_WL32(out + 4, AV_RB32(tmpbuf + 4)); } static void rtmpe9_sig(const uint8_t *in, uint8_t *out, int key_id) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] rtmpcrypt: Do the xtea decryption in little endian mode
ffmpeg | branch: release/2.8 | Martin Storsjö | Wed Nov 11 21:42:02 2015 +0200| [1290c85c9d451eaf45bf552fa313ea7f6cccb3f3] | committer: Michael Niedermayer rtmpcrypt: Do the xtea decryption in little endian mode The XTEA algorithm operates on 32 bit numbers, not on byte sequences. The XTEA implementation in libavutil is written assuming big endian numbers, while the rtmpe signature encryption assumes little endian. This fixes rtmpe communication with rtmpe servers that use signature type 8 (XTEA), e.g. crunchyroll. CC: libav-sta...@libav.org Signed-off-by: Martin Storsjö (cherry picked from commit e7728319b92dbb4fb949155e33de7ff5358ddff3) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1290c85c9d451eaf45bf552fa313ea7f6cccb3f3 --- libavformat/rtmpcrypt.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpcrypt.c b/libavformat/rtmpcrypt.c index 2065ec6..3771909 100644 --- a/libavformat/rtmpcrypt.c +++ b/libavformat/rtmpcrypt.c @@ -184,9 +184,14 @@ int ff_rtmpe_compute_secret_key(URLContext *h, const uint8_t *serverdata, static void rtmpe8_sig(const uint8_t *in, uint8_t *out, int key_id) { struct AVXTEA ctx; +uint8_t tmpbuf[8]; av_xtea_init(&ctx, rtmpe8_keys[key_id]); -av_xtea_crypt(&ctx, out, in, 1, NULL, 0); +AV_WB32(tmpbuf, AV_RL32(in)); +AV_WB32(tmpbuf + 4, AV_RL32(in + 4)); +av_xtea_crypt(&ctx, tmpbuf, tmpbuf, 1, NULL, 0); +AV_WL32(out, AV_RB32(tmpbuf)); +AV_WL32(out + 4, AV_RB32(tmpbuf + 4)); } static void rtmpe9_sig(const uint8_t *in, uint8_t *out, int key_id) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] rtmpcrypt: Do the xtea decryption in little endian mode
ffmpeg | branch: master | Martin Storsjö | Wed Nov 11 22:11:19 2015 +0200| [588b6215b4c74945994eb9636b0699028c069ed2] | committer: Martin Storsjö rtmpcrypt: Do the xtea decryption in little endian mode The XTEA algorithm operates on 32 bit numbers, not on byte sequences. The XTEA implementation in libavutil is written assuming big endian numbers, while the rtmpe signature encryption assumes little endian. This fixes rtmpe communication with rtmpe servers that use signature type 8 (XTEA), e.g. crunchyroll. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=588b6215b4c74945994eb9636b0699028c069ed2 --- libavformat/rtmpcrypt.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/rtmpcrypt.c b/libavformat/rtmpcrypt.c index 887427d..829c280 100644 --- a/libavformat/rtmpcrypt.c +++ b/libavformat/rtmpcrypt.c @@ -186,7 +186,7 @@ static void rtmpe8_sig(const uint8_t *in, uint8_t *out, int key_id) struct AVXTEA ctx; av_xtea_init(&ctx, rtmpe8_keys[key_id]); -av_xtea_crypt(&ctx, out, in, 1, NULL, 0); +av_xtea_le_crypt(&ctx, out, in, 1, NULL, 0); } static void rtmpe9_sig(const uint8_t *in, uint8_t *out, int key_id) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] rtmpcrypt: Do the xtea decryption in little endian mode
ffmpeg | branch: release/2.6 | Martin Storsjö | Wed Nov 11 21:42:02 2015 +0200| [949f5dbcfbb8ce317b8104655dbc73efd383f6e0] | committer: Michael Niedermayer rtmpcrypt: Do the xtea decryption in little endian mode The XTEA algorithm operates on 32 bit numbers, not on byte sequences. The XTEA implementation in libavutil is written assuming big endian numbers, while the rtmpe signature encryption assumes little endian. This fixes rtmpe communication with rtmpe servers that use signature type 8 (XTEA), e.g. crunchyroll. CC: libav-sta...@libav.org Signed-off-by: Martin Storsjö (cherry picked from commit e7728319b92dbb4fb949155e33de7ff5358ddff3) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=949f5dbcfbb8ce317b8104655dbc73efd383f6e0 --- libavformat/rtmpcrypt.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpcrypt.c b/libavformat/rtmpcrypt.c index 2312527..fb46449 100644 --- a/libavformat/rtmpcrypt.c +++ b/libavformat/rtmpcrypt.c @@ -184,9 +184,14 @@ int ff_rtmpe_compute_secret_key(URLContext *h, const uint8_t *serverdata, static void rtmpe8_sig(const uint8_t *in, uint8_t *out, int key_id) { struct AVXTEA ctx; +uint8_t tmpbuf[8]; av_xtea_init(&ctx, rtmpe8_keys[key_id]); -av_xtea_crypt(&ctx, out, in, 1, NULL, 0); +AV_WB32(tmpbuf, AV_RL32(in)); +AV_WB32(tmpbuf + 4, AV_RL32(in + 4)); +av_xtea_crypt(&ctx, tmpbuf, tmpbuf, 1, NULL, 0); +AV_WL32(out, AV_RB32(tmpbuf)); +AV_WL32(out + 4, AV_RB32(tmpbuf + 4)); } static void rtmpe9_sig(const uint8_t *in, uint8_t *out, int key_id) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] rtmpcrypt: Do the xtea decryption in little endian mode
ffmpeg | branch: release/2.7 | Martin Storsjö | Wed Nov 11 21:42:02 2015 +0200| [cf115791daf4c0c9ed3d028ec0c7ed76c51ecd41] | committer: Michael Niedermayer rtmpcrypt: Do the xtea decryption in little endian mode The XTEA algorithm operates on 32 bit numbers, not on byte sequences. The XTEA implementation in libavutil is written assuming big endian numbers, while the rtmpe signature encryption assumes little endian. This fixes rtmpe communication with rtmpe servers that use signature type 8 (XTEA), e.g. crunchyroll. CC: libav-sta...@libav.org Signed-off-by: Martin Storsjö (cherry picked from commit e7728319b92dbb4fb949155e33de7ff5358ddff3) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cf115791daf4c0c9ed3d028ec0c7ed76c51ecd41 --- libavformat/rtmpcrypt.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/rtmpcrypt.c b/libavformat/rtmpcrypt.c index 2065ec6..3771909 100644 --- a/libavformat/rtmpcrypt.c +++ b/libavformat/rtmpcrypt.c @@ -184,9 +184,14 @@ int ff_rtmpe_compute_secret_key(URLContext *h, const uint8_t *serverdata, static void rtmpe8_sig(const uint8_t *in, uint8_t *out, int key_id) { struct AVXTEA ctx; +uint8_t tmpbuf[8]; av_xtea_init(&ctx, rtmpe8_keys[key_id]); -av_xtea_crypt(&ctx, out, in, 1, NULL, 0); +AV_WB32(tmpbuf, AV_RL32(in)); +AV_WB32(tmpbuf + 4, AV_RL32(in + 4)); +av_xtea_crypt(&ctx, tmpbuf, tmpbuf, 1, NULL, 0); +AV_WL32(out, AV_RB32(tmpbuf)); +AV_WL32(out + 4, AV_RB32(tmpbuf + 4)); } static void rtmpe9_sig(const uint8_t *in, uint8_t *out, int key_id) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog