Thu, 31 May 2012 03:48:16 +0000
propagate from branch 'im.pidgin.pidgin.2.x.y' (head 0aa32fc00dc281d336971ef3966efe6652dc1bf6)
to branch 'im.pidgin.pidgin' (head 89f064bdd762e62b3e3d3a2153cece816879cee9)
|
11375
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
1 | /** |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
2 | * @file ntlm.h |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
3 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | /* purple |
|
11375
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
6 | * |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
7 | * Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de> |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
8 | * |
|
13700
ad7bca3b4240
[gaim-migrate @ 16101]
Mark Doliner <markdoliner@pidgin.im>
parents:
13682
diff
changeset
|
9 | * ntlm structs are taken from NTLM description on |
|
ad7bca3b4240
[gaim-migrate @ 16101]
Mark Doliner <markdoliner@pidgin.im>
parents:
13682
diff
changeset
|
10 | * http://www.innovation.ch/java/ntlm.html |
|
ad7bca3b4240
[gaim-migrate @ 16101]
Mark Doliner <markdoliner@pidgin.im>
parents:
13682
diff
changeset
|
11 | * |
|
11375
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
12 | * This program is free software; you can redistribute it and/or modify |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
13 | * it under the terms of the GNU General Public License as published by |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
14 | * the Free Software Foundation; either version 2 of the License, or |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
15 | * (at your option) any later version. |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
16 | * |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
17 | * This program is distributed in the hope that it will be useful, |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
20 | * GNU General Public License for more details. |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
21 | * |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
22 | * You should have received a copy of the GNU General Public License |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
23 | * along with this program; if not, write to the Free Software |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
15884
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
11375
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
25 | */ |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
26 | |
| 15884 | 27 | #ifndef _PURPLE_NTLM_H |
| 28 | #define _PURPLE_NTLM_H | |
|
11375
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
29 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25888
diff
changeset
|
30 | G_BEGIN_DECLS |
|
14988
66b34458d49e
[gaim-migrate @ 17698]
Richard Laager <rlaager@pidgin.im>
parents:
14254
diff
changeset
|
31 | |
|
11375
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
32 | /** |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
33 | * Generates the base64 encoded type 1 message needed for NTLM authentication |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
34 | * |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
35 | * @param hostname Your hostname |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
36 | * @param domain The domain to authenticate to |
|
13700
ad7bca3b4240
[gaim-migrate @ 16101]
Mark Doliner <markdoliner@pidgin.im>
parents:
13682
diff
changeset
|
37 | * @return base64 encoded string to send to the server. This should |
|
ad7bca3b4240
[gaim-migrate @ 16101]
Mark Doliner <markdoliner@pidgin.im>
parents:
13682
diff
changeset
|
38 | * be g_free'd by the caller. |
|
11375
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
39 | */ |
| 15884 | 40 | gchar *purple_ntlm_gen_type1(const gchar *hostname, const gchar *domain); |
|
11375
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
41 | |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
42 | /** |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
43 | * Parses the ntlm type 2 message |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
44 | * |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
45 | * @param type2 String containing the base64 encoded type2 message |
|
13785
4ee261bcc567
[gaim-migrate @ 16195]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13700
diff
changeset
|
46 | * @param flags If not @c NULL, this will store the flags for the message |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
20147
diff
changeset
|
47 | * |
|
13700
ad7bca3b4240
[gaim-migrate @ 16101]
Mark Doliner <markdoliner@pidgin.im>
parents:
13682
diff
changeset
|
48 | * @return The nonce for use in message type3. This is a statically |
|
ad7bca3b4240
[gaim-migrate @ 16101]
Mark Doliner <markdoliner@pidgin.im>
parents:
13682
diff
changeset
|
49 | * allocated 8 byte binary string. |
|
11375
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
50 | */ |
| 15884 | 51 | guint8 *purple_ntlm_parse_type2(const gchar *type2, guint32 *flags); |
|
11375
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
52 | |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
53 | /** |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
54 | * Generates a type3 message |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
55 | * |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
56 | * @param username The username |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
57 | * @param passw The password |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
58 | * @param hostname The hostname |
|
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
59 | * @param domain The domain to authenticate against |
| 15884 | 60 | * @param nonce The nonce returned by purple_ntlm_parse_type2 |
| 61 | * @param flags Pointer to the flags returned by purple_ntlm_parse_type2 | |
|
13700
ad7bca3b4240
[gaim-migrate @ 16101]
Mark Doliner <markdoliner@pidgin.im>
parents:
13682
diff
changeset
|
62 | * @return A base64 encoded type3 message. This should be g_free'd by |
|
ad7bca3b4240
[gaim-migrate @ 16101]
Mark Doliner <markdoliner@pidgin.im>
parents:
13682
diff
changeset
|
63 | * the caller. |
|
11375
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
64 | */ |
| 15884 | 65 | gchar *purple_ntlm_gen_type3(const gchar *username, const gchar *passw, const gchar *hostname, const gchar *domain, const guint8 *nonce, guint32 *flags); |
|
11375
765ec911f25d
[gaim-migrate @ 13601]
Thomas Butter <tbutter@users.sourceforge.net>
parents:
diff
changeset
|
66 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25888
diff
changeset
|
67 | G_END_DECLS |
|
14988
66b34458d49e
[gaim-migrate @ 17698]
Richard Laager <rlaager@pidgin.im>
parents:
14254
diff
changeset
|
68 | |
| 15884 | 69 | #endif /* _PURPLE_NTLM_H */ |