lib/util: consolidate module loading into common code
[Samba/gebeck_regimport.git] / source3 / include / ntlmssp_wrap.h
blobee76e96007ec71245b8e68c34b6b22233b62b210
1 /*
2 NLTMSSP wrappers
4 Copyright (C) Andrew Tridgell 2001
5 Copyright (C) Andrew Bartlett 2001-2003
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef _NTLMSSP_WRAP_
22 #define _NTLMSSP_WRAP_
24 struct gensec_security;
26 struct auth_ntlmssp_state {
27 /* used only by server implementation */
28 struct auth_context *auth_context;
29 struct auth_serversupplied_info *server_info;
30 struct tsocket_address *remote_address;
31 struct gensec_security *gensec_security;
33 /* used by both client and server implementation */
34 struct ntlmssp_state *ntlmssp_state;
37 NTSTATUS auth_ntlmssp_sign_packet(struct auth_ntlmssp_state *ans,
38 TALLOC_CTX *sig_mem_ctx,
39 const uint8_t *data,
40 size_t length,
41 const uint8_t *whole_pdu,
42 size_t pdu_length,
43 DATA_BLOB *sig);
44 NTSTATUS auth_ntlmssp_check_packet(struct auth_ntlmssp_state *ans,
45 const uint8_t *data,
46 size_t length,
47 const uint8_t *whole_pdu,
48 size_t pdu_length,
49 const DATA_BLOB *sig);
50 NTSTATUS auth_ntlmssp_seal_packet(struct auth_ntlmssp_state *ans,
51 TALLOC_CTX *sig_mem_ctx,
52 uint8_t *data,
53 size_t length,
54 const uint8_t *whole_pdu,
55 size_t pdu_length,
56 DATA_BLOB *sig);
57 NTSTATUS auth_ntlmssp_unseal_packet(struct auth_ntlmssp_state *ans,
58 uint8_t *data,
59 size_t length,
60 const uint8_t *whole_pdu,
61 size_t pdu_length,
62 const DATA_BLOB *sig);
63 bool auth_ntlmssp_negotiated_sign(struct auth_ntlmssp_state *ans);
64 bool auth_ntlmssp_negotiated_seal(struct auth_ntlmssp_state *ans);
65 NTSTATUS auth_ntlmssp_set_username(struct auth_ntlmssp_state *ans,
66 const char *user);
67 NTSTATUS auth_ntlmssp_set_domain(struct auth_ntlmssp_state *ans,
68 const char *domain);
69 NTSTATUS auth_ntlmssp_set_password(struct auth_ntlmssp_state *ans,
70 const char *password);
71 void auth_ntlmssp_want_feature(struct auth_ntlmssp_state *ans, uint32_t feature);
72 DATA_BLOB auth_ntlmssp_get_session_key(struct auth_ntlmssp_state *ans,
73 TALLOC_CTX *mem_ctx);
75 NTSTATUS auth_ntlmssp_update(struct auth_ntlmssp_state *ans,
76 TALLOC_CTX *mem_ctx,
77 const DATA_BLOB request, DATA_BLOB *reply);
79 NTSTATUS auth_ntlmssp_client_start(TALLOC_CTX *mem_ctx,
80 const char *netbios_name,
81 const char *netbios_domain,
82 bool use_ntlmv2,
83 struct auth_ntlmssp_state **_ans);
84 #endif /* _NTLMSSP_WRAP_ */