summaryrefslogtreecommitdiffstats
path: root/source3/librpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-04-23 14:35:15 +0200
committerStefan Metzmacher <metze@samba.org>2014-04-24 11:21:05 +0200
commit2ed1789e4d8ac09ed78e5ecccf0eb97d1dfa8f65 (patch)
tree251666af55d7d3c8b5f784f006f3aa9b03570666 /source3/librpc
parentfc59cc31024598599a2f1c9d73b8fa43a408ced2 (diff)
s3:rpc_client: pass everything to gensec by default
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/librpc')
-rw-r--r--source3/librpc/rpc/dcerpc_helpers.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/source3/librpc/rpc/dcerpc_helpers.c b/source3/librpc/rpc/dcerpc_helpers.c
index 2400bfd566..f95f46670e 100644
--- a/source3/librpc/rpc/dcerpc_helpers.c
+++ b/source3/librpc/rpc/dcerpc_helpers.c
@@ -382,6 +382,10 @@ static NTSTATUS get_generic_auth_footer(struct gensec_security *gensec_security,
DATA_BLOB *data, DATA_BLOB *full_pkt,
DATA_BLOB *auth_token)
{
+ if (gensec_security == NULL) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
switch (auth_level) {
case DCERPC_AUTH_LEVEL_PRIVACY:
/* Data portion is encrypted. */
@@ -466,19 +470,13 @@ NTSTATUS dcerpc_add_auth_footer(struct pipe_auth_data *auth,
case DCERPC_AUTH_TYPE_NCALRPC_AS_SYSTEM:
status = NT_STATUS_OK;
break;
- case DCERPC_AUTH_TYPE_SPNEGO:
- case DCERPC_AUTH_TYPE_KRB5:
- case DCERPC_AUTH_TYPE_NTLMSSP:
- case DCERPC_AUTH_TYPE_SCHANNEL:
- gensec_security = talloc_get_type_abort(auth->auth_ctx,
- struct gensec_security);
+ default:
+ gensec_security = talloc_get_type(auth->auth_ctx,
+ struct gensec_security);
status = add_generic_auth_footer(gensec_security,
auth->auth_level,
rpc_out);
break;
- default:
- status = NT_STATUS_INVALID_PARAMETER;
- break;
}
return status;
@@ -569,15 +567,11 @@ NTSTATUS dcerpc_check_auth(struct pipe_auth_data *auth,
case DCERPC_AUTH_TYPE_NCALRPC_AS_SYSTEM:
return NT_STATUS_OK;
- case DCERPC_AUTH_TYPE_SPNEGO:
- case DCERPC_AUTH_TYPE_KRB5:
- case DCERPC_AUTH_TYPE_NTLMSSP:
- case DCERPC_AUTH_TYPE_SCHANNEL:
-
+ default:
DEBUG(10, ("GENSEC auth\n"));
- gensec_security = talloc_get_type_abort(auth->auth_ctx,
- struct gensec_security);
+ gensec_security = talloc_get_type(auth->auth_ctx,
+ struct gensec_security);
status = get_generic_auth_footer(gensec_security,
auth->auth_level,
&data, &full_pkt,
@@ -586,11 +580,6 @@ NTSTATUS dcerpc_check_auth(struct pipe_auth_data *auth,
return status;
}
break;
- default:
- DEBUG(0, ("process_request_pdu: "
- "unknown auth type %u set.\n",
- (unsigned int)auth->auth_type));
- return NT_STATUS_INVALID_PARAMETER;
}
/* TODO: remove later