Bug 41719

Summary: Wocky not compliant to XEP-0115 (caps) for broken dataforms
Product: Telepathy Reporter: Alban Crequy <alban.crequy>
Component: gabbleAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: git master   
Hardware: Other   
OS: All   
URL: http://cgit.freedesktop.org/~jonny/wocky/log/?h=caps-forms
Whiteboard: review+
i915 platform: i915 features:

Description Alban Crequy 2011-10-12 07:50:58 UTC
http://xmpp.org/extensions/xep-0115.html#ver-proc
section "5.4 Processing Method", bullet point 3.6:

> If the response includes an extended service discovery information
> form where the FORM_TYPE field is not of type "hidden" or the form
> does not include a FORM_TYPE field, ignore the form but continue
> processing.

Wocky does not respect that. In wocky/wocky-caps-hash.c wocky_caps_hash_compute_from_lists():
      field = g_hash_table_lookup (dataform->fields, "FORM_TYPE");
      if (field == NULL)
        {
          DEBUG ("Data form is missing FORM_TYPE field");
          goto cleanup;
        }
Then, it returns NULL, and 
src/presence-cache.c _caps_disco_cb() considers the hash to be bad:
      computed_hash = wocky_caps_hash_compute_from_node (query_result);
      if (computed_hash == NULL)
        {
          DEBUG ("Unable to compute caps hash for '%s'.", jid);
          trust = 0;
          bad_hash = TRUE;
        }
Comment 1 Jonny Lamb 2011-10-13 07:18:43 UTC
Here's a fix.
Comment 2 Will Thompson 2011-10-31 09:25:16 UTC
looks fine

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.