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 #include "librpc/gen_ndr/dcerpc.h"
26 #include "librpc/gen_ndr/schannel.h"
28 struct netlogon_creds_cli_context
;
29 struct cli_credentials
;
30 struct messaging_context
;
31 struct dcerpc_binding_handle
;
34 NTSTATUS
netlogon_creds_cli_set_global_db(struct loadparm_context
*lp_ctx
, struct db_context
**db
);
35 NTSTATUS
netlogon_creds_cli_open_global_db(struct loadparm_context
*lp_ctx
);
36 void netlogon_creds_cli_close_global_db(void);
38 void netlogon_creds_cli_warn_options(struct loadparm_context
*lp_ctx
);
40 NTSTATUS
netlogon_creds_cli_context_global(struct loadparm_context
*lp_ctx
,
41 struct messaging_context
*msg_ctx
,
42 const char *client_account
,
43 enum netr_SchannelType type
,
44 const char *server_computer
,
45 const char *server_netbios_domain
,
46 const char *server_dns_domain
,
48 struct netlogon_creds_cli_context
**_context
);
49 NTSTATUS
netlogon_creds_bind_cli_credentials(
50 struct netlogon_creds_cli_context
*context
, TALLOC_CTX
*mem_ctx
,
51 struct cli_credentials
**pcli_creds
);
53 char *netlogon_creds_cli_debug_string(
54 const struct netlogon_creds_cli_context
*context
,
57 enum dcerpc_AuthLevel
netlogon_creds_cli_auth_level(
58 struct netlogon_creds_cli_context
*context
);
60 NTSTATUS
netlogon_creds_cli_get(struct netlogon_creds_cli_context
*context
,
62 struct netlogon_creds_CredentialState
**_creds
);
63 bool netlogon_creds_cli_validate(struct netlogon_creds_cli_context
*context
,
64 const struct netlogon_creds_CredentialState
*creds1
);
66 NTSTATUS
netlogon_creds_cli_store(struct netlogon_creds_cli_context
*context
,
67 struct netlogon_creds_CredentialState
*creds
);
68 NTSTATUS
netlogon_creds_cli_delete(struct netlogon_creds_cli_context
*context
,
69 struct netlogon_creds_CredentialState
*creds
);
70 NTSTATUS
netlogon_creds_cli_delete_lck(
71 struct netlogon_creds_cli_context
*context
);
73 struct tevent_req
*netlogon_creds_cli_lock_send(TALLOC_CTX
*mem_ctx
,
74 struct tevent_context
*ev
,
75 struct netlogon_creds_cli_context
*context
);
76 NTSTATUS
netlogon_creds_cli_lock_recv(struct tevent_req
*req
,
78 struct netlogon_creds_CredentialState
**creds
);
79 NTSTATUS
netlogon_creds_cli_lock(struct netlogon_creds_cli_context
*context
,
81 struct netlogon_creds_CredentialState
**creds
);
83 struct netlogon_creds_cli_lck
;
85 enum netlogon_creds_cli_lck_type
{
86 NETLOGON_CREDS_CLI_LCK_NONE
,
87 NETLOGON_CREDS_CLI_LCK_SHARED
,
88 NETLOGON_CREDS_CLI_LCK_EXCLUSIVE
,
91 struct tevent_req
*netlogon_creds_cli_lck_send(
92 TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
93 struct netlogon_creds_cli_context
*context
,
94 enum netlogon_creds_cli_lck_type type
);
95 NTSTATUS
netlogon_creds_cli_lck_recv(
96 struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
97 struct netlogon_creds_cli_lck
**lck
);
98 NTSTATUS
netlogon_creds_cli_lck(
99 struct netlogon_creds_cli_context
*context
,
100 enum netlogon_creds_cli_lck_type type
,
101 TALLOC_CTX
*mem_ctx
, struct netlogon_creds_cli_lck
**lck
);
103 struct tevent_req
*netlogon_creds_cli_auth_send(TALLOC_CTX
*mem_ctx
,
104 struct tevent_context
*ev
,
105 struct netlogon_creds_cli_context
*context
,
106 struct dcerpc_binding_handle
*b
,
107 uint8_t num_nt_hashes
,
108 const struct samr_Password
* const *nt_hashes
);
109 NTSTATUS
netlogon_creds_cli_auth_recv(struct tevent_req
*req
,
110 uint8_t *idx_nt_hashes
);
111 NTSTATUS
netlogon_creds_cli_auth(struct netlogon_creds_cli_context
*context
,
112 struct dcerpc_binding_handle
*b
,
113 uint8_t num_nt_hashes
,
114 const struct samr_Password
* const *nt_hashes
,
115 uint8_t *idx_nt_hashes
);
117 struct tevent_req
*netlogon_creds_cli_check_send(TALLOC_CTX
*mem_ctx
,
118 struct tevent_context
*ev
,
119 struct netlogon_creds_cli_context
*context
,
120 struct dcerpc_binding_handle
*b
);
121 NTSTATUS
netlogon_creds_cli_check_recv(struct tevent_req
*req
,
122 union netr_Capabilities
*capabilities
);
123 NTSTATUS
netlogon_creds_cli_check(struct netlogon_creds_cli_context
*context
,
124 struct dcerpc_binding_handle
*b
,
125 union netr_Capabilities
*capabilities
);
127 struct tevent_req
*netlogon_creds_cli_ServerPasswordSet_send(TALLOC_CTX
*mem_ctx
,
128 struct tevent_context
*ev
,
129 struct netlogon_creds_cli_context
*context
,
130 struct dcerpc_binding_handle
*b
,
131 const DATA_BLOB
*new_password
,
132 const uint32_t *new_version
);
133 NTSTATUS
netlogon_creds_cli_ServerPasswordSet_recv(struct tevent_req
*req
);
134 NTSTATUS
netlogon_creds_cli_ServerPasswordSet(
135 struct netlogon_creds_cli_context
*context
,
136 struct dcerpc_binding_handle
*b
,
137 const DATA_BLOB
*new_password
,
138 const uint32_t *new_version
);
140 struct tevent_req
*netlogon_creds_cli_LogonSamLogon_send(TALLOC_CTX
*mem_ctx
,
141 struct tevent_context
*ev
,
142 struct netlogon_creds_cli_context
*context
,
143 struct dcerpc_binding_handle
*b
,
144 enum netr_LogonInfoClass logon_level
,
145 const union netr_LogonLevel
*logon
,
147 NTSTATUS
netlogon_creds_cli_LogonSamLogon_recv(struct tevent_req
*req
,
149 uint16_t *validation_level
,
150 union netr_Validation
**validation
,
151 uint8_t *authoritative
,
153 NTSTATUS
netlogon_creds_cli_LogonSamLogon(
154 struct netlogon_creds_cli_context
*context
,
155 struct dcerpc_binding_handle
*b
,
156 enum netr_LogonInfoClass logon_level
,
157 const union netr_LogonLevel
*logon
,
159 uint16_t *validation_level
,
160 union netr_Validation
**validation
,
161 uint8_t *authoritative
,
163 struct tevent_req
*netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords_send(TALLOC_CTX
*mem_ctx
,
164 struct tevent_context
*ev
,
165 struct netlogon_creds_cli_context
*context
,
166 struct dcerpc_binding_handle
*b
,
167 const char *site_name
,
169 struct NL_DNS_NAME_INFO_ARRAY
*dns_names
);
170 NTSTATUS
netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords_recv(struct tevent_req
*req
);
171 NTSTATUS
netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords(
172 struct netlogon_creds_cli_context
*context
,
173 struct dcerpc_binding_handle
*b
,
174 const char *site_name
,
176 struct NL_DNS_NAME_INFO_ARRAY
*dns_names
);
178 struct tevent_req
*netlogon_creds_cli_ServerGetTrustInfo_send(TALLOC_CTX
*mem_ctx
,
179 struct tevent_context
*ev
,
180 struct netlogon_creds_cli_context
*context
,
181 struct dcerpc_binding_handle
*b
);
182 NTSTATUS
netlogon_creds_cli_ServerGetTrustInfo_recv(struct tevent_req
*req
,
184 struct samr_Password
*new_owf_password
,
185 struct samr_Password
*old_owf_password
,
186 struct netr_TrustInfo
**trust_info
);
187 NTSTATUS
netlogon_creds_cli_ServerGetTrustInfo(
188 struct netlogon_creds_cli_context
*context
,
189 struct dcerpc_binding_handle
*b
,
191 struct samr_Password
*new_owf_password
,
192 struct samr_Password
*old_owf_password
,
193 struct netr_TrustInfo
**trust_info
);
195 struct tevent_req
*netlogon_creds_cli_GetForestTrustInformation_send(TALLOC_CTX
*mem_ctx
,
196 struct tevent_context
*ev
,
197 struct netlogon_creds_cli_context
*context
,
198 struct dcerpc_binding_handle
*b
);
199 NTSTATUS
netlogon_creds_cli_GetForestTrustInformation_recv(struct tevent_req
*req
,
201 struct lsa_ForestTrustInformation
**forest_trust_info
);
202 NTSTATUS
netlogon_creds_cli_GetForestTrustInformation(
203 struct netlogon_creds_cli_context
*context
,
204 struct dcerpc_binding_handle
*b
,
206 struct lsa_ForestTrustInformation
**forest_trust_info
);
208 struct tevent_req
*netlogon_creds_cli_SendToSam_send(TALLOC_CTX
*mem_ctx
,
209 struct tevent_context
*ev
,
210 struct netlogon_creds_cli_context
*context
,
211 struct dcerpc_binding_handle
*b
,
212 struct netr_SendToSamBase
*message
);
213 NTSTATUS
netlogon_creds_cli_SendToSam_recv(struct tevent_req
*req
);
214 NTSTATUS
netlogon_creds_cli_SendToSam(
215 struct netlogon_creds_cli_context
*context
,
216 struct dcerpc_binding_handle
*b
,
217 struct netr_SendToSamBase
*message
);
219 struct tevent_req
*netlogon_creds_cli_LogonGetDomainInfo_send(TALLOC_CTX
*mem_ctx
,
220 struct tevent_context
*ev
,
221 struct netlogon_creds_cli_context
*context
,
222 struct dcerpc_binding_handle
*b
,
224 union netr_WorkstationInfo
*query
);
225 NTSTATUS
netlogon_creds_cli_LogonGetDomainInfo_recv(struct tevent_req
*req
,
227 union netr_DomainInfo
**info
);
228 NTSTATUS
netlogon_creds_cli_LogonGetDomainInfo(
229 struct netlogon_creds_cli_context
*context
,
230 struct dcerpc_binding_handle
*b
,
233 union netr_WorkstationInfo
*query
,
234 union netr_DomainInfo
**info
);
236 #endif /* NETLOGON_CREDS_CLI_H */