From: Martin Storsjo Date: Thu, 15 Aug 2013 10:37:37 +0000 (+0300) Subject: Fix limelight authentication with abbreviated app names X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ba573a97122d7844b907a34f98d2b120e97070c;p=rtmpdump Fix limelight authentication with abbreviated app names 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. --- diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c index 0b9264d..014ff8b 100644 --- a/librtmp/rtmp.c +++ b/librtmp/rtmp.c @@ -2792,6 +2792,8 @@ PublisherAuth(RTMP *r, AVal *description) MD5_Update(&md5ctx, method, sizeof(method)-1); MD5_Update(&md5ctx, ":/", 2); MD5_Update(&md5ctx, apptmp.av_val, apptmp.av_len); + if (!AValChr(&apptmp, '/')) + MD5_Update(&md5ctx, "/_definst_", sizeof("/_definst_") - 1); MD5_Final(md5sum_val, &md5ctx); RTMP_Log(RTMP_LOGDEBUG, "%s, md5(%s:/%.*s) =>", __FUNCTION__, method, apptmp.av_len, apptmp.av_val);