Oops, I forgot this. This is done internally in libgadu, and not doing it
[pidgin-git.git] / libpurple / ntlm.h
blobe61a4f5f0739b3f60fcd7eb5171053165f892464
1 /**
2 * @file ntlm.h
3 */
5 /* purple
7 * Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de>
9 * ntlm structs are taken from NTLM description on
10 * http://www.innovation.ch/java/ntlm.html
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
27 #ifndef _PURPLE_NTLM_H
28 #define _PURPLE_NTLM_H
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 /**
35 * Generates the base64 encoded type 1 message needed for NTLM authentication
37 * @param hostname Your hostname
38 * @param domain The domain to authenticate to
39 * @return base64 encoded string to send to the server. This should
40 * be g_free'd by the caller.
42 gchar *purple_ntlm_gen_type1(const gchar *hostname, const gchar *domain);
44 /**
45 * Parses the ntlm type 2 message
47 * @param type2 String containing the base64 encoded type2 message
48 * @param flags If not @c NULL, this will store the flags for the message
50 * @return The nonce for use in message type3. This is a statically
51 * allocated 8 byte binary string.
53 guint8 *purple_ntlm_parse_type2(const gchar *type2, guint32 *flags);
55 /**
56 * Generates a type3 message
58 * @param username The username
59 * @param passw The password
60 * @param hostname The hostname
61 * @param domain The domain to authenticate against
62 * @param nonce The nonce returned by purple_ntlm_parse_type2
63 * @param flags Pointer to the flags returned by purple_ntlm_parse_type2
64 * @return A base64 encoded type3 message. This should be g_free'd by
65 * the caller.
67 gchar *purple_ntlm_gen_type3(const gchar *username, const gchar *passw, const gchar *hostname, const gchar *domain, const guint8 *nonce, guint32 *flags);
69 #ifdef __cplusplus
71 #endif
73 #endif /* _PURPLE_NTLM_H */