diff options
Diffstat (limited to 'protocols/jabber/sasl.c')
-rw-r--r-- | protocols/jabber/sasl.c | 8 |
1 files changed, 7 insertions, 1 deletions
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 ); |