summaryrefslogtreecommitdiff
path: root/source3/libsmb/ntlmssp.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-12-27 19:16:14 +1100
committerStefan Metzmacher <metze@samba.org>2012-01-06 13:18:40 +0100
commit60c66118b3a076aee59e581a263c045a205e5ed5 (patch)
treede622042dec25546ce1a4c7781ef270d81420f2c /source3/libsmb/ntlmssp.c
parentaf19532d4dbbf4cd0cf7142b9469d04bd5c722a8 (diff)
downloadsamba-60c66118b3a076aee59e581a263c045a205e5ed5.tar.gz
samba-60c66118b3a076aee59e581a263c045a205e5ed5.tar.bz2
samba-60c66118b3a076aee59e581a263c045a205e5ed5.zip
ntlmssp: merge initial packet implementations
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/libsmb/ntlmssp.c')
-rw-r--r--source3/libsmb/ntlmssp.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/source3/libsmb/ntlmssp.c b/source3/libsmb/ntlmssp.c
index 01cc1cc02e..866ce9218b 100644
--- a/source3/libsmb/ntlmssp.c
+++ b/source3/libsmb/ntlmssp.c
@@ -33,7 +33,7 @@
#include "../nsswitch/libwbclient/wbclient.h"
static NTSTATUS ntlmssp_client_initial(struct ntlmssp_state *ntlmssp_state,
- TALLOC_CTX *out_mem_ctx, /* Unused at this time */
+ TALLOC_CTX *out_mem_ctx,
DATA_BLOB reply, DATA_BLOB *next_request);
static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state,
TALLOC_CTX *out_mem_ctx, /* Unused at this time */
@@ -374,11 +374,22 @@ NTSTATUS ntlmssp_server_start(TALLOC_CTX *mem_ctx,
*/
static NTSTATUS ntlmssp_client_initial(struct ntlmssp_state *ntlmssp_state,
- TALLOC_CTX *out_mem_ctx, /* Unused at this time */
- DATA_BLOB reply, DATA_BLOB *next_request)
+ TALLOC_CTX *out_mem_ctx,
+ DATA_BLOB in, DATA_BLOB *out)
{
+ const char *domain = ntlmssp_state->client.netbios_domain;
+ const char *workstation = ntlmssp_state->client.netbios_name;
NTSTATUS status;
+ /* These don't really matter in the initial packet, so don't panic if they are not set */
+ if (!domain) {
+ domain = "";
+ }
+
+ if (!workstation) {
+ workstation = "";
+ }
+
if (ntlmssp_state->unicode) {
ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_UNICODE;
} else {
@@ -390,15 +401,17 @@ static NTSTATUS ntlmssp_client_initial(struct ntlmssp_state *ntlmssp_state,
}
/* generate the ntlmssp negotiate packet */
- status = msrpc_gen(ntlmssp_state, next_request, "CddAA",
+ status = msrpc_gen(out_mem_ctx,
+ out, "CddAA",
"NTLMSSP",
NTLMSSP_NEGOTIATE,
ntlmssp_state->neg_flags,
- ntlmssp_state->client.netbios_domain,
- ntlmssp_state->client.netbios_name);
+ domain,
+ workstation);
+
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("ntlmssp_client_initial: failed to generate "
- "ntlmssp negotiate packet\n"));
+ "ntlmssp negotiate packet\n"));
return status;
}
@@ -407,7 +420,7 @@ static NTSTATUS ntlmssp_client_initial(struct ntlmssp_state *ntlmssp_state,
talloc_tos(), struct NEGOTIATE_MESSAGE);
if (negotiate != NULL) {
status = ntlmssp_pull_NEGOTIATE_MESSAGE(
- next_request, negotiate, negotiate);
+ out, negotiate, negotiate);
if (NT_STATUS_IS_OK(status)) {
NDR_PRINT_DEBUG(NEGOTIATE_MESSAGE,
negotiate);