r4358: At metze's request, the Christmas elves have removed gensec_end in
[samba.git] / source4 / smb_server / sesssetup.c
index 8f55df58d268f69ba6bb20d3f4e9a96d52df5816..dcecc1327cd179f0679b66b26b662156eb0b246f 100644 (file)
@@ -23,7 +23,8 @@
 
 #include "includes.h"
 #include "auth/auth.h"
-#include "asn_1.h"
+#include "smb_server/smb_server.h"
+
 
 /*
   setup the OS, Lanman and domain portions of a session setup reply
@@ -237,9 +238,11 @@ static NTSTATUS sesssetup_spnego(struct smbsrv_request *req, union smb_sesssetup
                        return status;
                }
 
-               gensec_want_feature(gensec_ctx, GENSEC_WANT_SESSION_KEY);
+               gensec_set_target_service(gensec_ctx, "cifs");
+
+               gensec_want_feature(gensec_ctx, GENSEC_FEATURE_SESSION_KEY);
 
-               status = gensec_start_mech_by_oid(gensec_ctx, OID_SPNEGO);
+               status = gensec_start_mech_by_oid(gensec_ctx, GENSEC_OID_SPNEGO);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(1, ("Failed to start GENSEC SPNEGO server code: %s\n", nt_errstr(status)));
                        return status;
@@ -284,7 +287,8 @@ static NTSTATUS sesssetup_spnego(struct smbsrv_request *req, union smb_sesssetup
                status = nt_status_squash(status);
                if (smb_sess->gensec_ctx && 
                    !NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
-                       gensec_end(&smb_sess->gensec_ctx);
+                       talloc_free(smb_sess->gensec_ctx);
+                       smb_sess->gensec_ctx = NULL;
                }
        }