annotate src/ntlm.h @ 13698:6bee2e80e42c

[gaim-migrate @ 16101] Additional constification, add some comments, remove some superfluous whitespace, and changed gchar to guint8 in a few places. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 28 Apr 2006 03:52:09 +0000
parents 2e0d8828da51
children a539caf502b0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11375
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
1 /**
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
2 * @file ntlm.h
13698
6bee2e80e42c [gaim-migrate @ 16101]
Mark Doliner <mark@kingant.net>
parents: 13680
diff changeset
3 *
11375
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
4 * gaim
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
5 *
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
6 * Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de>
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
7 *
13698
6bee2e80e42c [gaim-migrate @ 16101]
Mark Doliner <mark@kingant.net>
parents: 13680
diff changeset
8 * ntlm structs are taken from NTLM description on
6bee2e80e42c [gaim-migrate @ 16101]
Mark Doliner <mark@kingant.net>
parents: 13680
diff changeset
9 * http://www.innovation.ch/java/ntlm.html
6bee2e80e42c [gaim-migrate @ 16101]
Mark Doliner <mark@kingant.net>
parents: 13680
diff changeset
10 *
11375
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
14 * (at your option) any later version.
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
15 *
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
19 * GNU General Public License for more details.
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
20 *
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
24 */
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
25
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
26 #ifndef _GAIM_NTLM_H
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
27 #define _GAIM_NTLM_H
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
28
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
29 /**
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
30 * Generates the base64 encoded type 1 message needed for NTLM authentication
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
31 *
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
32 * @param hostname Your hostname
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
33 * @param domain The domain to authenticate to
13698
6bee2e80e42c [gaim-migrate @ 16101]
Mark Doliner <mark@kingant.net>
parents: 13680
diff changeset
34 * @return base64 encoded string to send to the server. This should
6bee2e80e42c [gaim-migrate @ 16101]
Mark Doliner <mark@kingant.net>
parents: 13680
diff changeset
35 * be g_free'd by the caller.
11375
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
36 */
13680
2e0d8828da51 [gaim-migrate @ 16083]
Mark Doliner <mark@kingant.net>
parents: 13088
diff changeset
37 gchar *gaim_ntlm_gen_type1(const gchar *hostname, const gchar *domain);
11375
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
38
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
39 /**
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
40 * Parses the ntlm type 2 message
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
41 *
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
42 * @param type2 String containing the base64 encoded type2 message
13698
6bee2e80e42c [gaim-migrate @ 16101]
Mark Doliner <mark@kingant.net>
parents: 13680
diff changeset
43 * @return The nonce for use in message type3. This is a statically
6bee2e80e42c [gaim-migrate @ 16101]
Mark Doliner <mark@kingant.net>
parents: 13680
diff changeset
44 * allocated 8 byte binary string.
11375
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
45 */
13698
6bee2e80e42c [gaim-migrate @ 16101]
Mark Doliner <mark@kingant.net>
parents: 13680
diff changeset
46 guint8 *gaim_ntlm_parse_type2(const gchar *type2, guint32 *flags);
11375
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
47
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
48 /**
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
49 * Generates a type3 message
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
50 *
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
51 * @param username The username
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
52 * @param passw The password
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
53 * @param hostname The hostname
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
54 * @param domain The domain to authenticate against
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
55 * @param nonce The nonce returned by gaim_ntlm_parse_type2
13084
31a3a9af1494 [gaim-migrate @ 15446]
Thomas Butter <tbutter>
parents: 11375
diff changeset
56 * @param flags Pointer to the flags returned by gaim_ntlm_parse_type2
13698
6bee2e80e42c [gaim-migrate @ 16101]
Mark Doliner <mark@kingant.net>
parents: 13680
diff changeset
57 * @return A base64 encoded type3 message. This should be g_free'd by
6bee2e80e42c [gaim-migrate @ 16101]
Mark Doliner <mark@kingant.net>
parents: 13680
diff changeset
58 * the caller.
11375
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
59 */
13698
6bee2e80e42c [gaim-migrate @ 16101]
Mark Doliner <mark@kingant.net>
parents: 13680
diff changeset
60 gchar *gaim_ntlm_gen_type3(const gchar *username, const gchar *passw, const gchar *hostname, const gchar *domain, const guint8 *nonce, guint32 *flags);
11375
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
61
7e98b3bf2fdf [gaim-migrate @ 13601]
Thomas Butter <tbutter>
parents:
diff changeset
62 #endif /* _GAIM_NTLM_H */