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
;
32 NTSTATUS
netlogon_creds_cli_open_global_db(struct loadparm_context
*lp_ctx
);
34 NTSTATUS
netlogon_creds_cli_context_global(struct loadparm_context
*lp_ctx
,
35 struct messaging_context
*msg_ctx
,
36 const char *client_account
,
37 enum netr_SchannelType type
,
38 const char *server_computer
,
39 const char *server_netbios_domain
,
41 struct netlogon_creds_cli_context
**_context
);
42 NTSTATUS
netlogon_creds_cli_context_tmp(const char *client_computer
,
43 const char *client_account
,
44 enum netr_SchannelType type
,
45 enum dcerpc_AuthLevel auth_level
,
46 uint32_t proposed_flags
,
47 uint32_t required_flags
,
48 const char *server_computer
,
49 const char *server_netbios_domain
,
51 struct netlogon_creds_cli_context
**_context
);
53 enum dcerpc_AuthLevel
netlogon_creds_cli_auth_level(
54 struct netlogon_creds_cli_context
*context
);
56 NTSTATUS
netlogon_creds_cli_get(struct netlogon_creds_cli_context
*context
,
58 struct netlogon_creds_CredentialState
**_creds
);
59 bool netlogon_creds_cli_validate(struct netlogon_creds_cli_context
*context
,
60 const struct netlogon_creds_CredentialState
*creds1
);
62 NTSTATUS
netlogon_creds_cli_store(struct netlogon_creds_cli_context
*context
,
63 struct netlogon_creds_CredentialState
**_creds
);
64 NTSTATUS
netlogon_creds_cli_delete(struct netlogon_creds_cli_context
*context
,
65 struct netlogon_creds_CredentialState
**_creds
);
67 struct tevent_req
*netlogon_creds_cli_lock_send(TALLOC_CTX
*mem_ctx
,
68 struct tevent_context
*ev
,
69 struct netlogon_creds_cli_context
*context
);
70 NTSTATUS
netlogon_creds_cli_lock_recv(struct tevent_req
*req
,
72 struct netlogon_creds_CredentialState
**creds
);
73 NTSTATUS
netlogon_creds_cli_lock(struct netlogon_creds_cli_context
*context
,
75 struct netlogon_creds_CredentialState
**creds
);
77 struct tevent_req
*netlogon_creds_cli_auth_send(TALLOC_CTX
*mem_ctx
,
78 struct tevent_context
*ev
,
79 struct netlogon_creds_cli_context
*context
,
80 struct dcerpc_binding_handle
*b
,
81 struct samr_Password current_nt_hash
,
82 const struct samr_Password
*previous_nt_hash
);
83 NTSTATUS
netlogon_creds_cli_auth_recv(struct tevent_req
*req
);
84 NTSTATUS
netlogon_creds_cli_auth(struct netlogon_creds_cli_context
*context
,
85 struct dcerpc_binding_handle
*b
,
86 struct samr_Password current_nt_hash
,
87 const struct samr_Password
*previous_nt_hash
);
89 struct tevent_req
*netlogon_creds_cli_check_send(TALLOC_CTX
*mem_ctx
,
90 struct tevent_context
*ev
,
91 struct netlogon_creds_cli_context
*context
,
92 struct dcerpc_binding_handle
*b
);
93 NTSTATUS
netlogon_creds_cli_check_recv(struct tevent_req
*req
);
94 NTSTATUS
netlogon_creds_cli_check(struct netlogon_creds_cli_context
*context
,
95 struct dcerpc_binding_handle
*b
);
97 struct tevent_req
*netlogon_creds_cli_ServerPasswordSet_send(TALLOC_CTX
*mem_ctx
,
98 struct tevent_context
*ev
,
99 struct netlogon_creds_cli_context
*context
,
100 struct dcerpc_binding_handle
*b
,
101 const char *new_password
,
102 const uint32_t *new_version
);
103 NTSTATUS
netlogon_creds_cli_ServerPasswordSet_recv(struct tevent_req
*req
);
104 NTSTATUS
netlogon_creds_cli_ServerPasswordSet(
105 struct netlogon_creds_cli_context
*context
,
106 struct dcerpc_binding_handle
*b
,
107 const char *new_password
,
108 const uint32_t *new_version
);
110 struct tevent_req
*netlogon_creds_cli_LogonSamLogon_send(TALLOC_CTX
*mem_ctx
,
111 struct tevent_context
*ev
,
112 struct netlogon_creds_cli_context
*context
,
113 struct dcerpc_binding_handle
*b
,
114 enum netr_LogonInfoClass logon_level
,
115 const union netr_LogonLevel
*logon
,
117 NTSTATUS
netlogon_creds_cli_LogonSamLogon_recv(struct tevent_req
*req
,
119 uint16_t *validation_level
,
120 union netr_Validation
**validation
,
121 uint8_t *authoritative
,
123 NTSTATUS
netlogon_creds_cli_LogonSamLogon(
124 struct netlogon_creds_cli_context
*context
,
125 struct dcerpc_binding_handle
*b
,
126 enum netr_LogonInfoClass logon_level
,
127 const union netr_LogonLevel
*logon
,
129 uint16_t *validation_level
,
130 union netr_Validation
**validation
,
131 uint8_t *authoritative
,
134 #endif /* NETLOGON_CREDS_CLI_H */