-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed build to not depend on libtool or the pidgin source.
Updated README accordingly. And the makefile, of course. Had to add the jabber protocol plugin headers to this source tree.
- Loading branch information
Showing
33 changed files
with
2,441 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
lib/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* purple - Jabber Protocol Plugin | ||
* | ||
* Purple is the legal property of its developers, whose names are too numerous | ||
* to list here. Please refer to the COPYRIGHT file distributed with this | ||
* source distribution. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | ||
* | ||
*/ | ||
|
||
#ifndef PURPLE_JABBER_ADHOCCOMMANDS_H_ | ||
#define PURPLE_JABBER_ADHOCCOMMANDS_H_ | ||
|
||
#include "jabber.h" | ||
|
||
/* Implementation of XEP-0050 */ | ||
|
||
void jabber_adhoc_disco_result_cb(JabberStream *js, const char *from, | ||
JabberIqType type, const char *id, | ||
xmlnode *packet, gpointer data); | ||
|
||
void jabber_adhoc_execute(JabberStream *js, JabberAdHocCommands *cmd); | ||
|
||
void jabber_adhoc_execute_action(PurpleBlistNode *node, gpointer data); | ||
|
||
void jabber_adhoc_got_list(JabberStream *js, const char *from, xmlnode *query); | ||
|
||
void jabber_adhoc_server_get_list(JabberStream *js); | ||
|
||
void jabber_adhoc_init_server_commands(JabberStream *js, GList **m); | ||
|
||
#endif /* PURPLE_JABBER_ADHOCCOMMANDS_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** | ||
* @file auth.h Authentication routines | ||
* | ||
* purple | ||
* | ||
* Purple is the legal property of its developers, whose names are too numerous | ||
* to list here. Please refer to the COPYRIGHT file distributed with this | ||
* source distribution. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | ||
*/ | ||
#ifndef PURPLE_JABBER_AUTH_H_ | ||
#define PURPLE_JABBER_AUTH_H_ | ||
|
||
typedef struct _JabberSaslMech JabberSaslMech; | ||
|
||
#include "jabber.h" | ||
#include "xmlnode.h" | ||
|
||
typedef enum { | ||
JABBER_SASL_STATE_FAIL = -1, /* Abort, Retry, Fail? */ | ||
JABBER_SASL_STATE_OK = 0, /* Hooray! */ | ||
JABBER_SASL_STATE_CONTINUE = 1 /* More authentication required */ | ||
} JabberSaslState; | ||
|
||
struct _JabberSaslMech { | ||
gint8 priority; /* Higher priority will be tried before lower priority */ | ||
const gchar *name; | ||
JabberSaslState (*start)(JabberStream *js, xmlnode *mechanisms, xmlnode **reply, char **msg); | ||
JabberSaslState (*handle_challenge)(JabberStream *js, xmlnode *packet, xmlnode **reply, char **msg); | ||
JabberSaslState (*handle_success)(JabberStream *js, xmlnode *packet, char **msg); | ||
JabberSaslState (*handle_failure)(JabberStream *js, xmlnode *packet, xmlnode **reply, char **msg); | ||
void (*dispose)(JabberStream *js); | ||
}; | ||
|
||
void jabber_auth_start(JabberStream *js, xmlnode *packet); | ||
void jabber_auth_start_old(JabberStream *js); | ||
void jabber_auth_handle_challenge(JabberStream *js, xmlnode *packet); | ||
void jabber_auth_handle_success(JabberStream *js, xmlnode *packet); | ||
void jabber_auth_handle_failure(JabberStream *js, xmlnode *packet); | ||
|
||
JabberSaslMech *jabber_auth_get_plain_mech(void); | ||
JabberSaslMech *jabber_auth_get_digest_md5_mech(void); | ||
JabberSaslMech **jabber_auth_get_scram_mechs(gint *count); | ||
#ifdef HAVE_CYRUS_SASL | ||
JabberSaslMech *jabber_auth_get_cyrus_mech(void); | ||
#endif | ||
|
||
void jabber_auth_add_mech(JabberSaslMech *); | ||
void jabber_auth_remove_mech(JabberSaslMech *); | ||
|
||
void jabber_auth_init(void); | ||
void jabber_auth_uninit(void); | ||
|
||
#endif /* PURPLE_JABBER_AUTH_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* @file auth_digest_md5.h Implementation of SASL DIGEST-MD5 authentication | ||
* | ||
* purple | ||
* | ||
* Purple is the legal property of its developers, whose names are too numerous | ||
* to list here. Please refer to the COPYRIGHT file distributed with this | ||
* source distribution. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | ||
*/ | ||
#ifndef PURPLE_JABBER_AUTH_DIGEST_MD5_H_ | ||
#define PURPLE_JABBER_AUTH_DIGEST_MD5_H_ | ||
|
||
#include "internal.h" | ||
|
||
/* | ||
* Every function in this file is ONLY exposed for tests. | ||
* DO NOT USE ANYTHING HERE OR YOU WILL BE SENT TO THE PIT OF DESPAIR. | ||
*/ | ||
|
||
/* | ||
* Parse a DIGEST-MD5 challenge. | ||
*/ | ||
GHashTable *jabber_auth_digest_md5_parse(const char *challenge); | ||
|
||
#endif /* PURPLE_JABBER_AUTH_DIGEST_MD5_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/** | ||
* @file auth_scram.h Implementation of SASL-SCRAM authentication | ||
* | ||
* purple | ||
* | ||
* Purple is the legal property of its developers, whose names are too numerous | ||
* to list here. Please refer to the COPYRIGHT file distributed with this | ||
* source distribution. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | ||
*/ | ||
#ifndef PURPLE_JABBER_AUTH_SCRAM_H_ | ||
#define PURPLE_JABBER_AUTH_SCRAM_H_ | ||
|
||
/* | ||
* Every function in this file is ONLY exposed for tests. | ||
* DO NOT USE ANYTHING HERE OR YOU WILL BE SENT TO THE PIT OF DESPAIR. | ||
*/ | ||
|
||
/* Per-connection state stored between messages. | ||
* This is stored in js->auth_data_mech. | ||
*/ | ||
typedef struct { | ||
const char *mech_substr; | ||
const char *name; | ||
guint size; | ||
} JabberScramHash; | ||
|
||
typedef struct { | ||
const JabberScramHash *hash; | ||
char *cnonce; | ||
GString *auth_message; | ||
|
||
GString *client_proof; | ||
GString *server_signature; | ||
|
||
gchar *password; | ||
gboolean channel_binding; | ||
int step; | ||
} JabberScramData; | ||
|
||
#include "auth.h" | ||
|
||
/** | ||
* Implements the Hi() function as described in the SASL-SCRAM I-D. | ||
* | ||
* @param hash The struct corresponding to the hash function to be used. | ||
* @param str The string to perform the PBKDF2 operation on. | ||
* @param salt The salt. | ||
* @param iterations The number of iterations to perform. | ||
* | ||
* @returns A newly allocated string containing the result. The string is | ||
* NOT null-terminated and its length is the length of the binary | ||
* output of the hash function in-use. | ||
*/ | ||
guchar *jabber_scram_hi(const JabberScramHash *hash, const GString *str, | ||
GString *salt, guint iterations); | ||
|
||
/** | ||
* Calculates the proofs as described in Section 3 of the SASL-SCRAM I-D. | ||
* | ||
* @param data A JabberScramData structure. hash and auth_message must be | ||
* set. client_proof and server_signature will be set as a result | ||
* of this function. | ||
* @param salt The salt (as specified by the server) | ||
* @param iterations The number of iterations to perform. | ||
* | ||
* @returns TRUE if the proofs were successfully calculated. FALSE otherwise. | ||
*/ | ||
gboolean jabber_scram_calc_proofs(JabberScramData *data, GString *salt, | ||
guint iterations); | ||
|
||
/** | ||
* Feed the algorithm with the data from the server. | ||
*/ | ||
gboolean jabber_scram_feed_parser(JabberScramData *data, gchar *in, gchar **out); | ||
|
||
/** | ||
* Clean up and destroy the data struct | ||
*/ | ||
void jabber_scram_data_destroy(JabberScramData *data); | ||
|
||
#endif /* PURPLE_JABBER_AUTH_SCRAM_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* @file bosh.h Bidirectional-streams over Synchronous HTTP (BOSH) (XEP-0124 and XEP-0206) | ||
* | ||
* purple | ||
* | ||
* Purple is the legal property of its developers, whose names are too numerous | ||
* to list here. Please refer to the COPYRIGHT file distributed with this | ||
* source distribution. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | ||
*/ | ||
#ifndef PURPLE_JABBER_BOSH_H_ | ||
#define PURPLE_JABBER_BOSH_H_ | ||
|
||
typedef struct _PurpleBOSHConnection PurpleBOSHConnection; | ||
|
||
#include "jabber.h" | ||
|
||
void jabber_bosh_init(void); | ||
void jabber_bosh_uninit(void); | ||
|
||
PurpleBOSHConnection* jabber_bosh_connection_init(JabberStream *js, const char *url); | ||
void jabber_bosh_connection_destroy(PurpleBOSHConnection *conn); | ||
|
||
gboolean jabber_bosh_connection_is_ssl(PurpleBOSHConnection *conn); | ||
void jabber_bosh_connection_send_keepalive(PurpleBOSHConnection *conn); | ||
|
||
void jabber_bosh_connection_connect(PurpleBOSHConnection *conn); | ||
void jabber_bosh_connection_close(PurpleBOSHConnection *conn); | ||
void jabber_bosh_connection_send_raw(PurpleBOSHConnection *conn, const char *data); | ||
#endif /* PURPLE_JABBER_BOSH_H_ */ |
Oops, something went wrong.