changeset 22944:3ab5e609656a

Merge calc_response_string() into real_calc_response_and_checksum()
author rtogni
date Mon, 09 Apr 2007 21:34:20 +0000
parents 6bfd7e9775bc
children 6ddd36457941
files stream/realrtsp/real.c
diffstat 1 files changed, 6 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/stream/realrtsp/real.c	Mon Apr 09 21:26:49 2007 +0000
+++ b/stream/realrtsp/real.c	Mon Apr 09 21:34:20 2007 +0000
@@ -84,24 +84,13 @@
 #endif
 
 
-static void calc_response_string (char *result, char *challenge) {
- 
-  unsigned char zres[16];
-  int  i;
-      
-  av_md5_sum(zres, challenge, 64);
- 
-  /* convert zres to ascii string */
-  for (i=0; i<16; i++ )
-    sprintf(result+i*2, "%02x", zres[i]);
-}
-
 static void real_calc_response_and_checksum (char *response, char *chksum, char *challenge) {
 
   int   ch_len;
   int   i;
   char *ptr;
   char  buf[128];
+  unsigned char zres[16];
 
   /* initialize return values */
   memset(response, 0, 64);
@@ -135,7 +124,11 @@
     for (i=0; i<XOR_TABLE_SIZE; i++)
       ptr[i] = ptr[i] ^ xor_table[i];
 
-  calc_response_string (response, buf);
+  av_md5_sum(zres, buf, 64);
+ 
+  /* convert zres to ascii string */
+  for (i=0; i<16; i++ )
+    sprintf(response+i*2, "%02x", zres[i]);
 
   /* add tail */
   strcpy (&response[32], "01d0a8e3");