diff options
Diffstat (limited to 'xmpp/sasl.go')
-rw-r--r-- | xmpp/sasl.go | 43 |
1 files changed, 3 insertions, 40 deletions
diff --git a/xmpp/sasl.go b/xmpp/sasl.go index 5fac934..ae3be4a 100644 --- a/xmpp/sasl.go +++ b/xmpp/sasl.go @@ -10,12 +10,6 @@ type saslRequest struct { Payload []byte `xml:",chardata"` } -type saslSuccess struct {} - -func handleSaslSuccess(s *session) { - openStream(s.tx, s.jid) -} - func (s *session) sasl() { start := xml.StartElement{ xml.Name{"urn:ietf:params:xml:ns:xmpp-sasl", "auth"}, @@ -35,39 +29,8 @@ func (s *session) sasl() { } } -// hasSaslPlain scans the given stream features XML element for the SASL PLAIN -// mechanism which is supported by xengineering.eu/limox/xmpp. It returns true -// if the stream has support for this mechanism and false otherwise. -func hasSaslPlain(e []xml.Token) bool { - mechanism := xml.Name{`urn:ietf:params:xml:ns:xmpp-sasl`, `mechanism`} - - for i, t := range e { - switch s := t.(type) { - case xml.StartElement: - if s.Name == mechanism { - if i+1 < len(e) { - subtype := func() string { - switch c := e[i+1].(type) { - case xml.CharData: - return string(c) - default: - return "" - } - }() - if subtype == `PLAIN` { - return true - } - } - } - } - } - - return false -} - -func saslSuccessHandler(s *session, e []xml.Token) { -} +type saslSuccess struct {} -func saslFailureHandler(s *session, e []xml.Token) { - log.Println("SASL autentication failed!") +func handleSaslSuccess(s *session) { + openStream(s.tx, s.jid) } |