comparison libpurple/protocols/jabber/useravatar.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 93e8e6331d44
children 904686722499
comparison
equal deleted inserted replaced
30030:ffb8cd9fb528 30031:9f59abd49def
147 guint32 height = ntohl(png->ihdr.height); 147 guint32 height = ntohl(png->ihdr.height);
148 xmlnode *data, *info; 148 xmlnode *data, *info;
149 char *lengthstring, *widthstring, *heightstring; 149 char *lengthstring, *widthstring, *heightstring;
150 150
151 /* compute the sha1 hash */ 151 /* compute the sha1 hash */
152 char *hash = jabber_calculate_data_sha1sum(purple_imgstore_get_data(img), 152 char *hash = jabber_calculate_data_hash(purple_imgstore_get_data(img),
153 purple_imgstore_get_size(img)); 153 purple_imgstore_get_size(img),
154 "sha1");
154 char *base64avatar = purple_base64_encode(purple_imgstore_get_data(img), 155 char *base64avatar = purple_base64_encode(purple_imgstore_get_data(img),
155 purple_imgstore_get_size(img)); 156 purple_imgstore_get_size(img));
156 157
157 publish = xmlnode_new("publish"); 158 publish = xmlnode_new("publish");
158 xmlnode_set_attrib(publish, "node", NS_AVATAR_1_1_DATA); 159 xmlnode_set_attrib(publish, "node", NS_AVATAR_1_1_DATA);