Mercurial > pidgin.yaz
annotate libpurple/protocols/myspace/myspace.h @ 16748:da7621e799b7
Enable usage of RC4 in libpurple, now that it is in 2.0.1.
author | Jeffrey Connelly <jaconnel@calpoly.edu> |
---|---|
date | Thu, 31 May 2007 02:17:03 +0000 |
parents | 496855295bd7 |
children | 0fa4a3e9b318 |
rev | line source |
---|---|
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
1 /* MySpaceIM Protocol Plugin, headr file |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
2 * |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
3 * \author Jeff Connelly |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
4 * |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
5 * Copyright (C) 2007, Jeff Connelly <jeff2@homing.pidgin.im> |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
6 * |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
7 * This program is free software; you can redistribute it and/or modify |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
9 * the Free Software Foundation; either version 2 of the License, or |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
10 * (at your option) any later version. |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
11 * |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
15 * GNU General Public License for more details. |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
16 * |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
18 * along with this program; if not, write to the Free Software |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
20 */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
21 |
16746
52357f6392a4
Add partial implementation of MsimMessage (not used anywhere yet).
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16745
diff
changeset
|
22 #ifndef _MYSPACE_MYSPACE_H |
52357f6392a4
Add partial implementation of MsimMessage (not used anywhere yet).
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16745
diff
changeset
|
23 #define _MYSPACE_MYSPACE_H |
52357f6392a4
Add partial implementation of MsimMessage (not used anywhere yet).
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16745
diff
changeset
|
24 |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
25 /* Other includes */ |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
26 #include <string.h> |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
27 #include <errno.h> /* for EAGAIN */ |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
28 #include <stdarg.h> |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
29 |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
30 #include <glib.h> |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
31 |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
32 #ifdef _WIN32 |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
33 #include "win32dep.h" |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
34 #else |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
35 /* For recv() and send(); needed to match Win32 */ |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
36 #include <sys/types.h> |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
37 #include <sys/socket.h> |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
38 #endif |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
39 |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
40 #include "internal.h" |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
41 |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
42 #include "notify.h" |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
43 #include "plugin.h" |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
44 #include "accountopt.h" |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
45 #include "version.h" |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
46 #include "cipher.h" /* for SHA-1 */ |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
47 #include "util.h" /* for base64 */ |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
48 #include "debug.h" /* for purple_debug_info */ |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
49 |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
50 |
16736
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
51 /* Conditional compilation options */ |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
52 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
53 /* Debugging options */ |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
54 #define MSIM_DEBUG_MSG |
16408
bb649c52fc19
Replace printf() in MySpaceIM prpl with purple_debug_info().
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16406
diff
changeset
|
55 /* Low-level and rarely needed */ |
16736
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
56 /*#define MSIM_DEBUG_PARSE */ |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
57 /*#define MSIM_DEBUG_LOGIN_CHALLENGE */ |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
58 /*#define MSIM_DEBUG_RXBUF */ |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
59 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
60 /* RC4 didn't make it into Libpurple 2.0.0's cipher suite, so we have |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
61 * to use our own RC4 code (from Samba) by not defining this. */ |
16748
da7621e799b7
Enable usage of RC4 in libpurple, now that it is in 2.0.1.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16747
diff
changeset
|
62 /* RC4 is in Libpurple 2.0.1, so define this. */ |
da7621e799b7
Enable usage of RC4 in libpurple, now that it is in 2.0.1.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16747
diff
changeset
|
63 #define MSIM_USE_PURPLE_RC4 |
16736
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
64 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
65 /* TODO: when RC4 makes it into libpurple, use the PURPLE_VERSION_CHECK |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
66 * macro to conditionally compile. And then later, get rid of our own |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
67 * RC4 code and only support libpurple with RC4. */ |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
68 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
69 /* Constants */ |
16408
bb649c52fc19
Replace printf() in MySpaceIM prpl with purple_debug_info().
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16406
diff
changeset
|
70 |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
71 /* Statuses */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
72 #define MSIM_STATUS_ONLINE "online" |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
73 #define MSIM_STATUS_AWAY "away" |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
74 #define MSIM_STATUS_OFFLINE "offline" |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
75 #define MSIM_STATUS_INVISIBLE "invisible" |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
76 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
77 /* Build version of MySpaceIM to report to servers (1.0.xxx.0) */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
78 #define MSIM_CLIENT_VERSION 673 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
79 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
80 /* Server */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
81 #define MSIM_SERVER "im.myspace.akadns.net" |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
82 //#define MSIM_SERVER "localhost" |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
83 #define MSIM_PORT 1863 /* TODO: alternate ports and automatic */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
84 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
85 /* Constants */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
86 #define HASH_SIZE 0x14 /**< Size of SHA-1 hash for login */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
87 #define NONCE_SIZE 0x20 /**< Half of decoded 'nc' field */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
88 #define MSIM_READ_BUF_SIZE 5*1024 /**< Receive buffer size */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
89 #define MSIM_FINAL_STRING "\\final\\" /**< Message end marker */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
90 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
91 /* Messages */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
92 #define MSIM_BM_INSTANT 1 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
93 #define MSIM_BM_STATUS 100 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
94 #define MSIM_BM_ACTION 121 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
95 /*#define MSIM_BM_UNKNOWN1 122*/ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
96 |
16745
3f53f8f502b2
Replacement magic numbers by symbolic constants.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16743
diff
changeset
|
97 /* Authentication algorithm for login2 */ |
3f53f8f502b2
Replacement magic numbers by symbolic constants.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16743
diff
changeset
|
98 #define MSIM_AUTH_ALGORITHM 196610 |
3f53f8f502b2
Replacement magic numbers by symbolic constants.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16743
diff
changeset
|
99 |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
100 /* Random number in every MsimSession, to ensure it is valid. */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
101 #define MSIM_SESSION_STRUCT_MAGIC 0xe4a6752b |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
102 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
103 /* Everything needed to keep track of a session. */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
104 typedef struct _MsimSession |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
105 { |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
106 guint magic; /**< MSIM_SESSION_STRUCT_MAGIC */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
107 PurpleAccount *account; |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
108 PurpleConnection *gc; |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
109 gchar *sesskey; /**< Session key text string from server */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
110 gchar *userid; /**< This user's numeric user ID */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
111 gint fd; /**< File descriptor to/from server */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
112 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
113 GHashTable *user_lookup_cb; /**< Username -> userid lookup callback */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
114 GHashTable *user_lookup_cb_data; /**< Username -> userid lookup callback data */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
115 GHashTable *user_lookup_cache; /**< Cached information on users */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
116 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
117 gchar *rxbuf; /**< Receive buffer */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
118 guint rxoff; /**< Receive buffer offset */ |
16408
bb649c52fc19
Replace printf() in MySpaceIM prpl with purple_debug_info().
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16406
diff
changeset
|
119 guint next_rid; /**< Next request/response ID */ |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
120 } MsimSession; |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
121 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
122 /* Check if an MsimSession is valid */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
123 #define MSIM_SESSION_VALID(s) (session != NULL && \ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
124 session->magic == MSIM_SESSION_STRUCT_MAGIC) |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
125 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
126 /* Callback function pointer type for when a user's information is received, |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
127 * initiated from a user lookup. */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
128 typedef void (*MSIM_USER_LOOKUP_CB)(MsimSession *session, GHashTable *userinfo, |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
129 gpointer data); |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
130 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
131 /* Passed to MSIM_USER_LOOKUP_CB for msim_send_im_cb - called when |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
132 * user information is available, ready to send a message. */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
133 typedef struct _send_im_cb_struct |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
134 { |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
135 gchar *who; |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
136 gchar *message; |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
137 PurpleMessageFlags flags; |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
138 } send_im_cb_struct; |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
139 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
140 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
141 /* Functions */ |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
142 gboolean msim_load(PurplePlugin *plugin); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
143 GList *msim_status_types(PurpleAccount *acct); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
144 const gchar *msim_list_icon(PurpleAccount *acct, PurpleBuddy *buddy); |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
145 |
16746
52357f6392a4
Add partial implementation of MsimMessage (not used anywhere yet).
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16745
diff
changeset
|
146 /* TODO: move these three functions to message.c/h */ |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
147 gchar *msim_unescape(const gchar *msg); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
148 gchar *msim_escape(const gchar *msg); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
149 gchar *str_replace(const gchar* str, const gchar *old, const gchar *new); |
16746
52357f6392a4
Add partial implementation of MsimMessage (not used anywhere yet).
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16745
diff
changeset
|
150 |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
151 GHashTable *msim_parse(gchar* msg); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
152 GHashTable* msim_parse_body(const gchar *body_str); |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
153 |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
154 void print_hash_item(gpointer key, gpointer value, gpointer user_data); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
155 gboolean msim_send_raw(MsimSession *session, const gchar *msg); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
156 gchar *msim_pack(GHashTable *table); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
157 gboolean msim_sendh(MsimSession *session, GHashTable *table); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
158 gboolean msim_send(MsimSession *session, ...); |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
159 |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
160 void msim_login(PurpleAccount *acct); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
161 int msim_login_challenge(MsimSession *session, GHashTable *table); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
162 gchar* msim_compute_login_response(guchar nonce[2*NONCE_SIZE], |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
163 gchar* email, gchar* password, guint *response_len); |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
164 |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
165 int msim_send_im(PurpleConnection *gc, const char *who, |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
166 const char *message, PurpleMessageFlags flags); |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
167 int msim_send_im_by_userid(MsimSession *session, const gchar *userid, |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
168 const gchar *message, PurpleMessageFlags flags); |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
169 void msim_send_im_by_userid_cb(MsimSession *session, |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
170 GHashTable *userinfo, gpointer data); |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
171 void msim_incoming_im_cb(MsimSession *session, GHashTable *userinfo, |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
172 gpointer data); |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
173 int msim_incoming_im(MsimSession *session, GHashTable *table); |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
174 |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
175 int msim_process_reply(MsimSession *session, GHashTable *table); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
176 int msim_process(PurpleConnection *gc, GHashTable *table); |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
177 |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
178 int msim_error(MsimSession *session, GHashTable *table); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
179 void msim_status_cb(MsimSession *session, GHashTable *userinfo, |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
180 gpointer data); |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
181 int msim_status(MsimSession *session, GHashTable *table); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
182 void msim_input_cb(gpointer gc_uncasted, gint source, |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
183 PurpleInputCondition cond); |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
184 void msim_connect_cb(gpointer data, gint source, |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
185 const gchar *error_message); |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
186 |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
187 MsimSession *msim_session_new(PurpleAccount *acct); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
188 void msim_session_destroy(MsimSession *session); |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
189 |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
190 void msim_close(PurpleConnection *gc); |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
191 |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
192 gboolean msim_is_userid(const gchar *user); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
193 gboolean msim_is_email(const gchar *user); |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
194 |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
195 void msim_lookup_user(MsimSession *session, const gchar *user, |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
196 MSIM_USER_LOOKUP_CB cb, gpointer data); |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
197 |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
198 char *msim_status_text(PurpleBuddy *buddy); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
199 void msim_tooltip_text(PurpleBuddy *buddy, |
16406
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
200 PurpleNotifyUserInfo *user_info, gboolean full); |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
201 |
16747
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
202 void init_plugin(PurplePlugin *plugin); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16746
diff
changeset
|
203 |
16736
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
204 #ifndef MSIM_USE_PURPLE_RC4 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
205 /* |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
206 Unix SMB/CIFS implementation. |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
207 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
208 a partial implementation of RC4 designed for use in the |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
209 SMB authentication protocol |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
210 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
211 Copyright (C) Andrew Tridgell 1998 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
212 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
213 $Id: crypt-rc4.h 12116 2004-09-27 23:29:22Z guy $ |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
214 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
215 This program is free software; you can redistribute it and/or modify |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
216 it under the terms of the GNU General Public License as published by |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
217 the Free Software Foundation; either version 2 of the License, or |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
218 (at your option) any later version. |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
219 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
220 This program is distributed in the hope that it will be useful, |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
221 but WITHOUT ANY WARRANTY; without even the implied warranty of |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
222 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
223 GNU General Public License for more details. |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
224 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
225 You should have received a copy of the GNU General Public License |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
226 along with this program; if not, write to the Free Software |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
227 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
228 */ |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
229 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
230 typedef struct _rc4_state_struct { |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
231 unsigned char s_box[256]; |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
232 unsigned char index_i; |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
233 unsigned char index_j; |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
234 } rc4_state_struct; |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
235 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
236 void crypt_rc4_init(rc4_state_struct *rc4_state, |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
237 const unsigned char *key, int key_len); |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
238 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
239 void crypt_rc4(rc4_state_struct *rc4_state, unsigned char *data, int data_len); |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
240 #endif /* !MSIM_USE_PURPLE_RC4 */ |
16746
52357f6392a4
Add partial implementation of MsimMessage (not used anywhere yet).
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16745
diff
changeset
|
241 |
52357f6392a4
Add partial implementation of MsimMessage (not used anywhere yet).
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16745
diff
changeset
|
242 #endif /* !_MYSPACE_MYSPACE_H */ |