]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: rework reply_spnego_ntlmssp to reply_spnego_generic
authorStefan Metzmacher <metze@samba.org>
Fri, 13 Jan 2012 12:20:27 +0000 (13:20 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 31 Jan 2012 19:17:10 +0000 (20:17 +0100)
This removes the unused spnego_gen_auth_response() wrapping.

metze

source3/smbd/sesssetup.c

index 2c0587803d70971ef1348ca00d64be0c28f3133a..a42d0d0a48345631cfb25b91141cbfb961ae44e7 100644 (file)
@@ -130,23 +130,12 @@ static NTSTATUS check_guest_password(const struct tsocket_address *remote_addres
        return nt_status;
 }
 
-/****************************************************************************
- Send a session setup reply, wrapped in SPNEGO.
- Get vuid and check first.
- End the NTLMSSP exchange context if we are OK/complete fail
- This should be split into two functions, one to handle each
- leg of the NTLM auth steps.
-***************************************************************************/
-
-static void reply_spnego_ntlmssp(struct smb_request *req,
+static void reply_spnego_generic(struct smb_request *req,
                                 uint16 vuid,
                                 struct gensec_security **gensec_security,
-                                DATA_BLOB *ntlmssp_blob, NTSTATUS nt_status,
-                                const char *OID,
-                                bool wrap)
+                                DATA_BLOB *blob, NTSTATUS nt_status)
 {
        bool do_invalidate = true;
-       DATA_BLOB response;
        struct auth_session_info *session_info = NULL;
        struct smbd_server_connection *sconn = req->sconn;
 
@@ -193,18 +182,7 @@ static void reply_spnego_ntlmssp(struct smb_request *req,
 
   out:
 
-       if (wrap) {
-               response = spnego_gen_auth_response(talloc_tos(),
-                               ntlmssp_blob,
-                               nt_status, OID);
-       } else {
-               response = *ntlmssp_blob;
-       }
-
-       reply_sesssetup_blob(req, response, nt_status);
-       if (wrap) {
-               data_blob_free(&response);
-       }
+       reply_sesssetup_blob(req, *blob, nt_status);
 
        /* NT_STATUS_MORE_PROCESSING_REQUIRED from our NTLMSSP code tells us,
           and the other end, that we are not finished yet. */
@@ -360,9 +338,9 @@ static void reply_sesssetup_and_X_spnego(struct smb_request *req)
 
        data_blob_free(&blob1);
 
-       reply_spnego_ntlmssp(req, vuid,
+       reply_spnego_generic(req, vuid,
                             &vuser->gensec_security,
-                            &chal, status, NULL, false);
+                            &chal, status);
        data_blob_free(&chal);
        return;
 }