2 Unix SMB/Netbios implementation.
4 SMB parameters and setup
5 Copyright (C) Andrew Tridgell 1992-2000
6 Copyright (C) Luke Kenneth Casson Leighton 1996-2000
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #ifndef _RPC_NTLMSSP_H /* RPC_NTLMSSP_H */
26 #include "rpc_misc.h" /* this only pulls in STRHDR */
28 /* NTLMSSP message types */
29 enum NTLM_MESSAGE_TYPE
31 NTLMSSP_NEGOTIATE
= 1,
32 NTLMSSP_CHALLENGE
= 2,
37 /* NTLMSSP negotiation flags */
38 #define NTLMSSP_NEGOTIATE_UNICODE 0x00000001
39 #define NTLMSSP_NEGOTIATE_OEM 0x00000002
40 #define NTLMSSP_REQUEST_TARGET 0x00000004
41 #define NTLMSSP_NEGOTIATE_SIGN 0x00000010
42 #define NTLMSSP_NEGOTIATE_SEAL 0x00000020
43 #define NTLMSSP_NEGOTIATE_LM_KEY 0x00000080
44 #define NTLMSSP_NEGOTIATE_00000100 0x00000100
45 #define NTLMSSP_NEGOTIATE_NTLM 0x00000200
46 #define NTLMSSP_NEGOTIATE_00000400 0x00000400
47 #define NTLMSSP_NEGOTIATE_00001000 0x00001000
48 #define NTLMSSP_NEGOTIATE_00002000 0x00002000
49 #define NTLMSSP_NEGOTIATE_ALWAYS_SIGN 0x00008000
50 #define NTLMSSP_NEGOTIATE_NTLM2 0x00080000
51 #define NTLMSSP_NEGOTIATE_TARGET_INFO 0x00800000
52 #define NTLMSSP_NEGOTIATE_128 0x20000000
53 #define NTLMSSP_NEGOTIATE_KEY_EXCH 0x40000000
55 /* NTLMSSP signature version */
56 #define NTLMSSP_SIGN_VERSION 0x01
58 /* this is TEMPORARILY coded up as a specific structure */
59 /* this structure comes after the bind request */
60 /* RPC_AUTH_NTLMSSP_NEG */
61 typedef struct rpc_auth_ntlmssp_neg_info
63 uint32 neg_flgs
; /* 0x0000 b2b3 */
65 STRHDR hdr_myname
; /* offset is against START of this structure */
66 STRHDR hdr_domain
; /* offset is against START of this structure */
68 fstring myname
; /* calling workstation's name */
69 fstring domain
; /* calling workstations's domain */
71 } RPC_AUTH_NTLMSSP_NEG
;
73 /* this is TEMPORARILY coded up as a specific structure */
74 /* this structure comes after the bind acknowledgement */
75 /* RPC_AUTH_NTLMSSP_CHAL */
76 typedef struct rpc_auth_ntlmssp_chal_info
78 uint32 unknown_1
; /* 0x0000 0000 */
79 uint32 unknown_2
; /* 0x0000 0028 */
80 uint32 neg_flags
; /* 0x0000 82b1 */
82 uint8 challenge
[8]; /* ntlm challenge */
83 uint8 reserved
[8]; /* zeros */
85 } RPC_AUTH_NTLMSSP_CHAL
;
88 /* RPC_AUTH_NTLMSSP_RESP */
89 typedef struct rpc_auth_ntlmssp_resp_info
91 STRHDR hdr_lm_resp
; /* LM response (NULL or 24 bytes) */
92 STRHDR hdr_nt_resp
; /* NT response (NULL, 24 or variable-length) */
96 STRHDR hdr_sess_key
; /* NULL unless negotiated */
97 uint32 neg_flags
; /* 0x0000 82b1 */
106 } RPC_AUTH_NTLMSSP_RESP
;
109 /* attached to the end of encrypted rpc requests and responses */
110 /* RPC_AUTH_NTLMSSP_CHK */
111 typedef struct rpc_auth_ntlmssp_chk_info
113 uint32 ver
; /* 0x0000 0001 */
115 uint32 crc32
; /* checksum using 0xEDB8 8320 as a polynomial */
118 } RPC_AUTH_NTLMSSP_CHK
;
120 #endif /* RPC_NTLMSSP_H */