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 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 NTSTATUS
netlogon_creds_cli_context_global(struct loadparm_context
*lp_ctx
,
39 struct messaging_context
*msg_ctx
,
40 const char *client_account
,
41 enum netr_SchannelType type
,
42 const char *server_computer
,
43 const char *server_netbios_domain
,
44 const char *server_dns_domain
,
46 struct netlogon_creds_cli_context
**_context
);
47 NTSTATUS
netlogon_creds_bind_cli_credentials(
48 struct netlogon_creds_cli_context
*context
, TALLOC_CTX
*mem_ctx
,
49 struct cli_credentials
**pcli_creds
);
51 char *netlogon_creds_cli_debug_string(
52 const struct netlogon_creds_cli_context
*context
,
55 enum dcerpc_AuthLevel
netlogon_creds_cli_auth_level(
56 struct netlogon_creds_cli_context
*context
);
58 NTSTATUS
netlogon_creds_cli_get(struct netlogon_creds_cli_context
*context
,
60 struct netlogon_creds_CredentialState
**_creds
);
61 bool netlogon_creds_cli_validate(struct netlogon_creds_cli_context
*context
,
62 const struct netlogon_creds_CredentialState
*creds1
);
64 NTSTATUS
netlogon_creds_cli_store(struct netlogon_creds_cli_context
*context
,
65 struct netlogon_creds_CredentialState
*creds
);
66 NTSTATUS
netlogon_creds_cli_delete(struct netlogon_creds_cli_context
*context
,
67 struct netlogon_creds_CredentialState
*creds
);
68 NTSTATUS
netlogon_creds_cli_delete_lck(
69 struct netlogon_creds_cli_context
*context
);
71 struct tevent_req
*netlogon_creds_cli_lock_send(TALLOC_CTX
*mem_ctx
,
72 struct tevent_context
*ev
,
73 struct netlogon_creds_cli_context
*context
);
74 NTSTATUS
netlogon_creds_cli_lock_recv(struct tevent_req
*req
,
76 struct netlogon_creds_CredentialState
**creds
);
77 NTSTATUS
netlogon_creds_cli_lock(struct netlogon_creds_cli_context
*context
,
79 struct netlogon_creds_CredentialState
**creds
);
81 struct netlogon_creds_cli_lck
;
83 enum netlogon_creds_cli_lck_type
{
84 NETLOGON_CREDS_CLI_LCK_NONE
,
85 NETLOGON_CREDS_CLI_LCK_SHARED
,
86 NETLOGON_CREDS_CLI_LCK_EXCLUSIVE
,
89 struct tevent_req
*netlogon_creds_cli_lck_send(
90 TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
91 struct netlogon_creds_cli_context
*context
,
92 enum netlogon_creds_cli_lck_type type
);
93 NTSTATUS
netlogon_creds_cli_lck_recv(
94 struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
95 struct netlogon_creds_cli_lck
**lck
);
96 NTSTATUS
netlogon_creds_cli_lck(
97 struct netlogon_creds_cli_context
*context
,
98 enum netlogon_creds_cli_lck_type type
,
99 TALLOC_CTX
*mem_ctx
, struct netlogon_creds_cli_lck
**lck
);
101 struct tevent_req
*netlogon_creds_cli_auth_send(TALLOC_CTX
*mem_ctx
,
102 struct tevent_context
*ev
,
103 struct netlogon_creds_cli_context
*context
,
104 struct dcerpc_binding_handle
*b
,
105 uint8_t num_nt_hashes
,
106 const struct samr_Password
* const *nt_hashes
);
107 NTSTATUS
netlogon_creds_cli_auth_recv(struct tevent_req
*req
,
108 uint8_t *idx_nt_hashes
);
109 NTSTATUS
netlogon_creds_cli_auth(struct netlogon_creds_cli_context
*context
,
110 struct dcerpc_binding_handle
*b
,
111 uint8_t num_nt_hashes
,
112 const struct samr_Password
* const *nt_hashes
,
113 uint8_t *idx_nt_hashes
);
115 struct tevent_req
*netlogon_creds_cli_check_send(TALLOC_CTX
*mem_ctx
,
116 struct tevent_context
*ev
,
117 struct netlogon_creds_cli_context
*context
,
118 struct dcerpc_binding_handle
*b
);
119 NTSTATUS
netlogon_creds_cli_check_recv(struct tevent_req
*req
);
120 NTSTATUS
netlogon_creds_cli_check(struct netlogon_creds_cli_context
*context
,
121 struct dcerpc_binding_handle
*b
);
123 struct tevent_req
*netlogon_creds_cli_ServerPasswordSet_send(TALLOC_CTX
*mem_ctx
,
124 struct tevent_context
*ev
,
125 struct netlogon_creds_cli_context
*context
,
126 struct dcerpc_binding_handle
*b
,
127 const DATA_BLOB
*new_password
,
128 const uint32_t *new_version
);
129 NTSTATUS
netlogon_creds_cli_ServerPasswordSet_recv(struct tevent_req
*req
);
130 NTSTATUS
netlogon_creds_cli_ServerPasswordSet(
131 struct netlogon_creds_cli_context
*context
,
132 struct dcerpc_binding_handle
*b
,
133 const DATA_BLOB
*new_password
,
134 const uint32_t *new_version
);
136 struct tevent_req
*netlogon_creds_cli_LogonSamLogon_send(TALLOC_CTX
*mem_ctx
,
137 struct tevent_context
*ev
,
138 struct netlogon_creds_cli_context
*context
,
139 struct dcerpc_binding_handle
*b
,
140 enum netr_LogonInfoClass logon_level
,
141 const union netr_LogonLevel
*logon
,
143 NTSTATUS
netlogon_creds_cli_LogonSamLogon_recv(struct tevent_req
*req
,
145 uint16_t *validation_level
,
146 union netr_Validation
**validation
,
147 uint8_t *authoritative
,
149 NTSTATUS
netlogon_creds_cli_LogonSamLogon(
150 struct netlogon_creds_cli_context
*context
,
151 struct dcerpc_binding_handle
*b
,
152 enum netr_LogonInfoClass logon_level
,
153 const union netr_LogonLevel
*logon
,
155 uint16_t *validation_level
,
156 union netr_Validation
**validation
,
157 uint8_t *authoritative
,
159 struct tevent_req
*netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords_send(TALLOC_CTX
*mem_ctx
,
160 struct tevent_context
*ev
,
161 struct netlogon_creds_cli_context
*context
,
162 struct dcerpc_binding_handle
*b
,
163 const char *site_name
,
165 struct NL_DNS_NAME_INFO_ARRAY
*dns_names
);
166 NTSTATUS
netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords_recv(struct tevent_req
*req
);
167 NTSTATUS
netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords(
168 struct netlogon_creds_cli_context
*context
,
169 struct dcerpc_binding_handle
*b
,
170 const char *site_name
,
172 struct NL_DNS_NAME_INFO_ARRAY
*dns_names
);
174 struct tevent_req
*netlogon_creds_cli_ServerGetTrustInfo_send(TALLOC_CTX
*mem_ctx
,
175 struct tevent_context
*ev
,
176 struct netlogon_creds_cli_context
*context
,
177 struct dcerpc_binding_handle
*b
);
178 NTSTATUS
netlogon_creds_cli_ServerGetTrustInfo_recv(struct tevent_req
*req
,
180 struct samr_Password
*new_owf_password
,
181 struct samr_Password
*old_owf_password
,
182 struct netr_TrustInfo
**trust_info
);
183 NTSTATUS
netlogon_creds_cli_ServerGetTrustInfo(
184 struct netlogon_creds_cli_context
*context
,
185 struct dcerpc_binding_handle
*b
,
187 struct samr_Password
*new_owf_password
,
188 struct samr_Password
*old_owf_password
,
189 struct netr_TrustInfo
**trust_info
);
191 struct tevent_req
*netlogon_creds_cli_GetForestTrustInformation_send(TALLOC_CTX
*mem_ctx
,
192 struct tevent_context
*ev
,
193 struct netlogon_creds_cli_context
*context
,
194 struct dcerpc_binding_handle
*b
);
195 NTSTATUS
netlogon_creds_cli_GetForestTrustInformation_recv(struct tevent_req
*req
,
197 struct lsa_ForestTrustInformation
**forest_trust_info
);
198 NTSTATUS
netlogon_creds_cli_GetForestTrustInformation(
199 struct netlogon_creds_cli_context
*context
,
200 struct dcerpc_binding_handle
*b
,
202 struct lsa_ForestTrustInformation
**forest_trust_info
);
204 struct tevent_req
*netlogon_creds_cli_SendToSam_send(TALLOC_CTX
*mem_ctx
,
205 struct tevent_context
*ev
,
206 struct netlogon_creds_cli_context
*context
,
207 struct dcerpc_binding_handle
*b
,
208 struct netr_SendToSamBase
*message
);
210 NTSTATUS
netlogon_creds_cli_SendToSam(
211 struct netlogon_creds_cli_context
*context
,
212 struct dcerpc_binding_handle
*b
,
213 struct netr_SendToSamBase
*message
);
215 #endif /* NETLOGON_CREDS_CLI_H */