summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-09-13 10:22:39 +0200
committerStefan Metzmacher <metze@samba.org>2008-09-13 20:37:11 +0200
commitde53ddee89a5068db3083e922b3e9652f261b239 (patch)
tree8e168267ce4a6d525edbf306139372437736463e
parent73ebb58f2da7f3dbc0d61d68d1b28b482069b344 (diff)
downloadsamba-de53ddee89a5068db3083e922b3e9652f261b239.tar.gz
samba-de53ddee89a5068db3083e922b3e9652f261b239.tar.bz2
samba-de53ddee89a5068db3083e922b3e9652f261b239.zip
rpc_server: correctly calculate the auth padding
metze (This used to be commit e82468a8f538aa0cf6d477fb54cc0178c0d64574)
-rw-r--r--source4/rpc_server/dcesrv_auth.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/rpc_server/dcesrv_auth.c b/source4/rpc_server/dcesrv_auth.c
index 0aad3775d0..3a7f2420b3 100644
--- a/source4/rpc_server/dcesrv_auth.c
+++ b/source4/rpc_server/dcesrv_auth.c
@@ -429,10 +429,15 @@ bool dcesrv_auth_response(struct dcesrv_call_state *call,
}
/* pad to 16 byte multiple, match win2k3 */
- dce_conn->auth_state.auth_info->auth_pad_length = NDR_ALIGN(ndr, 16);
- ndr_push_zero(ndr, dce_conn->auth_state.auth_info->auth_pad_length);
+ dce_conn->auth_state.auth_info->auth_pad_length =
+ (16 - (pkt->u.response.stub_and_verifier.length & 15)) & 15;
+ ndr_err = ndr_push_zero(ndr, dce_conn->auth_state.auth_info->auth_pad_length);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ return false;
+ }
- payload_length = ndr->offset - DCERPC_REQUEST_LENGTH;
+ payload_length = pkt->u.response.stub_and_verifier.length +
+ dce_conn->auth_state.auth_info->auth_pad_length;
if (dce_conn->auth_state.auth_info->auth_level == DCERPC_AUTH_LEVEL_CONNECT) {
status = dcesrv_connect_verifier(call,