s3-ntlmssp Remove auth_ntlmssp_want_feature()
authorAndrew Bartlett <abartlet@samba.org>
Tue, 18 Oct 2011 10:43:40 +0000 (21:43 +1100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Oct 2011 06:43:33 +0000 (08:43 +0200)
We now just call the gensec_want_feature() directly.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/include/ntlmssp_wrap.h
source3/librpc/crypto/cli_spnego.c
source3/libsmb/clifsinfo.c
source3/libsmb/ntlmssp_wrap.c
source3/rpc_client/cli_pipe.c
source3/rpc_server/dcesrv_ntlmssp.c
source3/smbd/seal.c
source3/smbd/sesssetup.c
source3/smbd/smb2_sesssetup.c

index f58e63e85e653cfbef776ace7ed3573f5ab81e4a..ab1f9cb6aa19da2ab564449781f9eeb9158fdcdb 100644 (file)
@@ -40,7 +40,6 @@ NTSTATUS auth_ntlmssp_set_domain(struct auth_ntlmssp_state *ans,
                                 const char *domain);
 NTSTATUS auth_ntlmssp_set_password(struct auth_ntlmssp_state *ans,
                                   const char *password);
-void auth_ntlmssp_want_feature(struct auth_ntlmssp_state *ans, uint32_t feature);
 DATA_BLOB auth_ntlmssp_get_session_key(struct auth_ntlmssp_state *ans, 
                                       TALLOC_CTX *mem_ctx);
 
index 1320a95216f8769d16af128a436309826db814bc..31d01570690823bf951eb9b344e60a41e10f0a0b 100644 (file)
@@ -129,11 +129,11 @@ NTSTATUS spnego_ntlmssp_init_client(TALLOC_CTX *mem_ctx,
        }
 
        if (do_sign) {
-               auth_ntlmssp_want_feature(sp_ctx->mech_ctx.ntlmssp_state,
-                                         NTLMSSP_FEATURE_SIGN);
+               gensec_want_feature(sp_ctx->mech_ctx.ntlmssp_state->gensec_security,
+                                         GENSEC_FEATURE_SIGN);
        } else if (do_seal) {
-               auth_ntlmssp_want_feature(sp_ctx->mech_ctx.ntlmssp_state,
-                                         NTLMSSP_FEATURE_SEAL);
+               gensec_want_feature(sp_ctx->mech_ctx.ntlmssp_state->gensec_security,
+                                         GENSEC_FEATURE_SEAL);
        }
 
        status = auth_ntlmssp_client_start(sp_ctx->mech_ctx.ntlmssp_state);
index fa8dba5fbd023747724f37d6b72d18123953ed10..1762e85d7d33519262dfe5d2f00704d30e17a175 100644 (file)
@@ -620,8 +620,8 @@ NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli,
                goto fail;
        }
 
-       auth_ntlmssp_want_feature(es->s.auth_ntlmssp_state, NTLMSSP_FEATURE_SESSION_KEY);
-       auth_ntlmssp_want_feature(es->s.auth_ntlmssp_state, NTLMSSP_FEATURE_SEAL);
+       gensec_want_feature(es->s.auth_ntlmssp_state->gensec_security, GENSEC_FEATURE_SESSION_KEY);
+       gensec_want_feature(es->s.auth_ntlmssp_state->gensec_security, GENSEC_FEATURE_SEAL);
 
        if (!NT_STATUS_IS_OK(status = auth_ntlmssp_set_username(es->s.auth_ntlmssp_state, user))) {
                goto fail;
index a470444054704aa8a60f9ed081b23f43b6aa5263..557b6e02b3792cdc5376f61ccfb706ff2bec6e9d 100644 (file)
@@ -47,19 +47,6 @@ NTSTATUS auth_ntlmssp_set_password(struct auth_ntlmssp_state *ans,
        return NT_STATUS_OK;
 }
 
-void auth_ntlmssp_want_feature(struct auth_ntlmssp_state *ans, uint32_t feature)
-{
-       if (feature & NTLMSSP_FEATURE_SESSION_KEY) {
-               gensec_want_feature(ans->gensec_security, GENSEC_FEATURE_SESSION_KEY);
-       }
-       if (feature & NTLMSSP_FEATURE_SIGN) {
-               gensec_want_feature(ans->gensec_security, GENSEC_FEATURE_SIGN);
-       }
-       if (feature & NTLMSSP_FEATURE_SEAL) {
-               gensec_want_feature(ans->gensec_security, GENSEC_FEATURE_SEAL);
-       }
-}
-
 DATA_BLOB auth_ntlmssp_get_session_key(struct auth_ntlmssp_state *ans, TALLOC_CTX *mem_ctx)
 {
        DATA_BLOB session_key;
index 9af351b2748fea72e875e28ce904ca48ce558689..9a2aa409a0828e2a092d0cd2142d09ca37c7b61b 100644 (file)
@@ -2306,9 +2306,9 @@ static NTSTATUS rpccli_ntlmssp_bind_data(TALLOC_CTX *mem_ctx,
        }
 
        if (auth_level == DCERPC_AUTH_LEVEL_INTEGRITY) {
-               auth_ntlmssp_want_feature(ntlmssp_ctx, NTLMSSP_FEATURE_SIGN);
+               gensec_want_feature(ntlmssp_ctx->gensec_security, GENSEC_FEATURE_SIGN);
        } else if (auth_level == DCERPC_AUTH_LEVEL_PRIVACY) {
-               auth_ntlmssp_want_feature(ntlmssp_ctx, NTLMSSP_FEATURE_SEAL);
+               gensec_want_feature(ntlmssp_ctx->gensec_security, GENSEC_FEATURE_SEAL);
        }
 
        status = auth_ntlmssp_client_start(ntlmssp_ctx);
index 221b3bfbbe1825ad08a8e7d5b73ea1d86d7e02c7..8700726c256118c5fd429edea310b841d9ff338d 100644 (file)
@@ -45,11 +45,11 @@ NTSTATUS ntlmssp_server_auth_start(TALLOC_CTX *mem_ctx,
        }
 
        if (do_sign) {
-               auth_ntlmssp_want_feature(a, NTLMSSP_FEATURE_SIGN);
+               gensec_want_feature(a->gensec_security, GENSEC_FEATURE_SIGN);
        }
        if (do_seal) {
                /* Always implies both sign and seal for ntlmssp */
-               auth_ntlmssp_want_feature(a, NTLMSSP_FEATURE_SEAL);
+               gensec_want_feature(a->gensec_security, GENSEC_FEATURE_SEAL);
        }
 
        status = auth_ntlmssp_start(a);
index f1508d4d4f858bd3110d8000653ccc6d2152b1e4..03313a80ac88714bbbc4eed7876088d42ece123d 100644 (file)
@@ -94,7 +94,7 @@ static NTSTATUS make_auth_ntlmssp(const struct tsocket_address *remote_address,
                return nt_status_squash(status);
        }
 
-       auth_ntlmssp_want_feature(ec->auth_ntlmssp_state, NTLMSSP_FEATURE_SEAL);
+       gensec_want_feature(ec->auth_ntlmssp_state->gensec_security, GENSEC_FEATURE_SEAL);
 
        status = auth_ntlmssp_start(ec->auth_ntlmssp_state);
 
index 7729ff675b62de3e557e4e37e2b4a98f62dbd41f..5fa571a0e9cbbfad6aebad55aab0cc9e7cf5fda0 100644 (file)
@@ -634,7 +634,7 @@ static void reply_spnego_negotiate(struct smb_request *req,
                return;
        }
 
-       auth_ntlmssp_want_feature(*auth_ntlmssp_state, NTLMSSP_FEATURE_SESSION_KEY);
+       gensec_want_feature((*auth_ntlmssp_state)->gensec_security, GENSEC_FEATURE_SESSION_KEY);
 
        status = auth_ntlmssp_start(*auth_ntlmssp_state);
        if (!NT_STATUS_IS_OK(status)) {
@@ -746,7 +746,7 @@ static void reply_spnego_auth(struct smb_request *req,
                        return;
                }
 
-               auth_ntlmssp_want_feature(*auth_ntlmssp_state, NTLMSSP_FEATURE_SESSION_KEY);
+               gensec_want_feature((*auth_ntlmssp_state)->gensec_security, GENSEC_FEATURE_SESSION_KEY);
 
                status = auth_ntlmssp_start(*auth_ntlmssp_state);
                if (!NT_STATUS_IS_OK(status)) {
@@ -1155,7 +1155,7 @@ static void reply_sesssetup_and_X_spnego(struct smb_request *req)
                                return;
                        }
 
-                       auth_ntlmssp_want_feature(vuser->auth_ntlmssp_state, NTLMSSP_FEATURE_SESSION_KEY);
+                       gensec_want_feature(vuser->auth_ntlmssp_state->gensec_security, GENSEC_FEATURE_SESSION_KEY);
 
                        if (sconn->use_gensec_hook) {
                                status = auth_generic_start(vuser->auth_ntlmssp_state, GENSEC_OID_SPNEGO);
index 059b26f0bfbefc9cae7666271bd74f90c48aa11f..6e06b9fe00e207fb9ea8697c8cfb209316302c6f 100644 (file)
@@ -381,7 +381,7 @@ static NTSTATUS smbd_smb2_spnego_negotiate(struct smbd_smb2_session *session,
                        goto out;
                }
 
-               auth_ntlmssp_want_feature(session->auth_ntlmssp_state, NTLMSSP_FEATURE_SESSION_KEY);
+               gensec_want_feature(session->auth_ntlmssp_state->gensec_security, GENSEC_FEATURE_SESSION_KEY);
 
                status = auth_ntlmssp_start(session->auth_ntlmssp_state);
                if (!NT_STATUS_IS_OK(status)) {
@@ -572,7 +572,7 @@ static NTSTATUS smbd_smb2_spnego_auth(struct smbd_smb2_session *session,
                        return status;
                }
 
-               auth_ntlmssp_want_feature(session->auth_ntlmssp_state, NTLMSSP_FEATURE_SESSION_KEY);
+               gensec_want_feature(session->auth_ntlmssp_state->gensec_security, GENSEC_FEATURE_SESSION_KEY);
 
                status = auth_ntlmssp_start(session->auth_ntlmssp_state);
                if (!NT_STATUS_IS_OK(status)) {
@@ -648,7 +648,7 @@ static NTSTATUS smbd_smb2_raw_ntlmssp_auth(struct smbd_smb2_session *session,
                        return status;
                }
 
-               auth_ntlmssp_want_feature(session->auth_ntlmssp_state, NTLMSSP_FEATURE_SESSION_KEY);
+               gensec_want_feature(session->auth_ntlmssp_state->gensec_security, GENSEC_FEATURE_SESSION_KEY);
 
                if (session->sconn->use_gensec_hook) {
                        status = auth_generic_start(session->auth_ntlmssp_state, GENSEC_OID_SPNEGO);