xref: /titanic_52/usr/src/lib/libsmbfs/netsmb/ntlmssp.h (revision 12b65585e720714b31036daaa2b30eb76014048e)
1*12b65585SGordon Ross /*
2*12b65585SGordon Ross  * CDDL HEADER START
3*12b65585SGordon Ross  *
4*12b65585SGordon Ross  * The contents of this file are subject to the terms of the
5*12b65585SGordon Ross  * Common Development and Distribution License (the "License").
6*12b65585SGordon Ross  * You may not use this file except in compliance with the License.
7*12b65585SGordon Ross  *
8*12b65585SGordon Ross  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*12b65585SGordon Ross  * or http://www.opensolaris.org/os/licensing.
10*12b65585SGordon Ross  * See the License for the specific language governing permissions
11*12b65585SGordon Ross  * and limitations under the License.
12*12b65585SGordon Ross  *
13*12b65585SGordon Ross  * When distributing Covered Code, include this CDDL HEADER in each
14*12b65585SGordon Ross  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*12b65585SGordon Ross  * If applicable, add the following below this CDDL HEADER, with the
16*12b65585SGordon Ross  * fields enclosed by brackets "[]" replaced with your own identifying
17*12b65585SGordon Ross  * information: Portions Copyright [yyyy] [name of copyright owner]
18*12b65585SGordon Ross  *
19*12b65585SGordon Ross  * CDDL HEADER END
20*12b65585SGordon Ross  */
21*12b65585SGordon Ross 
22*12b65585SGordon Ross /*
23*12b65585SGordon Ross  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24*12b65585SGordon Ross  * Use is subject to license terms.
25*12b65585SGordon Ross  *
26*12b65585SGordon Ross  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
27*12b65585SGordon Ross  */
28*12b65585SGordon Ross 
29*12b65585SGordon Ross #ifndef _NTLMSSP_H
30*12b65585SGordon Ross #define	_NTLMSSP_H
31*12b65585SGordon Ross 
32*12b65585SGordon Ross /*
33*12b65585SGordon Ross  * NT LanMan Security Support Package (NTLMSSP)
34*12b65585SGordon Ross  * Negotiation flags, etc.
35*12b65585SGordon Ross  *
36*12b65585SGordon Ross  * Reference: [MS-NLMP] NT LAN Manager (NTLM)
37*12b65585SGordon Ross  *   Authentication Protocol Specification
38*12b65585SGordon Ross  * http://msdn.microsoft.com/en-us/library/cc236621(PROT.10).aspx
39*12b65585SGordon Ross  */
40*12b65585SGordon Ross 
41*12b65585SGordon Ross #ifdef __cplusplus
42*12b65585SGordon Ross extern "C" {
43*12b65585SGordon Ross #endif
44*12b65585SGordon Ross 
45*12b65585SGordon Ross /*
46*12b65585SGordon Ross  * NTLMSSP Message Types
47*12b65585SGordon Ross  * [MS-NLMP] sec. 2.2.1
48*12b65585SGordon Ross  */
49*12b65585SGordon Ross #define	NTLMSSP_MSGTYPE_NEGOTIATE	1
50*12b65585SGordon Ross #define	NTLMSSP_MSGTYPE_CHALLENGE	2
51*12b65585SGordon Ross #define	NTLMSSP_MSGTYPE_AUTHENTICATE	3
52*12b65585SGordon Ross 
53*12b65585SGordon Ross /*
54*12b65585SGordon Ross  * NTLMSSP Negotiate Flags
55*12b65585SGordon Ross  * [MS-NLMP] sec. 2.2.2.5
56*12b65585SGordon Ross  */
57*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_UNICODE			0x00000001
58*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_OEM				0x00000002
59*12b65585SGordon Ross #define	NTLMSSP_REQUEST_TARGET				0x00000004
60*12b65585SGordon Ross /*	reserved 					0x00000008 */
61*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_SIGN				0x00000010
62*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_SEAL				0x00000020
63*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_DATAGRAM			0x00000040
64*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_LM_KEY			0x00000080
65*12b65585SGordon Ross /*	reserved (netware)				0x00000100 */
66*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_NTLM				0x00000200
67*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_NT_ONLY			0x00000400
68*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_NULL_SESSION			0x00000800
69*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED		0x00001000
70*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED	0x00002000
71*12b65585SGordon Ross /*	reserved (local caller)				0x00004000 */
72*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_ALWAYS_SIGN			0x00008000
73*12b65585SGordon Ross #define	NTLMSSP_TARGET_TYPE_DOMAIN			0x00010000
74*12b65585SGordon Ross #define	NTLMSSP_TARGET_TYPE_SERVER			0x00020000
75*12b65585SGordon Ross #define	NTLMSSP_TARGET_TYPE_SHARE			0x00040000
76*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY	0x00080000
77*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_IDENTIFY			0x00100000
78*12b65585SGordon Ross /*	reserved					0x00200000 */
79*12b65585SGordon Ross #define	NTLMSSP_REQUEST_NON_NT_SESSION_KEY		0x00400000
80*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_TARGET_INFO			0x00800000
81*12b65585SGordon Ross /*	reserved					0x01000000 */
82*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_VERSION			0x02000000
83*12b65585SGordon Ross /*	reserved					0x04000000 */
84*12b65585SGordon Ross /*	reserved					0x08000000 */
85*12b65585SGordon Ross /*	reserved					0x10000000 */
86*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_128				0x20000000
87*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_KEY_EXCH			0x40000000
88*12b65585SGordon Ross #define	NTLMSSP_NEGOTIATE_56				0x80000000
89*12b65585SGordon Ross 
90*12b65585SGordon Ross /*
91*12b65585SGordon Ross  * NTLMSSP AV_PAIR types
92*12b65585SGordon Ross  * [MS-NLMP] sec. 2.2.2.1
93*12b65585SGordon Ross  *
94*12b65585SGordon Ross  * The names are all LE-Unicode.
95*12b65585SGordon Ross  */
96*12b65585SGordon Ross typedef enum ntlmssp_AvId {
97*12b65585SGordon Ross 	MsvAvEOL = 0,		/* End Of List */
98*12b65585SGordon Ross 	MsvAvNbComputerName,	/* server's NetBIOS name */
99*12b65585SGordon Ross 	MsvAvNbDomainName,	/* server's NetBIOS domain */
100*12b65585SGordon Ross 	MsvAvDnsComputerName,	/* server's DNS name */
101*12b65585SGordon Ross 	MsvAvDnsDomainName,	/* server's DNS domain */
102*12b65585SGordon Ross 	MsvAvDnsTreeName,	/* server's Forest name */
103*12b65585SGordon Ross 	MsvAvFlags,		/* 32-bit (LE) flags */
104*12b65585SGordon Ross 	MsvAvTimestamp,		/* 64-bit time, [MS-DTYP] sec. 2.3.1 */
105*12b65585SGordon Ross 	MsvAvRestrictions,	/* struct, [MS-NLMP] sec. 2.2.2.2 */
106*12b65585SGordon Ross 	MsvAvTargetName,	/* SPN of the server */
107*12b65585SGordon Ross 	MsvChannelBindings,	/* MD5 hash of GSS challen bindings */
108*12b65585SGordon Ross } ntlmssp_AvId_t;
109*12b65585SGordon Ross 
110*12b65585SGordon Ross #ifdef __cplusplus
111*12b65585SGordon Ross }
112*12b65585SGordon Ross #endif
113*12b65585SGordon Ross 
114*12b65585SGordon Ross #endif /* _NTLMSSP_H */
115