Skip to content

Commit

Permalink
Lowercase characters for md5 calculation of authentication digest
Browse files Browse the repository at this point in the history
Closes #349. Closes abrasive#350.
  • Loading branch information
pdgendt authored and abrasive committed Jul 11, 2014
1 parent 409abe5 commit 4e32e15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4e32e15

Please sign in to comment.