Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/jabglue.c @ 1045:96be69d3a5fd
Verify signatures for empty status messages
The <status/> element is mandatory when signing (according to XEP-0027),
but some Jabber clients omit it.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 26 Nov 2006 18:05:31 +0100 |
parents | 52cfe9bf9840 |
children | a3748bd3d010 |
comparison
equal
deleted
inserted
replaced
1044:52cfe9bf9840 | 1045:96be69d3a5fd |
---|---|
1438 GSList *sl_buddy; | 1438 GSList *sl_buddy; |
1439 struct pgp_data *res_pgpdata; | 1439 struct pgp_data *res_pgpdata; |
1440 gpgme_sigsum_t sigsum; | 1440 gpgme_sigsum_t sigsum; |
1441 | 1441 |
1442 // All parameters must be valid | 1442 // All parameters must be valid |
1443 if (!(xmldata && barejid && rname && text && *text)) | 1443 if (!(xmldata && barejid && rname && text)) |
1444 return; | 1444 return; |
1445 | 1445 |
1446 if (!gpg_enabled()) | 1446 if (!gpg_enabled()) |
1447 return; | 1447 return; |
1448 | 1448 |
2048 m = roster_getstatusmsg(r, rname); | 2048 m = roster_getstatusmsg(r, rname); |
2049 if ((ust != roster_getstatus(r, rname)) || | 2049 if ((ust != roster_getstatus(r, rname)) || |
2050 (!ustmsg && m && m[0]) || (ustmsg && (!m || strcmp(ustmsg, m)))) | 2050 (!ustmsg && m && m[0]) || (ustmsg && (!m || strcmp(ustmsg, m)))) |
2051 hk_statuschange(r, rname, bpprio, timestamp, ust, ustmsg); | 2051 hk_statuschange(r, rname, bpprio, timestamp, ust, ustmsg); |
2052 // Presence signature processing | 2052 // Presence signature processing |
2053 if (!ustmsg) | |
2054 ustmsg = ""; // Some clients omit the <status/> element :-( | |
2053 check_signature(r, rname, xml_get_xmlns(xmldata, NS_SIGNED), ustmsg); | 2055 check_signature(r, rname, xml_get_xmlns(xmldata, NS_SIGNED), ustmsg); |
2054 } | 2056 } |
2055 | 2057 |
2056 g_free(r); | 2058 g_free(r); |
2057 } | 2059 } |