s3:dcerpc_helpers: correctly support DCERPC_AUTH_LEVEL_PACKET
authorStefan Metzmacher <metze@samba.org>
Thu, 22 Sep 2016 22:11:03 +0000 (00:11 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 26 Oct 2016 09:20:16 +0000 (11:20 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/librpc/rpc/dcerpc_helpers.c

index 88d27d0fafdc81618edb233a2d8c75c48b796ae3..1f67987561cde780368f85fc0c9b83c7fb8bf5af 100644 (file)
@@ -155,7 +155,6 @@ NTSTATUS dcerpc_guess_sizes(struct pipe_auth_data *auth,
        switch (auth->auth_level) {
        case DCERPC_AUTH_LEVEL_NONE:
        case DCERPC_AUTH_LEVEL_CONNECT:
-       case DCERPC_AUTH_LEVEL_PACKET:
                max_len = max_xmit_frag - header_len;
                *data_to_send = MIN(max_len, data_left);
                *pad_len = 0;
@@ -169,6 +168,9 @@ NTSTATUS dcerpc_guess_sizes(struct pipe_auth_data *auth,
        case DCERPC_AUTH_LEVEL_INTEGRITY:
                break;
 
+       case DCERPC_AUTH_LEVEL_PACKET:
+               break;
+
        default:
                return NT_STATUS_INVALID_PARAMETER;
        }
@@ -244,6 +246,7 @@ static NTSTATUS add_generic_auth_footer(struct gensec_security *gensec_security,
                break;
 
        case DCERPC_AUTH_LEVEL_INTEGRITY:
+       case DCERPC_AUTH_LEVEL_PACKET:
                /* Data is signed. */
                status = gensec_sign_packet(gensec_security,
                                            rpc_out->data,
@@ -301,6 +304,7 @@ static NTSTATUS get_generic_auth_footer(struct gensec_security *gensec_security,
                                            auth_token);
 
        case DCERPC_AUTH_LEVEL_INTEGRITY:
+       case DCERPC_AUTH_LEVEL_PACKET:
                /* Data is signed. */
                return gensec_check_packet(gensec_security,
                                           data->data,
@@ -427,6 +431,10 @@ NTSTATUS dcerpc_check_auth(struct pipe_auth_data *auth,
                DEBUG(10, ("Requested Integrity.\n"));
                break;
 
+       case DCERPC_AUTH_LEVEL_PACKET:
+               DEBUG(10, ("Requested packet.\n"));
+               break;
+
        case DCERPC_AUTH_LEVEL_CONNECT:
                if (pkt->auth_length != 0) {
                        break;