Remove auth/ntlm as a dependency of GENSEC by means of function pointers.
[metze/samba/wip.git] / source4 / smb_server / smb / sesssetup.c
index 0767a187e58911705baf1f502b3e8ad64fd14656..e38447703ba103c8a4e1351985f413255647916e 100644 (file)
@@ -363,20 +363,18 @@ static void sesssetup_spnego(struct smbsrv_request *req, union smb_sesssetup *se
        if (!smb_sess) {
                struct gensec_security *gensec_ctx;
 
-               status = gensec_server_start(req,
-                                            req->smb_conn->connection->event.ctx,
-                                            lp_gensec_settings(req, req->smb_conn->lp_ctx),
-                                            req->smb_conn->connection->msg_ctx,
-                                            &gensec_ctx);
+               status = samba_server_gensec_start(req,
+                                                  req->smb_conn->connection->event.ctx,
+                                                  req->smb_conn->connection->msg_ctx,
+                                                  req->smb_conn->lp_ctx,
+                                                  req->smb_conn->negotiate.server_credentials,
+                                                  "cifs",
+                                                  &gensec_ctx);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(1, ("Failed to start GENSEC server code: %s\n", nt_errstr(status)));
                        goto failed;
                }
 
-               gensec_set_credentials(gensec_ctx, req->smb_conn->negotiate.server_credentials);
-
-               gensec_set_target_service(gensec_ctx, "cifs");
-
                gensec_want_feature(gensec_ctx, GENSEC_FEATURE_SESSION_KEY);
 
                status = gensec_start_mech_by_oid(gensec_ctx, req->smb_conn->negotiate.oid);