From 6454c44f9f74dbaed17d32cf0eaec185386c27fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 15 Aug 2013 13:17:15 +0300 Subject: [PATCH] rtmpproto: Fix limelight authentication with abbreviated app names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When streaming to limelight, the app name is either a full "appname/subaccount" or "appname/_definst_". In the latter case, the app name can be simplified into simply "appname", but the authentication hashing assumes the /_definst_ still to be present. Signed-off-by: Martin Storsjö --- libavformat/rtmpproto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 4de20f2ed9..48eed561d2 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -1612,6 +1612,8 @@ static int do_llnw_auth(RTMPContext *rt, const char *user, const char *nonce) av_md5_update(md5, method, strlen(method)); av_md5_update(md5, ":/", 2); av_md5_update(md5, rt->app, strlen(rt->app)); + if (!strchr(rt->app, '/')) + av_md5_update(md5, "/_definst_", strlen("/_definst_")); av_md5_final(md5, hash); ff_data_to_hex(hashstr2, hash, 16, 1); hashstr2[32] = '\0';