From 4e32e15673706e823935d556766ef408b45c6154 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Thu, 10 Jul 2014 16:57:55 +0200 Subject: [PATCH] Lowercase characters for md5 calculation of authentication digest Closes #349. Closes #350. --- rtsp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rtsp.c b/rtsp.c index 8db9f3f24..41c8d87cf 100644 --- a/rtsp.c +++ b/rtsp.c @@ -750,19 +750,19 @@ static int rtsp_auth(char **nonce, rtsp_message *req, rtsp_message *resp) { int i; char buf[33]; for (i=0; i<16; i++) - sprintf(buf + 2*i, "%02X", digest_urp[i]); + sprintf(buf + 2*i, "%02x", digest_urp[i]); MD5_Init(&ctx); MD5_Update(&ctx, buf, 32); MD5_Update(&ctx, ":", 1); MD5_Update(&ctx, *nonce, strlen(*nonce)); MD5_Update(&ctx, ":", 1); for (i=0; i<16; i++) - sprintf(buf + 2*i, "%02X", digest_mu[i]); + sprintf(buf + 2*i, "%02x", digest_mu[i]); MD5_Update(&ctx, buf, 32); MD5_Final(digest_total, &ctx); for (i=0; i<16; i++) - sprintf(buf + 2*i, "%02X", digest_total[i]); + sprintf(buf + 2*i, "%02x", digest_total[i]); if (!strcmp(response, buf)) return 0;