summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-10-17 20:19:11 +1100
committerAndrew Bartlett <abartlet@samba.org>2011-10-18 12:25:30 +0200
commitf9b042641f9c6615f6a4b102f0182de545d6a19a (patch)
tree3697a6f9e7d87c77e2a451fc384aca3e8bb981a1 /source3/libsmb
parentf3333bdade7d54b19bfcdc2addc685abd165eddf (diff)
downloadsamba-f9b042641f9c6615f6a4b102f0182de545d6a19a.tar.gz
samba-f9b042641f9c6615f6a4b102f0182de545d6a19a.tar.bz2
samba-f9b042641f9c6615f6a4b102f0182de545d6a19a.zip
s3-ntlmssp split auth_ntlmssp_client_start() into two parts
This will allow it to be a wrapper around a gensec module, which requires that they options be set on a context, but before the mechanism is started. This also simplfies the callers, by moving the lp_*() calls into one place. Andrew Bartlett
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clifsinfo.c11
-rw-r--r--source3/libsmb/ntlmssp_wrap.c16
2 files changed, 16 insertions, 11 deletions
diff --git a/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c
index 12961c9390..b312cfbd48 100644
--- a/source3/libsmb/clifsinfo.c
+++ b/source3/libsmb/clifsinfo.c
@@ -613,11 +613,8 @@ NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli,
if (!es) {
return NT_STATUS_NO_MEMORY;
}
- status = auth_ntlmssp_client_start(NULL,
- lp_netbios_name(),
- lp_workgroup(),
- lp_client_ntlmv2_auth(),
- &es->s.auth_ntlmssp_state);
+ status = auth_ntlmssp_client_prepare(NULL,
+ &es->s.auth_ntlmssp_state);
if (!NT_STATUS_IS_OK(status)) {
goto fail;
}
@@ -635,6 +632,10 @@ NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli,
goto fail;
}
+ if (!NT_STATUS_IS_OK(status = auth_ntlmssp_client_start(es->s.auth_ntlmssp_state))) {
+ goto fail;
+ }
+
do {
status = auth_ntlmssp_update(es->s.auth_ntlmssp_state, es->s.auth_ntlmssp_state,
blob_in, &blob_out);
diff --git a/source3/libsmb/ntlmssp_wrap.c b/source3/libsmb/ntlmssp_wrap.c
index 6f854f25cd..5f8e246398 100644
--- a/source3/libsmb/ntlmssp_wrap.c
+++ b/source3/libsmb/ntlmssp_wrap.c
@@ -176,10 +176,7 @@ NTSTATUS auth_ntlmssp_update(struct auth_ntlmssp_state *ans,
return status;
}
-NTSTATUS auth_ntlmssp_client_start(TALLOC_CTX *mem_ctx,
- const char *netbios_name,
- const char *netbios_domain,
- bool use_ntlmv2,
+NTSTATUS auth_ntlmssp_client_prepare(TALLOC_CTX *mem_ctx,
struct auth_ntlmssp_state **_ans)
{
struct auth_ntlmssp_state *ans;
@@ -188,8 +185,8 @@ NTSTATUS auth_ntlmssp_client_start(TALLOC_CTX *mem_ctx,
ans = talloc_zero(mem_ctx, struct auth_ntlmssp_state);
status = ntlmssp_client_start(ans,
- netbios_name, netbios_domain,
- use_ntlmv2, &ans->ntlmssp_state);
+ lp_netbios_name(), lp_workgroup(),
+ lp_client_ntlmv2_auth(), &ans->ntlmssp_state);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -197,3 +194,10 @@ NTSTATUS auth_ntlmssp_client_start(TALLOC_CTX *mem_ctx,
*_ans = ans;
return NT_STATUS_OK;
}
+
+NTSTATUS auth_ntlmssp_client_start(struct auth_ntlmssp_state *ans)
+{
+ NTSTATUS status;
+
+ return NT_STATUS_OK;
+}