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 messaging_context
;
30 struct dcerpc_binding_handle
;
33 NTSTATUS
netlogon_creds_cli_set_global_db(struct db_context
**db
);
34 NTSTATUS
netlogon_creds_cli_open_global_db(struct loadparm_context
*lp_ctx
);
35 void netlogon_creds_cli_close_global_db(void);
37 NTSTATUS
netlogon_creds_cli_context_global(struct loadparm_context
*lp_ctx
,
38 struct messaging_context
*msg_ctx
,
39 const char *client_account
,
40 enum netr_SchannelType type
,
41 const char *server_computer
,
42 const char *server_netbios_domain
,
44 struct netlogon_creds_cli_context
**_context
);
45 NTSTATUS
netlogon_creds_cli_context_tmp(const char *client_computer
,
46 const char *client_account
,
47 enum netr_SchannelType type
,
48 uint32_t proposed_flags
,
49 uint32_t required_flags
,
50 enum dcerpc_AuthLevel auth_level
,
51 const char *server_computer
,
52 const char *server_netbios_domain
,
54 struct netlogon_creds_cli_context
**_context
);
56 char *netlogon_creds_cli_debug_string(
57 const struct netlogon_creds_cli_context
*context
,
60 enum dcerpc_AuthLevel
netlogon_creds_cli_auth_level(
61 struct netlogon_creds_cli_context
*context
);
63 NTSTATUS
netlogon_creds_cli_get(struct netlogon_creds_cli_context
*context
,
65 struct netlogon_creds_CredentialState
**_creds
);
66 bool netlogon_creds_cli_validate(struct netlogon_creds_cli_context
*context
,
67 const struct netlogon_creds_CredentialState
*creds1
);
69 NTSTATUS
netlogon_creds_cli_store(struct netlogon_creds_cli_context
*context
,
70 struct netlogon_creds_CredentialState
**_creds
);
71 NTSTATUS
netlogon_creds_cli_delete(struct netlogon_creds_cli_context
*context
,
72 struct netlogon_creds_CredentialState
**_creds
);
74 struct tevent_req
*netlogon_creds_cli_lock_send(TALLOC_CTX
*mem_ctx
,
75 struct tevent_context
*ev
,
76 struct netlogon_creds_cli_context
*context
);
77 NTSTATUS
netlogon_creds_cli_lock_recv(struct tevent_req
*req
,
79 struct netlogon_creds_CredentialState
**creds
);
80 NTSTATUS
netlogon_creds_cli_lock(struct netlogon_creds_cli_context
*context
,
82 struct netlogon_creds_CredentialState
**creds
);
84 struct tevent_req
*netlogon_creds_cli_auth_send(TALLOC_CTX
*mem_ctx
,
85 struct tevent_context
*ev
,
86 struct netlogon_creds_cli_context
*context
,
87 struct dcerpc_binding_handle
*b
,
88 uint8_t num_nt_hashes
,
89 const struct samr_Password
* const *nt_hashes
);
90 NTSTATUS
netlogon_creds_cli_auth_recv(struct tevent_req
*req
,
91 uint8_t *idx_nt_hashes
);
92 NTSTATUS
netlogon_creds_cli_auth(struct netlogon_creds_cli_context
*context
,
93 struct dcerpc_binding_handle
*b
,
94 uint8_t num_nt_hashes
,
95 const struct samr_Password
* const *nt_hashes
,
96 uint8_t *idx_nt_hashes
);
98 struct tevent_req
*netlogon_creds_cli_check_send(TALLOC_CTX
*mem_ctx
,
99 struct tevent_context
*ev
,
100 struct netlogon_creds_cli_context
*context
,
101 struct dcerpc_binding_handle
*b
);
102 NTSTATUS
netlogon_creds_cli_check_recv(struct tevent_req
*req
);
103 NTSTATUS
netlogon_creds_cli_check(struct netlogon_creds_cli_context
*context
,
104 struct dcerpc_binding_handle
*b
);
106 struct tevent_req
*netlogon_creds_cli_ServerPasswordSet_send(TALLOC_CTX
*mem_ctx
,
107 struct tevent_context
*ev
,
108 struct netlogon_creds_cli_context
*context
,
109 struct dcerpc_binding_handle
*b
,
110 const DATA_BLOB
*new_password
,
111 const uint32_t *new_version
);
112 NTSTATUS
netlogon_creds_cli_ServerPasswordSet_recv(struct tevent_req
*req
);
113 NTSTATUS
netlogon_creds_cli_ServerPasswordSet(
114 struct netlogon_creds_cli_context
*context
,
115 struct dcerpc_binding_handle
*b
,
116 const DATA_BLOB
*new_password
,
117 const uint32_t *new_version
);
119 struct tevent_req
*netlogon_creds_cli_LogonSamLogon_send(TALLOC_CTX
*mem_ctx
,
120 struct tevent_context
*ev
,
121 struct netlogon_creds_cli_context
*context
,
122 struct dcerpc_binding_handle
*b
,
123 enum netr_LogonInfoClass logon_level
,
124 const union netr_LogonLevel
*logon
,
126 NTSTATUS
netlogon_creds_cli_LogonSamLogon_recv(struct tevent_req
*req
,
128 uint16_t *validation_level
,
129 union netr_Validation
**validation
,
130 uint8_t *authoritative
,
132 NTSTATUS
netlogon_creds_cli_LogonSamLogon(
133 struct netlogon_creds_cli_context
*context
,
134 struct dcerpc_binding_handle
*b
,
135 enum netr_LogonInfoClass logon_level
,
136 const union netr_LogonLevel
*logon
,
138 uint16_t *validation_level
,
139 union netr_Validation
**validation
,
140 uint8_t *authoritative
,
142 struct tevent_req
*netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords_send(TALLOC_CTX
*mem_ctx
,
143 struct tevent_context
*ev
,
144 struct netlogon_creds_cli_context
*context
,
145 struct dcerpc_binding_handle
*b
,
146 const char *site_name
,
148 struct NL_DNS_NAME_INFO_ARRAY
*dns_names
);
149 NTSTATUS
netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords_recv(struct tevent_req
*req
);
150 NTSTATUS
netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords(
151 struct netlogon_creds_cli_context
*context
,
152 struct dcerpc_binding_handle
*b
,
153 const char *site_name
,
155 struct NL_DNS_NAME_INFO_ARRAY
*dns_names
);
157 struct tevent_req
*netlogon_creds_cli_ServerGetTrustInfo_send(TALLOC_CTX
*mem_ctx
,
158 struct tevent_context
*ev
,
159 struct netlogon_creds_cli_context
*context
,
160 struct dcerpc_binding_handle
*b
);
161 NTSTATUS
netlogon_creds_cli_ServerGetTrustInfo_recv(struct tevent_req
*req
,
163 struct samr_Password
*new_owf_password
,
164 struct samr_Password
*old_owf_password
,
165 struct netr_TrustInfo
**trust_info
);
166 NTSTATUS
netlogon_creds_cli_ServerGetTrustInfo(
167 struct netlogon_creds_cli_context
*context
,
168 struct dcerpc_binding_handle
*b
,
170 struct samr_Password
*new_owf_password
,
171 struct samr_Password
*old_owf_password
,
172 struct netr_TrustInfo
**trust_info
);
174 struct tevent_req
*netlogon_creds_cli_GetForestTrustInformation_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_GetForestTrustInformation_recv(struct tevent_req
*req
,
180 struct lsa_ForestTrustInformation
**forest_trust_info
);
181 NTSTATUS
netlogon_creds_cli_GetForestTrustInformation(
182 struct netlogon_creds_cli_context
*context
,
183 struct dcerpc_binding_handle
*b
,
185 struct lsa_ForestTrustInformation
**forest_trust_info
);
187 struct tevent_req
*netlogon_creds_cli_SendToSam_send(TALLOC_CTX
*mem_ctx
,
188 struct tevent_context
*ev
,
189 struct netlogon_creds_cli_context
*context
,
190 struct dcerpc_binding_handle
*b
,
191 struct netr_SendToSamBase
*message
);
193 NTSTATUS
netlogon_creds_cli_SendToSam(
194 struct netlogon_creds_cli_context
*context
,
195 struct dcerpc_binding_handle
*b
,
196 struct netr_SendToSamBase
*message
);
198 #endif /* NETLOGON_CREDS_CLI_H */