Frameworks/libpurple.framework/Versions/2.10.12r8d2874a79747/Headers/ntlm.h
branchadium-1.5.11
changeset 6014 fcb71cb71a3d
parent 5941 307f53385811
parent 6013 f8d0dc659e3f
child 6016 325e2ab3406f
equal deleted inserted replaced
5941:307f53385811 6014:fcb71cb71a3d
     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 */