2 Unix SMB/CIFS implementation.
4 module to store/fetch session keys for the schannel client
6 Copyright (C) Stefan Metzmacher 2013
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/>.
22 #ifndef NETLOGON_CREDS_CLI_H
23 #define NETLOGON_CREDS_CLI_H
25 struct netlogon_creds_cli_context;
27 NTSTATUS netlogon_creds_cli_context_global(struct loadparm_context *lp_ctx,
28 const char *client_account,
29 enum netr_SchannelType type,
30 const char *server_computer,
31 const char *server_netbios_domain,
33 struct netlogon_creds_cli_context **_context);
34 NTSTATUS netlogon_creds_cli_context_tmp(const char *client_account,
35 const char *client_computer,
36 enum netr_SchannelType type,
37 uint32_t proposed_flags,
38 uint32_t required_flags,
39 const char *server_computer,
40 const char *server_netbios_domain,
42 struct netlogon_creds_cli_context **_context);
44 NTSTATUS netlogon_creds_cli_get(struct netlogon_creds_cli_context *context,
46 struct netlogon_creds_CredentialState **_creds);
47 bool netlogon_creds_cli_validate(struct netlogon_creds_cli_context *context,
48 const struct netlogon_creds_CredentialState *creds1);
50 NTSTATUS netlogon_creds_cli_store(struct netlogon_creds_cli_context *context,
51 struct netlogon_creds_CredentialState **_creds);
52 NTSTATUS netlogon_creds_cli_delete(struct netlogon_creds_cli_context *context,
53 struct netlogon_creds_CredentialState **_creds);
55 struct tevent_req *netlogon_creds_cli_lock_send(TALLOC_CTX *mem_ctx,
56 struct tevent_context *ev,
57 struct netlogon_creds_cli_context *context);
58 NTSTATUS netlogon_creds_cli_lock_recv(struct tevent_req *req,
60 struct netlogon_creds_CredentialState **creds);
61 NTSTATUS netlogon_creds_cli_lock(struct netlogon_creds_cli_context *context,
63 struct netlogon_creds_CredentialState **creds);
65 struct tevent_req *netlogon_creds_cli_auth_send(TALLOC_CTX *mem_ctx,
66 struct tevent_context *ev,
67 struct netlogon_creds_cli_context *context,
68 struct dcerpc_binding_handle *b,
69 struct samr_Password current_nt_hash,
70 const struct samr_Password *previous_nt_hash);
71 NTSTATUS netlogon_creds_cli_auth_recv(struct tevent_req *req);
72 NTSTATUS netlogon_creds_cli_auth(struct netlogon_creds_cli_context *context,
73 struct dcerpc_binding_handle *b,
74 struct samr_Password current_nt_hash,
75 const struct samr_Password *previous_nt_hash);
77 struct tevent_req *netlogon_creds_cli_check_send(TALLOC_CTX *mem_ctx,
78 struct tevent_context *ev,
79 struct netlogon_creds_cli_context *context,
80 struct dcerpc_binding_handle *b);
81 NTSTATUS netlogon_creds_cli_check_recv(struct tevent_req *req);
82 NTSTATUS netlogon_creds_cli_check(struct netlogon_creds_cli_context *context,
83 struct dcerpc_binding_handle *b);
85 struct tevent_req *netlogon_creds_cli_ServerPasswordSet_send(TALLOC_CTX *mem_ctx,
86 struct tevent_context *ev,
87 struct netlogon_creds_cli_context *context,
88 struct dcerpc_binding_handle *b,
89 const char *new_password);
90 NTSTATUS netlogon_creds_cli_ServerPasswordSet_recv(struct tevent_req *req);
91 NTSTATUS netlogon_creds_cli_ServerPasswordSet(
92 struct netlogon_creds_cli_context *context,
93 struct dcerpc_binding_handle *b,
94 const char *new_password);
96 struct tevent_req *netlogon_creds_cli_LogonSamLogon_send(TALLOC_CTX *mem_ctx,
97 struct tevent_context *ev,
98 struct netlogon_creds_cli_context *context,
99 struct dcerpc_binding_handle *b,
100 enum netr_LogonInfoClass logon_level,
101 const union netr_LogonLevel *logon,
103 NTSTATUS netlogon_creds_cli_LogonSamLogon_recv(struct tevent_req *req,
105 uint16_t *validation_level,
106 union netr_Validation **validation,
107 uint8_t *authoritative,
109 NTSTATUS netlogon_creds_cli_LogonSamLogon(
110 struct netlogon_creds_cli_context *context,
111 struct dcerpc_binding_handle *b,
112 enum netr_LogonInfoClass logon_level,
113 const union netr_LogonLevel *logon,
115 uint16_t *validation_level,
116 union netr_Validation **validation,
117 uint8_t *authoritative,
120 #endif /* NETLOGON_CREDS_CLI_H */