From d9282b4b3a7a1264bf7952e5de4dbd10b6aa5e4e Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 2 Oct 2006 15:46:33 +0200 Subject: The SASL DIGEST-MD5 handler now doesn't barf on challenges without a realm (jabber.org likes to do this). --- protocols/jabber/sasl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'protocols/jabber/sasl.c') diff --git a/protocols/jabber/sasl.c b/protocols/jabber/sasl.c index 7a3ca112..39d45c9b 100644 --- a/protocols/jabber/sasl.c +++ b/protocols/jabber/sasl.c @@ -206,9 +206,15 @@ xt_status sasl_pkt_challenge( struct xt_node *node, gpointer data ) nonce = sasl_get_part( dec, "nonce" ); realm = sasl_get_part( dec, "realm" ); - if( !nonce || !realm ) + if( !nonce ) goto error; + /* Jabber.Org considers the realm part optional and doesn't + specify one. Oh well, actually they're right, but still, + don't know if this is right... */ + if( !realm ) + realm = g_strdup( jd->server ); + random_bytes( (unsigned char *) cnonce_bin, sizeof( cnonce_bin ) ); cnonce = base64_encode( cnonce_bin, sizeof( cnonce_bin ) ); digest_uri = g_strdup_printf( "%s/%s", "xmpp", jd->server ); -- cgit v1.2.3