Commit d974d584 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

kerberos: Pass input/output buffers directly for make_signature() call.

parent 17b283d8
......@@ -641,7 +641,19 @@ static NTSTATUS SEC_ENTRY kerberos_SpMakeSignature( LSA_SEC_HANDLE context, ULON
if (context)
{
struct context_handle *context_handle = (void *)context;
struct make_signature_params params = { context_handle->handle, message };
struct make_signature_params params;
int data_idx, token_idx;
/* FIXME: multiple data buffers, read-only buffers */
if ((data_idx = get_buffer_index( message, SECBUFFER_DATA )) == -1) return SEC_E_INVALID_TOKEN;
if ((token_idx = get_buffer_index( message, SECBUFFER_TOKEN )) == -1) return SEC_E_INVALID_TOKEN;
params.context = context_handle->handle;
params.data_length = message->pBuffers[data_idx].cbBuffer;
params.data = message->pBuffers[data_idx].pvBuffer;
params.token_length = &message->pBuffers[token_idx].cbBuffer;
params.token = message->pBuffers[token_idx].pvBuffer;
return KRB5_CALL( make_signature, &params );
}
else return SEC_E_INVALID_HANDLE;
......
......@@ -753,18 +753,12 @@ static NTSTATUS initialize_context( void *args )
static NTSTATUS make_signature( void *args )
{
struct make_signature_params *params = args;
SecBufferDesc *msg = params->msg;
OM_uint32 ret, minor_status;
gss_buffer_desc data_buffer, token_buffer;
gss_ctx_id_t ctx_handle = ctxhandle_sspi_to_gss( params->context );
int data_idx, token_idx;
/* FIXME: multiple data buffers, read-only buffers */
if ((data_idx = get_buffer_index( msg, SECBUFFER_DATA )) == -1) return SEC_E_INVALID_TOKEN;
data_buffer.length = msg->pBuffers[data_idx].cbBuffer;
data_buffer.value = msg->pBuffers[data_idx].pvBuffer;
if ((token_idx = get_buffer_index( msg, SECBUFFER_TOKEN )) == -1) return SEC_E_INVALID_TOKEN;
data_buffer.length = params->data_length;
data_buffer.value = params->data;
token_buffer.length = 0;
token_buffer.value = NULL;
......@@ -773,8 +767,8 @@ static NTSTATUS make_signature( void *args )
if (GSS_ERROR( ret )) trace_gss_status( ret, minor_status );
if (ret == GSS_S_COMPLETE)
{
memcpy( msg->pBuffers[token_idx].pvBuffer, token_buffer.value, token_buffer.length );
msg->pBuffers[token_idx].cbBuffer = token_buffer.length;
memcpy( params->token, token_buffer.value, token_buffer.length );
*params->token_length = token_buffer.length;
pgss_release_buffer( &minor_status, &token_buffer );
}
......
......@@ -72,7 +72,10 @@ struct initialize_context_params
struct make_signature_params
{
UINT64 context;
SecBufferDesc *msg;
BYTE *data;
ULONG data_length;
BYTE *token;
ULONG *token_length;
};
struct query_context_attributes_params
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment