[jdev] How to do SASL authentication in C/C++

Justin Karneges justin-keyword-jabber.093179 at affinix.com
Tue Nov 11 00:03:28 CST 2008


On Monday 10 November 2008 21:39:06 ashiraz wrote:
> I have started to write socket level code for interaction with a jabber
> server like gtalk.
>
> I am sending this thing xml strings but in the authentication phase it
> requires SASL encryption. Is there an expeditious way of encrypting
> authentication code?

It's common to use libraries for SASL, but we've already had a discussion 
about libraries.  That said, it's also very common to not use libraries for 
SASL.  Lots of people write their own code for one reason or another.

You need to decide what mechanisms to implement.  Probably you'd do PLAIN 
and/or DIGEST-MD5.  Consult the RFCs.  You should only do PLAIN if you plan 
to protect the stream with TLS.

Long ago, somebody wrote the smallest tutorial ever for DIGEST-MD5, and it's 
even written in the context of XMPP:
http://web.archive.org/web/20050224191820/http://cataclysm.cx/wip/digest-md5-crash.html

-Justin



More information about the JDev mailing list