summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-08-02 10:24:28 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-08-03 18:48:02 +1000
commitdee845eb70379feae89940e9535541f7957c60d9 (patch)
treea2553eb0d80c4bd78cd972c56a63f31af326b22b
parent6bcaba6f8ab8bae874c67389e716dd3766309656 (diff)
downloadsamba-dee845eb70379feae89940e9535541f7957c60d9.tar.gz
samba-dee845eb70379feae89940e9535541f7957c60d9.tar.bz2
samba-dee845eb70379feae89940e9535541f7957c60d9.zip
s3-ntlmssp Add mem_ctx argument to auth_ntlmssp_get_session_key()
-rw-r--r--source3/include/ntlmssp_wrap.h3
-rw-r--r--source3/librpc/crypto/cli_spnego.c5
-rw-r--r--source3/libsmb/ntlmssp_wrap.c4
-rw-r--r--source3/rpc_client/cli_pipe.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/source3/include/ntlmssp_wrap.h b/source3/include/ntlmssp_wrap.h
index 6924ea655f..ed2e82758c 100644
--- a/source3/include/ntlmssp_wrap.h
+++ b/source3/include/ntlmssp_wrap.h
@@ -72,7 +72,8 @@ NTSTATUS auth_ntlmssp_set_password(struct auth_ntlmssp_state *ans,
void auth_ntlmssp_and_flags(struct auth_ntlmssp_state *ans, uint32_t flags);
void auth_ntlmssp_or_flags(struct auth_ntlmssp_state *ans, uint32_t flags);
void auth_ntlmssp_want_feature(struct auth_ntlmssp_state *ans, uint32_t feature);
-DATA_BLOB auth_ntlmssp_get_session_key(struct auth_ntlmssp_state *ans);
+DATA_BLOB auth_ntlmssp_get_session_key(struct auth_ntlmssp_state *ans,
+ TALLOC_CTX *mem_ctx);
NTSTATUS auth_ntlmssp_update(struct auth_ntlmssp_state *ans,
const DATA_BLOB request, DATA_BLOB *reply);
diff --git a/source3/librpc/crypto/cli_spnego.c b/source3/librpc/crypto/cli_spnego.c
index e4fdf315aa..f245484653 100644
--- a/source3/librpc/crypto/cli_spnego.c
+++ b/source3/librpc/crypto/cli_spnego.c
@@ -340,9 +340,8 @@ DATA_BLOB spnego_get_session_key(TALLOC_CTX *mem_ctx,
return gse_get_session_key(mem_ctx,
sp_ctx->mech_ctx.gssapi_state);
case SPNEGO_NTLMSSP:
- sk = auth_ntlmssp_get_session_key(
- sp_ctx->mech_ctx.ntlmssp_state);
- return data_blob_dup_talloc(mem_ctx, &sk);
+ return auth_ntlmssp_get_session_key(
+ sp_ctx->mech_ctx.ntlmssp_state, mem_ctx);
default:
DEBUG(0, ("Unsupported type in request!\n"));
return data_blob_null;
diff --git a/source3/libsmb/ntlmssp_wrap.c b/source3/libsmb/ntlmssp_wrap.c
index 00aede9ee9..de883dd8cb 100644
--- a/source3/libsmb/ntlmssp_wrap.c
+++ b/source3/libsmb/ntlmssp_wrap.c
@@ -132,9 +132,9 @@ void auth_ntlmssp_want_feature(struct auth_ntlmssp_state *ans, uint32_t feature)
ntlmssp_want_feature(ans->ntlmssp_state, feature);
}
-DATA_BLOB auth_ntlmssp_get_session_key(struct auth_ntlmssp_state *ans)
+DATA_BLOB auth_ntlmssp_get_session_key(struct auth_ntlmssp_state *ans, TALLOC_CTX *mem_ctx)
{
- return ans->ntlmssp_state->session_key;
+ return data_blob_talloc(mem_ctx, ans->ntlmssp_state->session_key.data, ans->ntlmssp_state->session_key.length);
}
NTSTATUS auth_ntlmssp_update(struct auth_ntlmssp_state *ans,
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index d71a106019..9d0abfc612 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -3287,8 +3287,8 @@ NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
case DCERPC_AUTH_TYPE_NTLMSSP:
ntlmssp_ctx = talloc_get_type_abort(a->auth_ctx,
struct auth_ntlmssp_state);
- sk = auth_ntlmssp_get_session_key(ntlmssp_ctx);
- make_dup = true;
+ sk = auth_ntlmssp_get_session_key(ntlmssp_ctx, mem_ctx);
+ make_dup = false;
break;
case DCERPC_AUTH_TYPE_KRB5:
gse_ctx = talloc_get_type_abort(a->auth_ctx,