From 2e1ddeb6547e140e9651231fedcd00e8ee4b1ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Sun, 14 Jun 2020 22:54:42 +0200 Subject: Implement SASL plain authentication --- src/irc/irc_client.hpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/irc/irc_client.hpp') diff --git a/src/irc/irc_client.hpp b/src/irc/irc_client.hpp index cfb3d21..e2ad8b9 100644 --- a/src/irc/irc_client.hpp +++ b/src/irc/irc_client.hpp @@ -1,8 +1,9 @@ #pragma once - #include #include +#include +#include #include #include @@ -231,6 +232,17 @@ public: * The IRC server is confirming that the invitation has been forwarded */ void on_invited(const IrcMessage& message); + /** + * The IRC server sends a CAP message, as part of capabilities negociation. It could be a ACK, + * NACK, or something else + */ + void on_cap(const IrcMessage& message); +private: + void cap_end(); +public: + void on_authenticate(const IrcMessage& message); + void on_sasl_success(const IrcMessage& message); + void on_sasl_login(const IrcMessage& message); /** * The channel has been completely joined (self presence, topic, all names * received etc), send the self presence and topic to the XMPP user. @@ -359,6 +371,12 @@ private: * has been established, we are authentified and we have a nick) */ bool welcomed; + /** + * Whether or not we are trying to authenticate using sasl. If this is true we need to wait for a + * successful auth + */ + SaslState sasl_state{SaslState::unneeded}; + std::map capabilities; /** * See http://www.irc.org/tech_docs/draft-brocklesby-irc-isupport-03.txt section 3.3 * We store the possible chanmodes in this object. -- cgit v1.2.3