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