diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-07-26 17:20:35 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-08-03 18:48:03 +1000 |
commit | 6d7ac4f1ad364cac6266bd3e88d141a7517a7d15 (patch) | |
tree | 379f8644e55e5ac500478adac62720a35ee286d8 /source3/libsmb | |
parent | 763243d6ed470d1ff5c0d1c4ab6cda227103cc15 (diff) | |
download | samba-6d7ac4f1ad364cac6266bd3e88d141a7517a7d15.tar.gz samba-6d7ac4f1ad364cac6266bd3e88d141a7517a7d15.tar.bz2 samba-6d7ac4f1ad364cac6266bd3e88d141a7517a7d15.zip |
s3-ntlmssp Add mem_ctx argument to auth_ntlmssp_update
This clarifies the lifetime of the returned token.
Andrew Bartlett
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clifsinfo.c | 3 | ||||
-rw-r--r-- | source3/libsmb/ntlmssp_wrap.c | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c index db6260efc7..3e268b5e6f 100644 --- a/source3/libsmb/clifsinfo.c +++ b/source3/libsmb/clifsinfo.c @@ -636,7 +636,8 @@ NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli, } do { - status = auth_ntlmssp_update(es->s.auth_ntlmssp_state, blob_in, &blob_out); + status = auth_ntlmssp_update(es->s.auth_ntlmssp_state, es->s.auth_ntlmssp_state, + blob_in, &blob_out); data_blob_free(&blob_in); data_blob_free(¶m_out); if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED) || NT_STATUS_IS_OK(status)) { diff --git a/source3/libsmb/ntlmssp_wrap.c b/source3/libsmb/ntlmssp_wrap.c index 43cde19b3b..454720423a 100644 --- a/source3/libsmb/ntlmssp_wrap.c +++ b/source3/libsmb/ntlmssp_wrap.c @@ -186,12 +186,19 @@ DATA_BLOB auth_ntlmssp_get_session_key(struct auth_ntlmssp_state *ans, TALLOC_CT } NTSTATUS auth_ntlmssp_update(struct auth_ntlmssp_state *ans, + TALLOC_CTX *mem_ctx, const DATA_BLOB request, DATA_BLOB *reply) { + NTSTATUS status; if (ans->gensec_security) { - return gensec_update(ans->gensec_security, ans, request, reply); + return gensec_update(ans->gensec_security, mem_ctx, request, reply); + } + status = ntlmssp_update(ans->ntlmssp_state, request, reply); + if (!NT_STATUS_IS_OK(status) && !NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) { + return status; } - return ntlmssp_update(ans->ntlmssp_state, request, reply); + talloc_steal(mem_ctx, reply->data); + return status; } NTSTATUS auth_ntlmssp_client_start(TALLOC_CTX *mem_ctx, |