s4:librpc/rpc: add support for DCERPC_AUTH_LEVEL_PACKET
authorGünther Deschner <gd@samba.org>
Tue, 30 Aug 2016 13:52:41 +0000 (15:52 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 26 Oct 2016 09:20:16 +0000 (11:20 +0200)
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/librpc/rpc/dcerpc.c
source4/librpc/rpc/dcerpc_auth.c
source4/librpc/rpc/dcerpc_util.c

index 37d41a42eda8d96f022af9391aec61cb26ce10b9..8a96f01e8a0683b24edad191d187775e03b181f3 100644 (file)
@@ -1526,7 +1526,7 @@ static NTSTATUS dcerpc_request_prepare_vt(struct rpc_request *req)
        struct ndr_push *ndr = NULL;
        enum ndr_err_code ndr_err;
 
-       if (sec->auth_level < DCERPC_AUTH_LEVEL_INTEGRITY) {
+       if (sec->auth_level < DCERPC_AUTH_LEVEL_PACKET) {
                return NT_STATUS_OK;
        }
 
@@ -1661,7 +1661,7 @@ static void dcerpc_ship_next_request(struct dcecli_connection *c)
                need_async = true;
        }
 
-       if (c->security_state.auth_level >= DCERPC_AUTH_LEVEL_INTEGRITY) {
+       if (c->security_state.auth_level >= DCERPC_AUTH_LEVEL_PACKET) {
                can_async = gensec_have_feature(c->security_state.generic_state,
                                                GENSEC_FEATURE_ASYNC_REPLIES);
        }
@@ -1683,7 +1683,7 @@ static void dcerpc_ship_next_request(struct dcecli_connection *c)
           request header size */
        chunk_size = p->conn->srv_max_recv_frag;
        chunk_size -= DCERPC_REQUEST_LENGTH;
-       if (c->security_state.auth_level >= DCERPC_AUTH_LEVEL_INTEGRITY) {
+       if (c->security_state.auth_level >= DCERPC_AUTH_LEVEL_PACKET) {
                size_t max_payload = chunk_size;
 
                max_payload -= DCERPC_AUTH_TRAILER_LENGTH;
@@ -2048,6 +2048,8 @@ uint32_t dcerpc_auth_level(struct dcecli_connection *c)
                auth_level = DCERPC_AUTH_LEVEL_INTEGRITY;
        } else if (c->flags & DCERPC_CONNECT) {
                auth_level = DCERPC_AUTH_LEVEL_CONNECT;
+       } else if (c->flags & DCERPC_PACKET) {
+               auth_level = DCERPC_AUTH_LEVEL_PACKET;
        } else {
                auth_level = DCERPC_AUTH_LEVEL_NONE;
        }
index d617b07e07c810e8b9b27568df308ef703e008c5..c902d6e52599f476b9a4e55953f07cde148b5ba7 100644 (file)
@@ -432,7 +432,7 @@ struct composite_context *dcerpc_bind_auth_send(TALLOC_CTX *mem_ctx,
        }
 
        if (gensec_have_feature(sec->generic_state, GENSEC_FEATURE_SIGN_PKT_HEADER)) {
-               if (sec->auth_level >= DCERPC_AUTH_LEVEL_INTEGRITY) {
+               if (sec->auth_level >= DCERPC_AUTH_LEVEL_PACKET) {
                        state->pipe->conn->flags |= DCERPC_PROPOSE_HEADER_SIGNING;
                }
        }
index e2e4a641e1fd73fed774dbe9ab27fc862bd3bd90..32c753f0d8ff0e8c9750fdb8790eeeaeb4e46520 100644 (file)
@@ -678,7 +678,7 @@ struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p,
 
        /* Perform an authenticated DCE-RPC bind
         */
-       if (!(conn->flags & (DCERPC_CONNECT|DCERPC_SEAL))) {
+       if (!(conn->flags & (DCERPC_CONNECT|DCERPC_SEAL|DCERPC_PACKET))) {
                /*
                  we are doing an authenticated connection,
                  which needs to use [connect], [sign] or [seal].