s3-dcerpc: add dcerpc_push_dcerpc_auth().
authorGünther Deschner <gd@samba.org>
Tue, 24 Mar 2009 18:09:29 +0000 (19:09 +0100)
committerSimo Sorce <idra@samba.org>
Thu, 8 Jul 2010 03:45:51 +0000 (23:45 -0400)
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
source3/rpc_client/cli_pipe.c

index d4ff89849be567ba9ce1cb4cc674da9ec87ad417..b793938f9ed66ea636c47ebc95b10f40e7a7246d 100644 (file)
@@ -1650,6 +1650,40 @@ static NTSTATUS rpc_api_pipe_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
        return NT_STATUS_OK;
 }
 
+/*******************************************************************
+ ********************************************************************/
+
+static NTSTATUS dcerpc_push_dcerpc_auth(TALLOC_CTX *mem_ctx,
+                                       enum dcerpc_AuthType auth_type,
+                                       enum dcerpc_AuthLevel auth_level,
+                                       uint8_t auth_pad_length,
+                                       uint32_t auth_context_id,
+                                       const DATA_BLOB *credentials,
+                                       DATA_BLOB *blob)
+{
+       struct dcerpc_auth r;
+       enum ndr_err_code ndr_err;
+
+       r.auth_type             = auth_type;
+       r.auth_level            = auth_level;
+       r.auth_pad_length       = auth_pad_length;
+       r.auth_reserved         = 0;
+       r.auth_context_id       = auth_context_id;
+       r.credentials           = *credentials;
+
+       ndr_err = ndr_push_struct_blob(blob, mem_ctx, &r,
+               (ndr_push_flags_fn_t)ndr_push_dcerpc_auth);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               return ndr_map_error2ntstatus(ndr_err);
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_DEBUG(dcerpc_auth, &r);
+       }
+
+       return NT_STATUS_OK;
+}
+
 /*******************************************************************
  Creates krb5 auth bind.
  ********************************************************************/