summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc/dcerpc_spnego.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-10 07:14:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:35 -0500
commit5da3f75a5975c09dc1db0b1ad146acf1d5f3ae41 (patch)
treeae73c01bdac2e45686eb381f9c1d16fd401f12e4 /source4/librpc/rpc/dcerpc_spnego.c
parentf6596e4ae77c0125a1362e483aa1aedb8cf489c1 (diff)
downloadsamba-5da3f75a5975c09dc1db0b1ad146acf1d5f3ae41.tar.gz
samba-5da3f75a5975c09dc1db0b1ad146acf1d5f3ae41.tar.bz2
samba-5da3f75a5975c09dc1db0b1ad146acf1d5f3ae41.zip
r4627: - simplified the dcerpc auth code using a common function
- added support for "spnego" in binding strings. This enables SPNEGO auth in the dcerpc client code, using as many allter_context calls as are needed To try SPNEGO do this: smbtorture ncacn_ip_tcp:SERVER[spnego,seal] -Uadministrator%password RPC-SAMR (This used to be commit 9c0a3423f03111c110d21c0d3910e16aa1a8bf87)
Diffstat (limited to 'source4/librpc/rpc/dcerpc_spnego.c')
-rw-r--r--source4/librpc/rpc/dcerpc_spnego.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/source4/librpc/rpc/dcerpc_spnego.c b/source4/librpc/rpc/dcerpc_spnego.c
index f67dd2c7cb..7290139f6e 100644
--- a/source4/librpc/rpc/dcerpc_spnego.c
+++ b/source4/librpc/rpc/dcerpc_spnego.c
@@ -24,22 +24,21 @@
#include "includes.h"
-#if 0
-/*
- metze, can you tell me what you're trying to do with this?
-*/
-
/*
do spnego style authentication on a gensec pipe
*/
NTSTATUS dcerpc_bind_auth_spnego(struct dcerpc_pipe *p,
- const char *uuid, uint_t version,
- const char *domain,
- const char *username,
- const char *password)
+ const char *uuid, uint_t version,
+ const char *domain,
+ const char *username,
+ const char *password)
{
NTSTATUS status;
+ if (!(p->conn->flags & (DCERPC_SIGN | DCERPC_SEAL))) {
+ p->conn->flags |= DCERPC_CONNECT;
+ }
+
status = gensec_client_start(p, &p->conn->security_state.generic_state);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Failed to start GENSEC client mode: %s\n", nt_errstr(status)));
@@ -84,10 +83,9 @@ NTSTATUS dcerpc_bind_auth_spnego(struct dcerpc_pipe *p,
return status;
}
- status = dcerpc_bind_alter(p, DCERPC_AUTH_TYPE_SPNEGO,
- dcerpc_auth_level(p->conn),
- uuid, version);
-
+ status = dcerpc_bind_auth(p, DCERPC_AUTH_TYPE_SPNEGO,
+ dcerpc_auth_level(p->conn),
+ uuid, version);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(2, ("Failed to bind to pipe with SPNEGO: %s\n", nt_errstr(status)));
return status;
@@ -95,4 +93,3 @@ NTSTATUS dcerpc_bind_auth_spnego(struct dcerpc_pipe *p,
return status;
}
-#endif