summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2015-06-19 22:35:44 +0200
committerStefan Metzmacher <metze@samba.org>2015-06-23 14:38:53 +0200
commitfc249d542fcb8d043ae72eb7963d3a85eb79253a (patch)
tree6df7823e1b37bb7ffb5b510d3792c8b80d0f3a42 /source4/librpc
parentef801bae95403e96042f5d8c87085bce21436013 (diff)
downloadsamba-fc249d542fcb8d043ae72eb7963d3a85eb79253a.tar.gz
s4:librpc/rpc: let dcerpc_ship_next_request() use a sig_size for a padded payload
The sig_size could differ depending on the aligment/padding. So should use the same alignment as we use for the payload. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11061 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/rpc/dcerpc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index 3f8189d1069..71940746829 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -1681,8 +1681,13 @@ static void dcerpc_ship_next_request(struct dcecli_connection *c)
chunk_size -= DCERPC_REQUEST_LENGTH;
if (c->security_state.auth_info &&
c->security_state.generic_state) {
+ size_t max_payload = chunk_size;
+
+ max_payload -= DCERPC_AUTH_TRAILER_LENGTH;
+ max_payload -= (max_payload % DCERPC_AUTH_PAD_ALIGNMENT);
+
sig_size = gensec_sig_size(c->security_state.generic_state,
- p->conn->srv_max_recv_frag);
+ max_payload);
if (sig_size) {
chunk_size -= DCERPC_AUTH_TRAILER_LENGTH;
chunk_size -= sig_size;