forked from jshiffer/go-xmpp
fix digest-md5 with some ejabberd server
* it looke like some response parameters need to be quoted * so quote username, realm, nonce, etc, ... as in http://tools.ietf.org/html/rfc3920#ref-SASL
This commit is contained in:
parent
8da045a9e5
commit
e71f933d7c
3
xmpp.go
3
xmpp.go
@ -292,7 +292,8 @@ func (c *Client) init(o *Options) error {
|
||||
digestUri := "xmpp/" + domain
|
||||
nonceCount := fmt.Sprintf("%08x", 1)
|
||||
digest := saslDigestResponse(user, realm, o.Password, nonce, cnonceStr, "AUTHENTICATE", digestUri, nonceCount)
|
||||
message := "username=" + user + ", realm=" + realm + ", nonce=" + nonce + ", cnonce=" + cnonceStr + ", nc=" + nonceCount + ", qop=" + qop + ", digest-uri=" + digestUri + ", response=" + digest + ", charset=" + charset
|
||||
message := "username=\"" + user + "\", realm=\"" + realm + "\", nonce=\"" + nonce + "\", cnonce=\"" + cnonceStr + "\", nc=" + nonceCount + ", qop=" + qop + ", digest-uri=\"" + digestUri + "\", response=" + digest + ", charset=" + charset
|
||||
|
||||
fmt.Fprintf(c.conn, "<response xmlns='%s'>%s</response>\n", nsSASL, base64.StdEncoding.EncodeToString([]byte(message)))
|
||||
|
||||
var rspauth saslRspAuth
|
||||
|
Loading…
Reference in New Issue
Block a user