summaryrefslogtreecommitdiff
path: root/source3/libsmb/clifsinfo.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-10-19 15:57:18 +1100
committerStefan Metzmacher <metze@samba.org>2011-10-21 08:44:48 +0200
commit0fe419205444f2c4f33581ea77a732e6d069e318 (patch)
treeadf761ce5f7f770a73c5f793029376931e4c6c2e /source3/libsmb/clifsinfo.c
parent0a0839821adb8a4e959e10128e9c103f82e0ff80 (diff)
downloadsamba-0fe419205444f2c4f33581ea77a732e6d069e318.tar.gz
samba-0fe419205444f2c4f33581ea77a732e6d069e318.tar.bz2
samba-0fe419205444f2c4f33581ea77a732e6d069e318.zip
s3-ntlmssp Remove references to auth_ntlmssp_context from the smb sealing code
Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/libsmb/clifsinfo.c')
-rw-r--r--source3/libsmb/clifsinfo.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c
index 1762e85d7d..2469200353 100644
--- a/source3/libsmb/clifsinfo.c
+++ b/source3/libsmb/clifsinfo.c
@@ -609,36 +609,37 @@ NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli,
DATA_BLOB blob_out = data_blob_null;
DATA_BLOB param_out = data_blob_null;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
+ struct auth_ntlmssp_state *auth_ntlmssp_state;
struct smb_trans_enc_state *es = make_cli_enc_state(SMB_TRANS_ENC_NTLM);
if (!es) {
return NT_STATUS_NO_MEMORY;
}
status = auth_ntlmssp_client_prepare(NULL,
- &es->s.auth_ntlmssp_state);
+ &auth_ntlmssp_state);
if (!NT_STATUS_IS_OK(status)) {
goto fail;
}
- gensec_want_feature(es->s.auth_ntlmssp_state->gensec_security, GENSEC_FEATURE_SESSION_KEY);
- gensec_want_feature(es->s.auth_ntlmssp_state->gensec_security, GENSEC_FEATURE_SEAL);
+ gensec_want_feature(auth_ntlmssp_state->gensec_security, GENSEC_FEATURE_SESSION_KEY);
+ gensec_want_feature(auth_ntlmssp_state->gensec_security, GENSEC_FEATURE_SEAL);
- if (!NT_STATUS_IS_OK(status = auth_ntlmssp_set_username(es->s.auth_ntlmssp_state, user))) {
+ if (!NT_STATUS_IS_OK(status = auth_ntlmssp_set_username(auth_ntlmssp_state, user))) {
goto fail;
}
- if (!NT_STATUS_IS_OK(status = auth_ntlmssp_set_domain(es->s.auth_ntlmssp_state, domain))) {
+ if (!NT_STATUS_IS_OK(status = auth_ntlmssp_set_domain(auth_ntlmssp_state, domain))) {
goto fail;
}
- if (!NT_STATUS_IS_OK(status = auth_ntlmssp_set_password(es->s.auth_ntlmssp_state, pass))) {
+ if (!NT_STATUS_IS_OK(status = auth_ntlmssp_set_password(auth_ntlmssp_state, pass))) {
goto fail;
}
- if (!NT_STATUS_IS_OK(status = auth_ntlmssp_client_start(es->s.auth_ntlmssp_state))) {
+ if (!NT_STATUS_IS_OK(status = auth_ntlmssp_client_start(auth_ntlmssp_state))) {
goto fail;
}
do {
- status = gensec_update(es->s.auth_ntlmssp_state->gensec_security, es->s.auth_ntlmssp_state,
+ status = gensec_update(auth_ntlmssp_state->gensec_security, auth_ntlmssp_state,
NULL, blob_in, &blob_out);
data_blob_free(&blob_in);
data_blob_free(&param_out);
@@ -667,13 +668,18 @@ NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli,
if (cli->trans_enc_state) {
common_free_encryption_state(&cli->trans_enc_state);
}
+ /* We only need the gensec_security part from here.
+ * es is a malloc()ed pointer, so we cannot make
+ * gensec_security a talloc child */
+ es->s.gensec_security = talloc_move(NULL,
+ &auth_ntlmssp_state->gensec_security);
cli->trans_enc_state = es;
cli->trans_enc_state->enc_on = True;
es = NULL;
}
fail:
-
+ TALLOC_FREE(auth_ntlmssp_state);
common_free_encryption_state(&es);
return status;
}