2 Unix SMB/CIFS implementation.
4 dcerpc authentication operations
6 Copyright (C) Andrew Tridgell 2003
7 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2004
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 NTSTATUS gensec_ntlmssp_client_start(struct gensec_security *gensec_security)
29 struct ntlmssp_state *ntlmssp_state = NULL;
32 status = ntlmssp_client_start(&ntlmssp_state);
33 if (!NT_STATUS_IS_OK(status)) {
37 status = ntlmssp_set_domain(ntlmssp_state, gensec_security->user.domain);
38 if (!NT_STATUS_IS_OK(status)) {
42 status = ntlmssp_set_username(ntlmssp_state, gensec_security->user.name);
43 if (!NT_STATUS_IS_OK(status)) {
47 status = ntlmssp_set_password(ntlmssp_state, gensec_security->user.password);
48 if (!NT_STATUS_IS_OK(status)) {
52 gensec_security->private_data = ntlmssp_state;
58 wrappers for the ntlmssp_*() functions
60 NTSTATUS gensec_ntlmssp_unseal_packet(struct gensec_security *gensec_security,
62 uint8_t *data, size_t length, DATA_BLOB *sig)
64 struct ntlmssp_state *ntlmssp_state = gensec_security->private_data;
66 return ntlmssp_unseal_packet(ntlmssp_state, mem_ctx, data, length, sig);
69 NTSTATUS gensec_ntlmssp_check_packet(struct gensec_security *gensec_security,
71 const uint8_t *data, size_t length,
74 struct ntlmssp_state *ntlmssp_state = gensec_security->private_data;
76 return ntlmssp_check_packet(ntlmssp_state, mem_ctx, data, length, sig);
79 NTSTATUS gensec_ntlmssp_seal_packet(struct gensec_security *gensec_security,
81 uint8_t *data, size_t length,
84 struct ntlmssp_state *ntlmssp_state = gensec_security->private_data;
86 return ntlmssp_seal_packet(ntlmssp_state, mem_ctx, data, length, sig);
89 NTSTATUS gensec_ntlmssp_sign_packet(struct gensec_security *gensec_security,
91 const uint8_t *data, size_t length,
94 struct ntlmssp_state *ntlmssp_state = gensec_security->private_data;
96 return ntlmssp_sign_packet(ntlmssp_state, mem_ctx, data, length, sig);
99 NTSTATUS gensec_ntlmssp_session_key(struct gensec_security *gensec_security,
100 DATA_BLOB *session_key)
102 struct ntlmssp_state *ntlmssp_state = gensec_security->private_data;
104 return ntlmssp_session_key(ntlmssp_state, session_key);
107 NTSTATUS gensec_ntlmssp_update(struct gensec_security *gensec_security, TALLOC_CTX *out_mem_ctx,
108 const DATA_BLOB in, DATA_BLOB *out)
110 struct ntlmssp_state *ntlmssp_state = gensec_security->private_data;
112 return ntlmssp_update(ntlmssp_state, out_mem_ctx, in, out);
115 void gensec_ntlmssp_end(struct gensec_security *gensec_security)
117 struct ntlmssp_state *ntlmssp_state = gensec_security->private_data;
119 ntlmssp_end(&ntlmssp_state);
121 gensec_security->private_data = NULL;