lib:util: Remove redundant casts in PUSH_*() macros
[Samba.git] / libcli / auth / ntlm_check.h
blob3fcd1f4ccbbe8373bd8de60ffb9946ee19f9d50c
1 /*
2 Unix SMB/CIFS implementation.
3 Password and authentication handling
4 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2001-2004
5 Copyright (C) Gerald Carter 2003
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 3 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, see <http://www.gnu.org/licenses/>.
21 #ifndef __LIBCLI_AUTH_NTLM_CHECK_H__
22 #define __LIBCLI_AUTH_NTLM_CHECK_H__
24 /* mangled names options */
25 enum ntlm_auth_level {NTLM_AUTH_DISABLED, NTLM_AUTH_ON,
26 NTLM_AUTH_NTLMV2_ONLY,
27 NTLM_AUTH_MSCHAPv2_NTLMV2_ONLY};
29 struct samr_Password;
31 /**
32 * Compare password hashes against those from the SAM
34 * @param mem_ctx talloc context
35 * @param client_lanman LANMAN password hash, as supplied by the client
36 * @param client_nt NT (MD4) password hash, as supplied by the client
37 * @param username internal Samba username, for log messages
38 * @param client_username username the client used
39 * @param client_domain domain name the client used (may be mapped)
40 * @param stored_lanman LANMAN password hash, as stored on the SAM
41 * @param stored_nt NT (MD4) password hash, as stored on the SAM
42 * @param user_sess_key User session key
43 * @param lm_sess_key LM session key (first 8 bytes of the LM hash)
46 NTSTATUS hash_password_check(TALLOC_CTX *mem_ctx,
47 bool lanman_auth,
48 enum ntlm_auth_level ntlm_auth,
49 const struct samr_Password *client_lanman,
50 const struct samr_Password *client_nt,
51 const char *username,
52 const struct samr_Password *stored_lanman,
53 const struct samr_Password *stored_nt);
55 /**
56 * Check a challenge-response password against the value of the NT or
57 * LM password hash.
59 * @param mem_ctx talloc context
60 * @param challenge 8-byte challenge. If all zero, forces plaintext comparison
61 * @param nt_response 'unicode' NT response to the challenge, or unicode password
62 * @param lm_response ASCII or LANMAN response to the challenge, or password in DOS code page
63 * @param username internal Samba username, for log messages
64 * @param client_username username the client used
65 * @param client_domain domain name the client used (may be mapped)
66 * @param stored_lanman LANMAN ASCII password from our passdb or similar
67 * @param stored_nt MD4 unicode password from our passdb or similar
68 * @param user_sess_key User session key
69 * @param lm_sess_key LM session key (first 8 bytes of the LM hash)
72 NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
73 bool lanman_auth,
74 enum ntlm_auth_level ntlm_auth,
75 uint32_t logon_parameters,
76 const DATA_BLOB *challenge,
77 const DATA_BLOB *lm_response,
78 const DATA_BLOB *nt_response,
79 const char *username,
80 const char *client_username,
81 const char *client_domain,
82 const struct samr_Password *stored_lanman,
83 const struct samr_Password *stored_nt,
84 DATA_BLOB *user_sess_key,
85 DATA_BLOB *lm_sess_key);
87 #endif /* __LIBCLI_AUTH_NTLM_CHECK_H__ */