Mercurial > pidgin
diff libpurple/protocols/jabber/si.c @ 29630: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 | 8f442c566ff2 |
children | f14cbb6a28a7 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/si.c Mon Mar 22 20:15:55 2010 +0000 +++ b/libpurple/protocols/jabber/si.c Mon Mar 22 21:34:17 2010 +0000 @@ -289,7 +289,7 @@ jsx->js->user->node, jsx->js->user->domain, jsx->js->user->resource); /* Per XEP-0065, the 'host' must be SHA1(SID + from JID + to JID) */ - hash = jabber_calculate_data_sha1sum(dstaddr, strlen(dstaddr)); + hash = jabber_calculate_data_hash(dstaddr, strlen(dstaddr), "sha1"); jsx->connect_data = purple_proxy_connect_socks5(NULL, jsx->gpi, hash, 0, @@ -474,7 +474,7 @@ jsx->js->user->resource, xfer->who); /* Per XEP-0065, the 'host' must be SHA1(SID + from JID + to JID) */ - hash = jabber_calculate_data_sha1sum(dstaddr, strlen(dstaddr)); + hash = jabber_calculate_data_hash(dstaddr, strlen(dstaddr), "sha1"); if(strncmp(hash, jsx->rxqueue + 5, 40) || jsx->rxqueue[45] != 0x00 || jsx->rxqueue[46] != 0x00) {