summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-01-16 04:40:07 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-01-16 04:40:07 +0000
commit30ddea1f05a83cde1dc3ef72583ec7ba04d1d013 (patch)
tree149ee3e134d87dc44816828e46dd71bf6a3abb9c
parent70bf249cfb83ee1836bf8d16b0f74e60b873b9ba (diff)
downloadsamba-30ddea1f05a83cde1dc3ef72583ec7ba04d1d013.tar.gz
samba-30ddea1f05a83cde1dc3ef72583ec7ba04d1d013.tar.bz2
samba-30ddea1f05a83cde1dc3ef72583ec7ba04d1d013.zip
(missed in last commit)
Change the 'cookie' to be the ntlmssp_context, and use the 'auth_context' on that to store the cookie. Ensures that simple callbacks can 'just work'. Also make it clear that we are doing a pull_string into a pstring, not just any sized buffer. Andrew Bartlett (This used to be commit c7793f27188e658b7fc6336aa51d367eab36fc17)
-rw-r--r--source3/libsmb/clispnego.c2
-rw-r--r--source3/libsmb/ntlmssp.c13
2 files changed, 9 insertions, 6 deletions
diff --git a/source3/libsmb/clispnego.c b/source3/libsmb/clispnego.c
index 6a5f6c00ae..f4a414ef52 100644
--- a/source3/libsmb/clispnego.c
+++ b/source3/libsmb/clispnego.c
@@ -749,7 +749,7 @@ BOOL msrpc_parse(DATA_BLOB *blob,
break;
case 'C':
s = va_arg(ap, char *);
- head_ofs += pull_string(NULL, p, blob->data+head_ofs, -1,
+ head_ofs += pull_string(NULL, p, blob->data+head_ofs, sizeof(p),
blob->length - head_ofs,
STR_ASCII|STR_TERMINATE);
if (strcmp(s, p) != 0) {
diff --git a/source3/libsmb/ntlmssp.c b/source3/libsmb/ntlmssp.c
index 21f3612034..6837674736 100644
--- a/source3/libsmb/ntlmssp.c
+++ b/source3/libsmb/ntlmssp.c
@@ -29,7 +29,7 @@
*/
-static const uint8 *get_challenge(void *cookie)
+static const uint8 *get_challenge(struct ntlmssp_state *ntlmssp_state)
{
static uchar chal[8];
generate_random_buffer(chal, sizeof(chal), False);
@@ -57,6 +57,7 @@ NTSTATUS ntlmssp_server_start(NTLMSSP_STATE **ntlmssp_state)
(*ntlmssp_state)->get_global_myname = global_myname;
(*ntlmssp_state)->get_domain = lp_workgroup;
+ (*ntlmssp_state)->server_role = ROLE_DOMAIN_MEMBER; /* a good default */
return NT_STATUS_OK;
}
@@ -82,10 +83,12 @@ NTSTATUS ntlmssp_server_update(NTLMSSP_STATE *ntlmssp_state,
DATA_BLOB request, DATA_BLOB *reply)
{
uint32 ntlmssp_command;
-
+ *reply = data_blob(NULL, 0);
+
if (!msrpc_parse(&request, "Cd",
"NTLMSSP",
&ntlmssp_command)) {
+
return NT_STATUS_LOGON_FAILURE;
}
@@ -104,7 +107,7 @@ static const char *ntlmssp_target_name(NTLMSSP_STATE *ntlmssp_state,
if (neg_flags & NTLMSSP_REQUEST_TARGET) {
*chal_flags |= NTLMSSP_CHAL_TARGET_INFO;
*chal_flags |= NTLMSSP_REQUEST_TARGET;
- if (lp_server_role() == ROLE_STANDALONE) {
+ if (ntlmssp_state->server_role == ROLE_STANDALONE) {
*chal_flags |= NTLMSSP_TARGET_TYPE_SERVER;
return ntlmssp_state->get_global_myname();
} else {
@@ -145,7 +148,7 @@ NTSTATUS ntlmssp_negotiate(NTLMSSP_STATE *ntlmssp_state,
debug_ntlmssp_flags(neg_flags);
- cryptkey = ntlmssp_state->get_challenge(ntlmssp_state->auth_context);
+ cryptkey = ntlmssp_state->get_challenge(ntlmssp_state);
data_blob_free(&ntlmssp_state->chal);
ntlmssp_state->chal = data_blob(cryptkey, 8);
@@ -270,7 +273,7 @@ NTSTATUS ntlmssp_auth(NTLMSSP_STATE *ntlmssp_state,
file_save("lmhash1.dat", &ntlmssp_state->lm_resp.data, &ntlmssp_state->lm_resp.length);
#endif
- nt_status = ntlmssp_state->check_password(ntlmssp_state->auth_context);
+ nt_status = ntlmssp_state->check_password(ntlmssp_state);
if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;