s3:rpc_server: remove pad handling from api_pipe_alter_context()
authorStefan Metzmacher <metze@samba.org>
Fri, 19 Jun 2015 20:09:57 +0000 (22:09 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 23 Jun 2015 12:38:53 +0000 (14:38 +0200)
This is not needed and windows doesn't use it.
The padding is for the payload in request and response.

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>
source3/rpc_server/srv_pipe.c

index 77592a44ec27eec8a57c44a568dbf0d5ee88b39f..4ffaa0dbb036c3f5ad27f9aa52ff0f14395b3c17 100644 (file)
@@ -943,7 +943,6 @@ static bool api_pipe_alter_context(struct pipes_struct *p,
        struct dcerpc_ack_ctx bind_ack_ctx;
        DATA_BLOB auth_resp = data_blob_null;
        DATA_BLOB auth_blob = data_blob_null;
-       int pad_len = 0;
        struct gensec_security *gensec_security;
 
        DEBUG(5,("api_pipe_alter_context: make response. %d\n", __LINE__));
@@ -1080,19 +1079,10 @@ static bool api_pipe_alter_context(struct pipes_struct *p,
        }
 
        if (auth_resp.length) {
-
-               /* Work out any padding needed before the auth footer. */
-               pad_len = p->out_data.frag.length % SERVER_NDR_PADDING_SIZE;
-               if (pad_len) {
-                       pad_len = SERVER_NDR_PADDING_SIZE - pad_len;
-                       DEBUG(10, ("auth pad_len = %u\n",
-                                  (unsigned int)pad_len));
-               }
-
                status = dcerpc_push_dcerpc_auth(pkt,
                                                 auth_info.auth_type,
                                                 auth_info.auth_level,
-                                                pad_len,
+                                                0, /* pad_len */
                                                 1, /* auth_context_id */
                                                 &auth_resp,
                                                 &auth_blob);
@@ -1106,22 +1096,9 @@ static bool api_pipe_alter_context(struct pipes_struct *p,
         * the dcerpc header */
        dcerpc_set_frag_length(&p->out_data.frag,
                                p->out_data.frag.length +
-                                       pad_len + auth_blob.length);
+                               auth_blob.length);
 
        if (auth_resp.length) {
-               if (pad_len) {
-                       char pad[SERVER_NDR_PADDING_SIZE];
-                       memset(pad, '\0', SERVER_NDR_PADDING_SIZE);
-                       if (!data_blob_append(p->mem_ctx,
-                                               &p->out_data.frag,
-                                               pad, pad_len)) {
-                               DEBUG(0, ("api_pipe_bind_req: failed to add "
-                                         "%u bytes of pad data.\n",
-                                         (unsigned int)pad_len));
-                               goto err_exit;
-                       }
-               }
-
                if (!data_blob_append(p->mem_ctx, &p->out_data.frag,
                                        auth_blob.data, auth_blob.length)) {
                        DEBUG(0, ("Append of auth info failed.\n"));