11353
|
1 /**
|
|
2 * @file ntlm.h
|
|
3 *
|
|
4 * gaim
|
|
5 *
|
|
6 * Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de>
|
|
7 *
|
|
8 * ntlm structs are taken from NTLM description on
|
|
9 * http://www.innovation.ch/java/ntlm.html
|
|
10 *
|
|
11 * This program is free software; you can redistribute it and/or modify
|
|
12 * it under the terms of the GNU General Public License as published by
|
|
13 * the Free Software Foundation; either version 2 of the License, or
|
|
14 * (at your option) any later version.
|
|
15 *
|
|
16 * This program is distributed in the hope that it will be useful,
|
|
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19 * GNU General Public License for more details.
|
|
20 *
|
|
21 * You should have received a copy of the GNU General Public License
|
|
22 * along with this program; if not, write to the Free Software
|
|
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
24 */
|
|
25
|
|
26 #ifndef _GAIM_NTLM_H
|
|
27 #define _GAIM_NTLM_H
|
|
28
|
|
29 #include <glib.h>
|
|
30 #include <stdlib.h>
|
|
31
|
|
32 struct type1_message {
|
|
33 guint8 protocol[8]; // 'N', 'T', 'L', 'M', 'S', 'S', 'P', '\0'
|
|
34 guint8 type; // 0x01
|
|
35 guint8 zero1[3];
|
|
36 short flags; // 0xb203
|
|
37 guint8 zero2[2];
|
|
38
|
|
39 short dom_len1; // domain string length
|
|
40 short dom_len2; // domain string length
|
|
41 short dom_off; // domain string offset
|
|
42 guint8 zero3[2];
|
|
43
|
|
44 short host_len1; // host string length
|
|
45 short host_len2; // host string length
|
|
46 short host_off; // host string offset (always 0x20)
|
|
47 guint8 zero4[2];
|
|
48
|
|
49 /* guint8 host[*]; // host string (ASCII)
|
|
50 guint8 dom[*]; // domain string (ASCII) */
|
|
51 };
|
|
52
|
|
53 struct type2_message {
|
|
54 guint8 protocol[8]; // 'N', 'T', 'L', 'M', 'S', 'S', 'P', '\0'
|
|
55 guint8 type; // 0x02
|
|
56 guint8 zero1[7];
|
|
57 short msg_len; // 0x28
|
|
58 guint8 zero2[2];
|
|
59 short flags; // 0x8201
|
|
60 guint8 zero3[2];
|
|
61
|
|
62 guint8 nonce[8]; // nonce
|
|
63 guint8 zero[8];
|
|
64 };
|
|
65
|
|
66 struct type3_message {
|
|
67 guint8 protocol[8]; // 'N', 'T', 'L', 'M', 'S', 'S', 'P', '\0'
|
|
68 guint8 type; // 0x03
|
|
69 guint8 zero1[3];
|
|
70
|
|
71 short lm_resp_len1; // LanManager response length (always 0x18)
|
|
72 short lm_resp_len2; // LanManager response length (always 0x18)
|
|
73 short lm_resp_off; // LanManager response offset
|
|
74 guint8 zero2[2];
|
|
75
|
|
76 short nt_resp_len1; // NT response length (always 0x18)
|
|
77 short nt_resp_len2; // NT response length (always 0x18)
|
|
78 short nt_resp_off; // NT response offset
|
|
79 guint8 zero3[2];
|
|
80
|
|
81 short dom_len1; // domain string length
|
|
82 short dom_len2; // domain string length
|
|
83 short dom_off; // domain string offset (always 0x40)
|
|
84 guint8 zero4[2];
|
|
85
|
|
86 short user_len1; // username string length
|
|
87 short user_len2; // username string length
|
|
88 short user_off; // username string offset
|
|
89 guint8 zero5[2];
|
|
90
|
|
91 short host_len1; // host string length
|
|
92 short host_len2; // host string length
|
|
93 short host_off; // host string offset
|
|
94 guint8 zero6[6];
|
|
95
|
|
96 short msg_len; // message length
|
|
97 guint8 zero7[2];
|
|
98
|
|
99 short flags; // 0x8201
|
|
100 guint8 zero8[2];
|
|
101
|
|
102 /* guint8 dom[*]; // domain string (unicode UTF-16LE)
|
|
103 guint8 user[*]; // username string (unicode UTF-16LE)
|
|
104 guint8 host[*]; // host string (unicode UTF-16LE)
|
|
105 guint8 lm_resp[*]; // LanManager response
|
|
106 guint8 nt_resp[*]; // NT response*/
|
|
107 };
|
|
108
|
|
109 #endif /* _GAIM_NTLM_H */
|