diff options
author | xengineering <me@xengineering.eu> | 2023-06-30 13:33:14 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-06-30 13:33:14 +0200 |
commit | d7a537267e8bf5631e29ed97218e213da88f3490 (patch) | |
tree | 1f34233fca18d934648b25004fdbff464722d622 | |
parent | 6fd36e07a5d645295f34fcbab36cce5e08a9d84c (diff) | |
download | limox-d7a537267e8bf5631e29ed97218e213da88f3490.tar limox-d7a537267e8bf5631e29ed97218e213da88f3490.tar.zst limox-d7a537267e8bf5631e29ed97218e213da88f3490.zip |
Implement basic handler for failed SASL auth
Writing to the log is still better than doing nothing ...
-rw-r--r-- | xmpp/router.go | 1 | ||||
-rw-r--r-- | xmpp/sasl.go | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/xmpp/router.go b/xmpp/router.go index 84256bb..9d69033 100644 --- a/xmpp/router.go +++ b/xmpp/router.go @@ -24,6 +24,7 @@ func getRoutingTable() routingTable { return routingTable{ {xml.Name{`http://etherx.jabber.org/streams`, `features`}, streamFeaturesHandler}, {xml.Name{`urn:ietf:params:xml:ns:xmpp-sasl`, `success`}, saslSuccessHandler}, + {xml.Name{`urn:ietf:params:xml:ns:xmpp-sasl`, `failure`}, saslFailureHandler}, } } diff --git a/xmpp/sasl.go b/xmpp/sasl.go index 23e8f3f..512fd58 100644 --- a/xmpp/sasl.go +++ b/xmpp/sasl.go @@ -68,3 +68,7 @@ func hasSaslPlain(e []xml.Token) bool { func saslSuccessHandler(s *session, e []xml.Token) { runStreamPair(s) } + +func saslFailureHandler(s *session, e []xml.Token) { + log.Println("SASL autentication failed!") +} |