s3:cli_pipe: make use of netsec_create_state()
authorStefan Metzmacher <metze@samba.org>
Fri, 2 Aug 2013 11:28:11 +0000 (13:28 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 10 Aug 2013 07:18:57 +0000 (09:18 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpc_client/cli_pipe.c

index 25c7a44ceac72cffdb51aa4ae00ead714f0df2f3..4d8a9d3b03b7e1d5215b35796336d777697b12a3 100644 (file)
@@ -2243,18 +2243,11 @@ static NTSTATUS rpccli_schannel_bind_data(TALLOC_CTX *mem_ctx,
                goto fail;
        }
 
-       schannel_auth = talloc_zero(result, struct schannel_state);
+       schannel_auth = netsec_create_state(result, creds, true /* initiator */);
        if (schannel_auth == NULL) {
                goto fail;
        }
 
-       schannel_auth->state = SCHANNEL_STATE_START;
-       schannel_auth->initiator = true;
-       schannel_auth->creds = netlogon_creds_copy(schannel_auth, creds);
-       if (schannel_auth->creds == NULL) {
-               goto fail;
-       }
-
        result->auth_ctx = schannel_auth;
        *presult = result;
        return NT_STATUS_OK;