[FFmpeg-cvslog] rtmpcrypt: Do the xtea decryption in little endian mode

Martin Storsjö git at videolan.org
Sun Nov 22 15:37:26 CET 2015


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | 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ö <martin at martin.st>

> 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)



More information about the ffmpeg-cvslog mailing list