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