bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] [Bug--Wget] Issue with RFC 2067 Digest Headers


From: Giuseppe Scrivano
Subject: Re: [Bug-wget] [Bug--Wget] Issue with RFC 2067 Digest Headers
Date: Sat, 13 Jul 2013 16:26:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Giuseppe Scrivano <address@hidden> writes:

> In any case I haven't a strong opinion, if you still think this is a
> stdrup/free waste, I can revert the change :-)

I went forward and pushed this version, as you suggested.

Thanks again for your feedback.

Giuseppe


diff --git a/src/http.c b/src/http.c
index b0c782b..b2a03c8 100644
--- a/src/http.c
+++ b/src/http.c
@@ -3697,8 +3697,7 @@ digest_authentication_encode (const char *au, const char 
*user,
   param_token name, value;
 
 
-  realm = opaque = nonce = qop = NULL;
-  algorithm = "MD5";
+  realm = opaque = nonce = algorithm = qop = NULL;
 
   au += 6;                      /* skip over `Digest' */
   while (extract_param (&au, &name, &value, ','))
@@ -3755,7 +3754,7 @@ digest_authentication_encode (const char *au, const char 
*user,
 
     dump_hash (a1buf, hash);
 
-    if (! strcmp (algorithm, "MD5-sess"))
+    if (algorithm && !strcmp (algorithm, "MD5-sess"))
       {
         /* A1BUF = H( H(user ":" realm ":" password) ":" nonce ":" cnonce ) */
         snprintf (cnonce, sizeof (cnonce), "%08x", random_number(INT_MAX));
@@ -3855,6 +3854,13 @@ digest_authentication_encode (const char *au, const char 
*user,
         snprintf(res + res_len, res_size - res_len, ", algorithm=\"%s\"", 
algorithm);
       }
   }
+
+  xfree_null (realm);
+  xfree_null (opaque);
+  xfree_null (nonce);
+  xfree_null (qop);
+  xfree_null (algorithm);
+
   return res;
 }
 #endif /* ENABLE_DIGEST */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]