Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/presence.c @ 30031:9f59abd49def
jabber: Validate the hash on incoming BoB objects (in case the CID is on the
form algo+hash@bob.xmpp.org).
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Mon, 22 Mar 2010 21:34:17 +0000 |
parents | 40fee5f86bf8 |
children | b0f8dcab7b43 ae615b3d3e47 |
comparison
equal
deleted
inserted
replaced
30030:ffb8cd9fb528 | 30031:9f59abd49def |
---|---|
455 guchar *data; | 455 guchar *data; |
456 gsize size; | 456 gsize size; |
457 | 457 |
458 data = purple_base64_decode(text, &size); | 458 data = purple_base64_decode(text, &size); |
459 if (data) { | 459 if (data) { |
460 gchar *hash = jabber_calculate_data_sha1sum(data, size); | 460 gchar *hash = jabber_calculate_data_hash(data, size, "sha1"); |
461 purple_buddy_icons_set_for_user(js->gc->account, from, data, | 461 purple_buddy_icons_set_for_user(js->gc->account, from, data, |
462 size, hash); | 462 size, hash); |
463 g_free(hash); | 463 g_free(hash); |
464 } | 464 } |
465 | 465 |