From eb5fc899b0a17d86eef4f40d71b023d8db1708b4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 14 Feb 2010 17:09:55 +1100 Subject: s4-rpcserver: teach the rpc server to cope with bad sig_size estimates --- source4/rpc_server/dcesrv_auth.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'source4') diff --git a/source4/rpc_server/dcesrv_auth.c b/source4/rpc_server/dcesrv_auth.c index 4d708e4dff..e74b2ef167 100644 --- a/source4/rpc_server/dcesrv_auth.c +++ b/source4/rpc_server/dcesrv_auth.c @@ -482,27 +482,23 @@ bool dcesrv_auth_response(struct dcesrv_call_state *call, break; } - if (NT_STATUS_IS_OK(status)) { - if (creds2.length != sig_size) { - DEBUG(0,("dcesrv_auth_response: creds2.length[%u] != sig_size[%u] pad[%u] stub[%u]\n", - (unsigned)creds2.length, (uint32_t)sig_size, - (unsigned)dce_conn->auth_state.auth_info->auth_pad_length, - (unsigned)pkt->u.response.stub_and_verifier.length)); - data_blob_free(&creds2); - status = NT_STATUS_INTERNAL_ERROR; - } - } - - if (NT_STATUS_IS_OK(status)) { - if (!data_blob_append(call, blob, creds2.data, creds2.length)) { - status = NT_STATUS_NO_MEMORY; - } - data_blob_free(&creds2); - } - if (!NT_STATUS_IS_OK(status)) { return false; } + if (creds2.length != sig_size) { + DEBUG(3,("dcesrv_auth_response: creds2.length[%u] != sig_size[%u] pad[%u] stub[%u]\n", + (unsigned)creds2.length, (uint32_t)sig_size, + (unsigned)dce_conn->auth_state.auth_info->auth_pad_length, + (unsigned)pkt->u.response.stub_and_verifier.length)); + dcerpc_set_frag_length(blob, blob->length + creds2.length); + dcerpc_set_auth_length(blob, creds2.length); + } + + if (!data_blob_append(call, blob, creds2.data, creds2.length)) { + status = NT_STATUS_NO_MEMORY; + } + data_blob_free(&creds2); + return true; } -- cgit