2 Unix SMB/CIFS implementation.
4 dcerpc authentication operations
6 Copyright (C) Stefan Metzmacher 2004
7 Copyright (C) Andrew Tridgell 2003-2005
8 Copyright (C) Andrew Bartlett 2004
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 metze, can you tell me what you're trying to do with this?
33 do spnego style authentication on a gensec pipe
35 NTSTATUS dcerpc_bind_auth_spnego(struct dcerpc_pipe *p,
36 const char *uuid, uint_t version,
43 status = gensec_client_start(p, &p->conn->security_state.generic_state);
44 if (!NT_STATUS_IS_OK(status)) {
45 DEBUG(1, ("Failed to start GENSEC client mode: %s\n", nt_errstr(status)));
49 status = gensec_set_domain(p->conn->security_state.generic_state, domain);
50 if (!NT_STATUS_IS_OK(status)) {
51 DEBUG(1, ("Failed to start set GENSEC client domain to %s: %s\n",
52 domain, nt_errstr(status)));
56 status = gensec_set_username(p->conn->security_state.generic_state, username);
57 if (!NT_STATUS_IS_OK(status)) {
58 DEBUG(1, ("Failed to start set GENSEC client username to %s: %s\n",
59 username, nt_errstr(status)));
63 status = gensec_set_password(p->conn->security_state.generic_state, password);
64 if (!NT_STATUS_IS_OK(status)) {
65 DEBUG(1, ("Failed to start set GENSEC client password: %s\n",
70 status = gensec_set_target_hostname(p->conn->security_state.generic_state,
71 p->conn->transport.peer_name(p->conn));
72 if (!NT_STATUS_IS_OK(status)) {
73 DEBUG(1, ("Failed to start set GENSEC target hostname: %s\n",
78 status = gensec_start_mech_by_authtype(p->conn->security_state.generic_state,
79 DCERPC_AUTH_TYPE_SPNEGO,
80 dcerpc_auth_level(p->conn));
81 if (!NT_STATUS_IS_OK(status)) {
82 DEBUG(1, ("Failed to start set GENSEC client SPNEGO mechanism: %s\n",
87 status = dcerpc_bind_alter(p, DCERPC_AUTH_TYPE_SPNEGO,
88 dcerpc_auth_level(p->conn),
91 if (!NT_STATUS_IS_OK(status)) {
92 DEBUG(2, ("Failed to bind to pipe with SPNEGO: %s\n", nt_errstr(status)));