Frameworks/libpurple.framework/Versions/0.6.2/Headers/ntlm.h
author Zachary West <zacw@adium.im>
Fri Aug 21 13:25:11 2009 -0700 (2009-08-21)
changeset 2592 e8d15275025e
parent 1739 Frameworks/libpurple.framework/Versions/0.6.0/Headers/ntlm.h@8b0daad9656c
permissions -rw-r--r--
im.pidgin.adium.1-4 at 267c6165e02e34318a1823960bd04c0639952f73
     1 /**
     2  * @file ntlm.h
     3  */
     4 
     5 /* purple
     6  *
     7  * Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de>
     8  *
     9  * ntlm structs are taken from NTLM description on
    10  * http://www.innovation.ch/java/ntlm.html
    11  *
    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.
    16  *
    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.
    21  *
    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
    25  */
    26 
    27 #ifndef _PURPLE_NTLM_H
    28 #define _PURPLE_NTLM_H
    29 
    30 #ifdef __cplusplus
    31 extern "C" {
    32 #endif
    33 
    34 /**
    35  * Generates the base64 encoded type 1 message needed for NTLM authentication
    36  *
    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.
    41  */
    42 gchar *purple_ntlm_gen_type1(const gchar *hostname, const gchar *domain);
    43 
    44 /**
    45  * Parses the ntlm type 2 message
    46  *
    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
    49  *
    50  * @return The nonce for use in message type3.  This is a statically
    51  *         allocated 8 byte binary string.
    52  */
    53 guint8 *purple_ntlm_parse_type2(const gchar *type2, guint32 *flags);
    54 
    55 /**
    56  * Generates a type3 message
    57  *
    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.
    66  */
    67 gchar *purple_ntlm_gen_type3(const gchar *username, const gchar *passw, const gchar *hostname, const gchar *domain, const guint8 *nonce, guint32 *flags);
    68 
    69 #ifdef __cplusplus
    70 }
    71 #endif
    72 
    73 #endif /* _PURPLE_NTLM_H */