rename accountopt.[ch] to purpleaccountoption.[ch]
[pidgin-git.git] / libpurple / protocols / jabber / auth.h
blobe50ef093ae064fffd0e8df2b22ce2a6a6c5c861e
1 /**
2 * @file auth.h Authentication routines
4 * purple
6 * Purple is the legal property of its developers, whose names are too numerous
7 * to list here. Please refer to the COPYRIGHT file distributed with this
8 * source distribution.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 #ifndef PURPLE_JABBER_AUTH_H
26 #define PURPLE_JABBER_AUTH_H
28 typedef struct _JabberSaslMech JabberSaslMech;
30 #include "jabber.h"
31 #include "xmlnode.h"
33 typedef enum {
34 JABBER_SASL_STATE_FAIL = -1, /* Abort, Retry, Fail? */
35 JABBER_SASL_STATE_OK = 0, /* Hooray! */
36 JABBER_SASL_STATE_CONTINUE = 1 /* More authentication required */
37 } JabberSaslState;
39 struct _JabberSaslMech {
40 gint8 priority; /* Higher priority will be tried before lower priority */
41 const gchar *name;
42 JabberSaslState (*start)(JabberStream *js, PurpleXmlNode *mechanisms, PurpleXmlNode **reply, char **msg);
43 JabberSaslState (*handle_challenge)(JabberStream *js, PurpleXmlNode *packet, PurpleXmlNode **reply, char **msg);
44 JabberSaslState (*handle_success)(JabberStream *js, PurpleXmlNode *packet, char **msg);
45 JabberSaslState (*handle_failure)(JabberStream *js, PurpleXmlNode *packet, PurpleXmlNode **reply, char **msg);
46 void (*dispose)(JabberStream *js);
49 void jabber_auth_start(JabberStream *js, PurpleXmlNode *packet);
50 void jabber_auth_start_old(JabberStream *js);
51 void jabber_auth_handle_challenge(JabberStream *js, PurpleXmlNode *packet);
52 void jabber_auth_handle_success(JabberStream *js, PurpleXmlNode *packet);
53 void jabber_auth_handle_failure(JabberStream *js, PurpleXmlNode *packet);
55 JabberSaslMech *jabber_auth_get_plain_mech(void);
56 JabberSaslMech *jabber_auth_get_digest_md5_mech(void);
57 JabberSaslMech **jabber_auth_get_scram_mechs(gint *count);
58 #ifdef HAVE_CYRUS_SASL
59 JabberSaslMech *jabber_auth_get_cyrus_mech(void);
60 #endif
61 JabberSaslMech *jabber_auth_get_webex_token_mech(void);
63 void jabber_auth_add_mech(JabberSaslMech *);
64 void jabber_auth_remove_mech(JabberSaslMech *);
66 void jabber_auth_init(void);
67 void jabber_auth_uninit(void);
69 #endif /* PURPLE_JABBER_AUTH_H */