[asterisk-commits] phsultan: branch 1.4 r96797 - /branches/1.4/res/res_jabber.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jan 7 08:25:30 CST 2008
Author: phsultan
Date: Mon Jan 7 08:25:29 2008
New Revision: 96797
URL: http://svn.digium.com/view/asterisk?view=rev&rev=96797
Log:
Compute the base64 value over the [authzid]\0authcid\0password string,
thus excluding the trailing NULL byte.
This change has already been committed to trunk, see #11644.
Modified:
branches/1.4/res/res_jabber.c
Modified: branches/1.4/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/res/res_jabber.c?view=diff&rev=96797&r1=96796&r2=96797
==============================================================================
--- branches/1.4/res/res_jabber.c (original)
+++ branches/1.4/res/res_jabber.c Mon Jan 7 08:25:29 2008
@@ -583,7 +583,12 @@
iks_insert_attrib(x, "xmlns", IKS_NS_XMPP_SASL);
iks_insert_attrib(x, "mechanism", "PLAIN");
sprintf(s, "%c%s%c%s", 0, client->jid->user, 0, client->password);
- ast_base64encode(base64, (const unsigned char *) s, len, len * 2);
+
+ /* exclude the NULL training byte from the base64 encoding operation
+ as some XMPP servers will refuse it.
+ The format for authentication is [authzid]\0authcid\0password
+ not [authzid]\0authcid\0password\0 */
+ ast_base64encode(base64, (const unsigned char *) s, len - 1, len * 2);
iks_insert_cdata(x, base64, 0);
iks_send(client->p, x);
iks_delete(x);
More information about the asterisk-commits
mailing list