summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,