summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-02-07 17:12:19 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-02-24 11:23:18 +1100
commit83810f8afad85818edb7a21428dbbef305147b8c (patch)
tree35d58dca93aaf79c09182bc77af4548a021658a6
parenta61298e8028574d10358e2d53c956f74ab641ef4 (diff)
downloadsamba-83810f8afad85818edb7a21428dbbef305147b8c.tar.gz
samba-83810f8afad85818edb7a21428dbbef305147b8c.tar.bz2
samba-83810f8afad85818edb7a21428dbbef305147b8c.zip
auth: consolidate gensec_ntlmssp_server wrapper functions
-rw-r--r--auth/ntlmssp/gensec_ntlmssp_server.c41
-rw-r--r--auth/ntlmssp/ntlmssp_server.c27
2 files changed, 18 insertions, 50 deletions
diff --git a/auth/ntlmssp/gensec_ntlmssp_server.c b/auth/ntlmssp/gensec_ntlmssp_server.c
index ba32a2b1b0..61d0afff61 100644
--- a/auth/ntlmssp/gensec_ntlmssp_server.c
+++ b/auth/ntlmssp/gensec_ntlmssp_server.c
@@ -34,47 +34,6 @@
#include "auth/common_auth.h"
#include "param/param.h"
-/**
- * Next state function for the Negotiate packet (GENSEC wrapper)
- *
- * @param gensec_security GENSEC state
- * @param out_mem_ctx Memory context for *out
- * @param in The request, as a DATA_BLOB. reply.data must be NULL
- * @param out The reply, as an allocated DATA_BLOB, caller to free.
- * @return Errors or MORE_PROCESSING_REQUIRED if (normal) a reply is required.
- */
-
-NTSTATUS gensec_ntlmssp_server_negotiate(struct gensec_security *gensec_security,
- TALLOC_CTX *out_mem_ctx,
- const DATA_BLOB request, DATA_BLOB *reply)
-{
- struct gensec_ntlmssp_context *gensec_ntlmssp =
- talloc_get_type_abort(gensec_security->private_data,
- struct gensec_ntlmssp_context);
- struct ntlmssp_state *ntlmssp_state = gensec_ntlmssp->ntlmssp_state;
- return ntlmssp_server_negotiate(ntlmssp_state, out_mem_ctx, request, reply);
-}
-
-/**
- * Next state function for the Authenticate packet (GENSEC wrapper)
- *
- * @param gensec_security GENSEC state
- * @param out_mem_ctx Memory context for *out
- * @param in The request, as a DATA_BLOB. reply.data must be NULL
- * @param out The reply, as an allocated DATA_BLOB, caller to free.
- * @return Errors or NT_STATUS_OK if authentication sucessful
- */
-
-NTSTATUS gensec_ntlmssp_server_auth(struct gensec_security *gensec_security,
- TALLOC_CTX *out_mem_ctx,
- const DATA_BLOB in, DATA_BLOB *out)
-{
- struct gensec_ntlmssp_context *gensec_ntlmssp =
- talloc_get_type_abort(gensec_security->private_data,
- struct gensec_ntlmssp_context);
- struct ntlmssp_state *ntlmssp_state = gensec_ntlmssp->ntlmssp_state;
- return ntlmssp_server_auth(ntlmssp_state, out_mem_ctx, in, out);
-}
/**
* Return the challenge as determined by the authentication subsystem
diff --git a/auth/ntlmssp/ntlmssp_server.c b/auth/ntlmssp/ntlmssp_server.c
index 1a498e8f74..2faac72e6f 100644
--- a/auth/ntlmssp/ntlmssp_server.c
+++ b/auth/ntlmssp/ntlmssp_server.c
@@ -27,6 +27,7 @@
#include "auth/ntlmssp/ntlmssp_ndr.h"
#include "../libcli/auth/libcli_auth.h"
#include "../lib/crypto/crypto.h"
+#include "auth/gensec/gensec.h"
/**
* Determine correct target name flags for reply, given server role
@@ -57,19 +58,23 @@ const char *ntlmssp_target_name(struct ntlmssp_state *ntlmssp_state,
}
/**
- * Next state function for the Negotiate packet
+ * Next state function for the NTLMSSP Negotiate packet
*
- * @param ntlmssp_state NTLMSSP state
+ * @param gensec_security GENSEC state
* @param out_mem_ctx Memory context for *out
* @param in The request, as a DATA_BLOB. reply.data must be NULL
* @param out The reply, as an allocated DATA_BLOB, caller to free.
* @return Errors or MORE_PROCESSING_REQUIRED if (normal) a reply is required.
*/
-NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state,
- TALLOC_CTX *out_mem_ctx,
- const DATA_BLOB request, DATA_BLOB *reply)
+NTSTATUS gensec_ntlmssp_server_negotiate(struct gensec_security *gensec_security,
+ TALLOC_CTX *out_mem_ctx,
+ const DATA_BLOB request, DATA_BLOB *reply)
{
+ struct gensec_ntlmssp_context *gensec_ntlmssp =
+ talloc_get_type_abort(gensec_security->private_data,
+ struct gensec_ntlmssp_context);
+ struct ntlmssp_state *ntlmssp_state = gensec_ntlmssp->ntlmssp_state;
DATA_BLOB struct_blob;
uint32_t neg_flags = 0;
uint32_t ntlmssp_command, chal_flags;
@@ -525,7 +530,7 @@ static NTSTATUS ntlmssp_server_postauth(struct ntlmssp_state *ntlmssp_state,
/**
- * Next state function for the Authenticate packet
+ * Next state function for the NTLMSSP Authenticate packet
*
* @param gensec_security GENSEC state
* @param out_mem_ctx Memory context for *out
@@ -534,10 +539,14 @@ static NTSTATUS ntlmssp_server_postauth(struct ntlmssp_state *ntlmssp_state,
* @return Errors or NT_STATUS_OK if authentication sucessful
*/
-NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
- TALLOC_CTX *out_mem_ctx,
- const DATA_BLOB in, DATA_BLOB *out)
+NTSTATUS gensec_ntlmssp_server_auth(struct gensec_security *gensec_security,
+ TALLOC_CTX *out_mem_ctx,
+ const DATA_BLOB in, DATA_BLOB *out)
{
+ struct gensec_ntlmssp_context *gensec_ntlmssp =
+ talloc_get_type_abort(gensec_security->private_data,
+ struct gensec_ntlmssp_context);
+ struct ntlmssp_state *ntlmssp_state = gensec_ntlmssp->ntlmssp_state;
struct ntlmssp_server_auth_state *state;
NTSTATUS nt_status;