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 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
26 */
27
28 #ifndef _NTLM_H
29 #define _NTLM_H
30
31 /*
32 * NTLM support functions
33 * See ntlm.c
34 */
35
36 /*
37 * Size of all LM/NTLM hashes, challenge
38 * NTLM_HASH_SZ: 16 bytes (see smb_lib.h)
39 * NTLM_CHAL_SZ: 8 bytes (see smb_lib.h)
40 */
41 #define NTLM_V1_RESP_SZ 24 /* response size */
42
43 #define NAMETYPE_EOL 0x0000 /* end of list of names */
44 #define NAMETYPE_MACHINE_NB 0x0001 /* NetBIOS machine name */
45 #define NAMETYPE_DOMAIN_NB 0x0002 /* NetBIOS domain name */
46 #define NAMETYPE_MACHINE_DNS 0x0003 /* DNS machine name */
47 #define NAMETYPE_DOMAIN_DNS 0x0004 /* DNS (AD) domain name */
48
49 int
50 ntlm_compute_lm_hash(uchar_t *hash, const char *pw);
51
52 int
53 ntlm_compute_nt_hash(uchar_t *hash, const char *pw);
54
55 int
56 ntlm_build_target_info(struct smb_ctx *, struct mbuf *, struct mbdata *);
57
58 int
59 ntlm_put_v1_responses(struct smb_ctx *ctx,
60 struct mbdata *lm_mbp, struct mbdata *nt_mbp);
61
62 int
63 ntlm_put_v1x_responses(struct smb_ctx *ctx,
64 struct mbdata *lm_mbp, struct mbdata *nt_mbp);
65
66 int
67 ntlm_put_v2_responses(struct smb_ctx *ctx, struct mbdata *ti_mbp,
68 struct mbdata *lm_mbp, struct mbdata *nt_mbp);
69
70 int
71 ntlm_build_mac_key(struct smb_ctx *ctx, struct mbdata *ntresp_mbp);
72
73 void
74 ntlm2_kxkey(struct smb_ctx *ctx, struct mbdata *lm_mbp, uchar_t *kxkey);
75
76 #endif /* _NTLM_H */
|
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 * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
27 */
28
29 #ifndef _NTLM_H
30 #define _NTLM_H
31
32 /*
33 * NTLM support functions
34 * See ntlm.c
35 */
36
37 /*
38 * Size of all LM/NTLM hashes, challenge
39 * NTLM_HASH_SZ: 16 bytes (see smb_lib.h)
40 * NTLM_CHAL_SZ: 8 bytes (see smb_lib.h)
41 */
42 #define NTLM_V1_RESP_SZ 24 /* response size */
43
44 #define NAMETYPE_EOL 0x0000 /* end of list of names */
45 #define NAMETYPE_MACHINE_NB 0x0001 /* NetBIOS machine name */
46 #define NAMETYPE_DOMAIN_NB 0x0002 /* NetBIOS domain name */
47 #define NAMETYPE_MACHINE_DNS 0x0003 /* DNS machine name */
48 #define NAMETYPE_DOMAIN_DNS 0x0004 /* DNS (AD) domain name */
49
50 int
51 ntlm_compute_lm_hash(uchar_t *hash, const char *pw);
52
53 int
54 ntlm_compute_nt_hash(uchar_t *hash, const char *pw);
55
56 int
57 ntlm_build_target_info(struct smb_ctx *, struct mbuf *, struct mbdata *);
58
59 int
60 ntlm_put_v1_responses(struct smb_ctx *ctx,
61 struct mbdata *lm_mbp, struct mbdata *nt_mbp,
62 uchar_t *ssnkey);
63
64 int
65 ntlm_put_v1x_responses(struct smb_ctx *ctx,
66 struct mbdata *lm_mbp, struct mbdata *nt_mbp,
67 uchar_t *ssnkey);
68
69 int
70 ntlm_put_v2_responses(struct smb_ctx *ctx, struct mbdata *ti_mbp,
71 struct mbdata *lm_mbp, struct mbdata *nt_mbp,
72 uchar_t *ssnkey);
73
74 void
75 ntlm2_kxkey(struct smb_ctx *ctx, struct mbdata *lm_mbp,
76 uchar_t *ssn_key, uchar_t *kxkey);
77
78 #endif /* _NTLM_H */
|