[libsoup] [SoupAuthDigest] don't crash if the server supports qop="auth, auth-int"



commit 61eb97855fcc208fba268e1e6754b9ac2e19b1d4
Author: Dan Winship <danw gnome org>
Date:   Wed Dec 16 13:23:17 2009 +0100

    [SoupAuthDigest] don't crash if the server supports qop="auth,auth-int"
    
    pointed out on libsoup-list

 libsoup/soup-auth-digest.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libsoup/soup-auth-digest.c b/libsoup/soup-auth-digest.c
index 4fb3f81..2299ae7 100644
--- a/libsoup/soup-auth-digest.c
+++ b/libsoup/soup-auth-digest.c
@@ -178,7 +178,7 @@ update (SoupAuth *auth, SoupMessage *msg, GHashTable *auth_params)
 		/* We only support auth */
 		if (!(qop_options & SOUP_AUTH_DIGEST_QOP_AUTH))
 			ok = FALSE;
-		priv->qop = qop_options;
+		priv->qop = SOUP_AUTH_DIGEST_QOP_AUTH;
 	} else
 		priv->qop = 0;
 
@@ -374,8 +374,8 @@ soup_auth_digest_compute_response (const char        *method,
 		g_checksum_update (checksum, (guchar *)cnonce, strlen (cnonce));
 		g_checksum_update (checksum, (guchar *)":", 1);
 
-		if (qop != SOUP_AUTH_DIGEST_QOP_AUTH)
-			g_assert_not_reached ();
+		if (!(qop & SOUP_AUTH_DIGEST_QOP_AUTH))
+			g_warn_if_reached ();
 		g_checksum_update (checksum, (guchar *)"auth", strlen ("auth"));
 		g_checksum_update (checksum, (guchar *)":", 1);
 	}



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