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
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
);
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
);
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
67 gchar
*purple_ntlm_gen_type3(const gchar
*username
, const gchar
*passw
, const gchar
*hostname
, const gchar
*domain
, const guint8
*nonce
, guint32
*flags
);
73 #endif /* _PURPLE_NTLM_H */