diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-10-02 15:46:33 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-10-02 15:46:33 +0200 |
commit | d9282b4b3a7a1264bf7952e5de4dbd10b6aa5e4e (patch) | |
tree | 897bd4a34f632d96be463cf08197f12f80685c29 /protocols/jabber/sasl.c | |
parent | c1ed6527576ac4c6ee1241f662e7db8e59327fd8 (diff) |
The SASL DIGEST-MD5 handler now doesn't barf on challenges without a realm
(jabber.org likes to do this).
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 ); |