xref: /titanic_51/usr/src/lib/libsmbfs/smb/ntlm.h (revision 613a2f6ba31e891e3d947a356daf5e563d43c1ce)
1*613a2f6bSGordon Ross /*
2*613a2f6bSGordon Ross  * CDDL HEADER START
3*613a2f6bSGordon Ross  *
4*613a2f6bSGordon Ross  * The contents of this file are subject to the terms of the
5*613a2f6bSGordon Ross  * Common Development and Distribution License (the "License").
6*613a2f6bSGordon Ross  * You may not use this file except in compliance with the License.
7*613a2f6bSGordon Ross  *
8*613a2f6bSGordon Ross  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*613a2f6bSGordon Ross  * or http://www.opensolaris.org/os/licensing.
10*613a2f6bSGordon Ross  * See the License for the specific language governing permissions
11*613a2f6bSGordon Ross  * and limitations under the License.
12*613a2f6bSGordon Ross  *
13*613a2f6bSGordon Ross  * When distributing Covered Code, include this CDDL HEADER in each
14*613a2f6bSGordon Ross  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*613a2f6bSGordon Ross  * If applicable, add the following below this CDDL HEADER, with the
16*613a2f6bSGordon Ross  * fields enclosed by brackets "[]" replaced with your own identifying
17*613a2f6bSGordon Ross  * information: Portions Copyright [yyyy] [name of copyright owner]
18*613a2f6bSGordon Ross  *
19*613a2f6bSGordon Ross  * CDDL HEADER END
20*613a2f6bSGordon Ross  */
21*613a2f6bSGordon Ross 
22*613a2f6bSGordon Ross /*
23*613a2f6bSGordon Ross  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24*613a2f6bSGordon Ross  * Use is subject to license terms.
25*613a2f6bSGordon Ross  */
26*613a2f6bSGordon Ross 
27*613a2f6bSGordon Ross #ifndef _NTLM_H
28*613a2f6bSGordon Ross #define	_NTLM_H
29*613a2f6bSGordon Ross 
30*613a2f6bSGordon Ross /*
31*613a2f6bSGordon Ross  * NTLM support functions
32*613a2f6bSGordon Ross  * See ntlm.c
33*613a2f6bSGordon Ross  */
34*613a2f6bSGordon Ross 
35*613a2f6bSGordon Ross /*
36*613a2f6bSGordon Ross  * Size of all LM/NTLM hashes, challenge
37*613a2f6bSGordon Ross  * NTLM_HASH_SZ: 16 bytes (see smb_lib.h)
38*613a2f6bSGordon Ross  * NTLM_CHAL_SZ:  8 bytes (see smb_lib.h)
39*613a2f6bSGordon Ross  */
40*613a2f6bSGordon Ross #define	NTLM_V1_RESP_SZ 	24	/* response size */
41*613a2f6bSGordon Ross 
42*613a2f6bSGordon Ross #define	NAMETYPE_EOL		0x0000	/* end of list of names */
43*613a2f6bSGordon Ross #define	NAMETYPE_MACHINE_NB	0x0001	/* NetBIOS machine name */
44*613a2f6bSGordon Ross #define	NAMETYPE_DOMAIN_NB	0x0002	/* NetBIOS domain name */
45*613a2f6bSGordon Ross #define	NAMETYPE_MACHINE_DNS	0x0003	/* DNS machine name */
46*613a2f6bSGordon Ross #define	NAMETYPE_DOMAIN_DNS	0x0004	/* DNS (AD) domain name */
47*613a2f6bSGordon Ross 
48*613a2f6bSGordon Ross int
49*613a2f6bSGordon Ross ntlm_compute_lm_hash(uchar_t *hash, const char *pw);
50*613a2f6bSGordon Ross 
51*613a2f6bSGordon Ross int
52*613a2f6bSGordon Ross ntlm_compute_nt_hash(uchar_t *hash, const char *pw);
53*613a2f6bSGordon Ross 
54*613a2f6bSGordon Ross int
55*613a2f6bSGordon Ross ntlm_build_target_info(struct smb_ctx *, struct mbuf *, struct mbdata *);
56*613a2f6bSGordon Ross 
57*613a2f6bSGordon Ross int
58*613a2f6bSGordon Ross ntlm_put_v1_responses(struct smb_ctx *ctx,
59*613a2f6bSGordon Ross 	struct mbdata *lm_mbp, struct mbdata *nt_mbp);
60*613a2f6bSGordon Ross 
61*613a2f6bSGordon Ross int
62*613a2f6bSGordon Ross ntlm_put_v2_responses(struct smb_ctx *ctx, struct mbdata *ti_mbp,
63*613a2f6bSGordon Ross 	struct mbdata *lm_mbp, struct mbdata *nt_mbp);
64*613a2f6bSGordon Ross 
65*613a2f6bSGordon Ross #endif /* _NTLM_H */
66