+2008-03-19 Dan Winship <danw@gnome.org>
+
+ * libsoup/soup-auth.c (soup_auth_new): compare WWW-Authenticate
+ auth schemes case-insensitively.
+
+ * libsoup/soup-auth-digest.c (update): allow Digest
+ WWW-Authenticate header with no "qop" option. (The original RFC
+ 2069 style of Digest auth.)
+ (soup_auth_digest_parse_qop): this returns a bitfield, so don't
+ return -1 if there are no recognized values.
+
+ * tests/httpd.conf.in: use "AuthDigestQop none" in /Digest/realm3
+ so we test that
+
+ Fixes #498484 (Digest auth against Apple's Calendar Server).
+
2008-03-18 Dan Winship <danw@gnome.org>
* libsoup/soup-session.c (soup_session_class_init): Add a new
GSList *qop_values, *iter;
SoupAuthDigestQop out = 0;
- if (qop) {
- qop_values = soup_header_parse_list (qop);
- for (iter = qop_values; iter; iter = iter->next) {
- if (!g_ascii_strcasecmp (iter->data, "auth"))
- out |= SOUP_AUTH_DIGEST_QOP_AUTH;
- else if (!g_ascii_strcasecmp (iter->data, "auth-int"))
- out |= SOUP_AUTH_DIGEST_QOP_AUTH_INT;
- else
- out = -1;
- }
- soup_header_free_list (qop_values);
+ g_return_val_if_fail (qop != NULL, 0);
+
+ qop_values = soup_header_parse_list (qop);
+ for (iter = qop_values; iter; iter = iter->next) {
+ if (!g_ascii_strcasecmp (iter->data, "auth"))
+ out |= SOUP_AUTH_DIGEST_QOP_AUTH;
+ else if (!g_ascii_strcasecmp (iter->data, "auth-int"))
+ out |= SOUP_AUTH_DIGEST_QOP_AUTH_INT;
}
+ soup_header_free_list (qop_values);
return out;
}
update (SoupAuth *auth, SoupMessage *msg, GHashTable *auth_params)
{
SoupAuthDigestPrivate *priv = SOUP_AUTH_DIGEST_GET_PRIVATE (auth);
- const char *stale;
+ const char *stale, *qop;
guint qop_options;
gboolean ok = TRUE;
priv->nonce = g_strdup (g_hash_table_lookup (auth_params, "nonce"));
priv->opaque = g_strdup (g_hash_table_lookup (auth_params, "opaque"));
- qop_options = soup_auth_digest_parse_qop (g_hash_table_lookup (auth_params, "qop"));
- /* We're just going to do qop=auth for now */
- if (qop_options == -1 || !(qop_options & SOUP_AUTH_DIGEST_QOP_AUTH))
- ok = FALSE;
- priv->qop = SOUP_AUTH_DIGEST_QOP_AUTH;
+ qop = g_hash_table_lookup (auth_params, "qop");
+ if (qop) {
+ qop_options = soup_auth_digest_parse_qop (qop);
+ /* We only support auth */
+ if (!(qop_options & SOUP_AUTH_DIGEST_QOP_AUTH))
+ ok = FALSE;
+ priv->qop = qop_options;
+ } else
+ priv->qop = 0;
priv->algorithm = soup_auth_digest_parse_algorithm (g_hash_table_lookup (auth_params, "algorithm"));
if (priv->algorithm == -1)