From 0c1b4c232135ebdef58bb5e697dfc60ddbb358bc Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 2 Jan 2012 15:38:38 +1100 Subject: s3-librpc Call SPENGO/GSSAPI via the auth_generic layer and gensec This simplifies a lot of code, as we know we are always dealing with a struct gensec_security, and allows the gensec module being used to implement GSSAPI to be swapped for AD-server operation. Andrew Bartlett Signed-off-by: Stefan Metzmacher --- source3/librpc/rpc/dcerpc_helpers.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'source3/librpc/rpc') diff --git a/source3/librpc/rpc/dcerpc_helpers.c b/source3/librpc/rpc/dcerpc_helpers.c index 4cfe7933fe..ed0e0fe932 100644 --- a/source3/librpc/rpc/dcerpc_helpers.c +++ b/source3/librpc/rpc/dcerpc_helpers.c @@ -268,10 +268,7 @@ NTSTATUS dcerpc_guess_sizes(struct pipe_auth_data *auth, struct gensec_security *gensec_security; struct schannel_state *schannel_auth; struct spnego_context *spnego_ctx; - struct gse_context *gse_ctx; enum spnego_mech auth_type; - void *auth_ctx; - bool seal = false; NTSTATUS status; /* no auth token cases first */ @@ -287,7 +284,6 @@ NTSTATUS dcerpc_guess_sizes(struct pipe_auth_data *auth, return NT_STATUS_OK; case DCERPC_AUTH_LEVEL_PRIVACY: - seal = true; break; case DCERPC_AUTH_LEVEL_INTEGRITY: @@ -308,30 +304,11 @@ NTSTATUS dcerpc_guess_sizes(struct pipe_auth_data *auth, spnego_ctx = talloc_get_type_abort(auth->auth_ctx, struct spnego_context); status = spnego_get_negotiated_mech(spnego_ctx, - &auth_type, &auth_ctx); + &auth_type, &gensec_security); if (!NT_STATUS_IS_OK(status)) { return status; } - switch (auth_type) { - case SPNEGO_NTLMSSP: - gensec_security = talloc_get_type_abort(auth_ctx, - struct gensec_security); - *auth_len = gensec_sig_size(gensec_security, max_len); - break; - - case SPNEGO_KRB5: - gse_ctx = talloc_get_type_abort(auth_ctx, - struct gse_context); - if (!gse_ctx) { - return NT_STATUS_INVALID_PARAMETER; - } - *auth_len = gse_get_signature_length(gse_ctx, - seal, max_len); - break; - - default: - return NT_STATUS_INVALID_PARAMETER; - } + *auth_len = gensec_sig_size(gensec_security, max_len); break; case DCERPC_AUTH_TYPE_NTLMSSP: -- cgit