s3-auth Use the common gensec_ntlmssp_update in gensec_ntlmssp3_server
authorAndrew Bartlett <abartlet@samba.org>
Tue, 31 Jan 2012 03:43:25 +0000 (14:43 +1100)
committerStefan Metzmacher <metze@samba.org>
Fri, 17 Feb 2012 09:48:09 +0000 (10:48 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
auth/ntlmssp/ntlmssp.c
auth/ntlmssp/ntlmssp_private.h
source3/Makefile.in
source3/auth/auth_ntlmssp.c

index 720a815..71e0186 100644 (file)
@@ -138,10 +138,10 @@ static NTSTATUS gensec_ntlmssp_update_find(struct ntlmssp_state *ntlmssp_state,
  *                or NT_STATUS_OK if the user is authenticated.
  */
 
-static NTSTATUS gensec_ntlmssp_update(struct gensec_security *gensec_security,
-                                     TALLOC_CTX *out_mem_ctx,
-                                     struct tevent_context *ev,
-                                     const DATA_BLOB input, DATA_BLOB *out)
+NTSTATUS gensec_ntlmssp_update(struct gensec_security *gensec_security,
+                              TALLOC_CTX *out_mem_ctx,
+                              struct tevent_context *ev,
+                              const DATA_BLOB input, DATA_BLOB *out)
 {
        struct gensec_ntlmssp_context *gensec_ntlmssp =
                talloc_get_type_abort(gensec_security->private_data,
index e7fa3d5..7953d8e 100644 (file)
@@ -43,6 +43,13 @@ union ntlmssp_crypt_state {
 
 /* The following definitions come from auth/ntlmssp.c  */
 
+NTSTATUS gensec_ntlmssp_update(struct gensec_security *gensec_security,
+                              TALLOC_CTX *out_mem_ctx,
+                              struct tevent_context *ev,
+                              const DATA_BLOB input, DATA_BLOB *out);
+
+/* The following definitions come from auth/ntlmssp_util.c  */
+
 void debug_ntlmssp_flags(uint32_t neg_flags);
 void ntlmssp_handle_neg_flags(struct ntlmssp_state *ntlmssp_state,
                              uint32_t neg_flags, bool allow_lm);
index 0425cd7..b4b2a98 100644 (file)
@@ -566,8 +566,10 @@ LIBSMB_OBJ0 = \
               ../auth/credentials/credentials.o \
               ../auth/credentials/credentials_ntlm.o \
               ../auth/credentials/credentials_samba3.o \
+              ../auth/ntlmssp/ntlmssp.o \
               ../auth/ntlmssp/ntlmssp_util.o \
               ../auth/ntlmssp/ntlmssp_sign.o \
+              ../auth/ntlmssp/ntlmssp_client.o \
               ../auth/ntlmssp/gensec_ntlmssp.o \
               ../auth/ntlmssp/gensec_ntlmssp_server.o \
               $(LIBNDR_NTLMSSP_OBJ) \
index b9d4b72..027666f 100644 (file)
@@ -57,26 +57,6 @@ NTSTATUS auth3_generate_session_info(TALLOC_CTX *mem_ctx,
        return NT_STATUS_OK;
 }
 
-static NTSTATUS gensec_ntlmssp3_server_update(struct gensec_security *gensec_security,
-                                             TALLOC_CTX *out_mem_ctx,
-                                             struct tevent_context *ev,
-                                             const DATA_BLOB request,
-                                             DATA_BLOB *reply)
-{
-       NTSTATUS status;
-       struct gensec_ntlmssp_context *gensec_ntlmssp =
-               talloc_get_type_abort(gensec_security->private_data,
-                                     struct gensec_ntlmssp_context);
-
-       status = ntlmssp_update(gensec_ntlmssp->ntlmssp_state, request, reply);
-       if (NT_STATUS_IS_OK(status) ||
-           NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
-               talloc_steal(out_mem_ctx, reply->data);
-       }
-
-       return status;
-}
-
 /**
  * Return the challenge as determined by the authentication subsystem 
  * @return an 8 byte random challenge
@@ -298,7 +278,7 @@ const struct gensec_security_ops gensec_ntlmssp3_server_ops = {
        .oid            = gensec_ntlmssp3_server_oids,
        .server_start   = gensec_ntlmssp3_server_start,
        .magic          = gensec_ntlmssp_magic,
-       .update         = gensec_ntlmssp3_server_update,
+       .update         = gensec_ntlmssp_update,
        .sig_size       = gensec_ntlmssp_sig_size,
        .sign_packet    = gensec_ntlmssp_sign_packet,
        .check_packet   = gensec_ntlmssp_check_packet,