summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-12-30 10:14:07 +0100
committerGünther Deschner <gd@samba.org>2010-03-24 17:34:50 +0100
commit133a3e4ce81ea156461c5e8b922e234dbf1ce688 (patch)
tree20961d95b0a0b4fbfecb0c7c329a926e28476e5c
parentc33e72b8c53625247202a2247ec2f4f9bdd24e9e (diff)
downloadsamba-133a3e4ce81ea156461c5e8b922e234dbf1ce688.tar.gz
samba-133a3e4ce81ea156461c5e8b922e234dbf1ce688.tar.bz2
samba-133a3e4ce81ea156461c5e8b922e234dbf1ce688.zip
s4:ntlmssp: replace server_role by a server.is_standalone in (gensec_)ntlmssp_state
Inspired by the NTLMSSP merge work by Andrew Bartlett. metze Signed-off-by: Günther Deschner <gd@samba.org>
-rw-r--r--source4/auth/ntlmssp/ntlmssp.h6
-rw-r--r--source4/auth/ntlmssp/ntlmssp_server.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/source4/auth/ntlmssp/ntlmssp.h b/source4/auth/ntlmssp/ntlmssp.h
index 82e9ccfd06..44a1064e15 100644
--- a/source4/auth/ntlmssp/ntlmssp.h
+++ b/source4/auth/ntlmssp/ntlmssp.h
@@ -19,7 +19,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "librpc/gen_ndr/samr.h"
#include "../librpc/gen_ndr/ntlmssp.h"
/* NTLMSSP mode */
@@ -48,7 +47,6 @@ enum ntlmssp_message_type
struct gensec_ntlmssp_state
{
enum ntlmssp_role role;
- enum samr_Role server_role;
uint32_t expected_state;
bool unicode;
@@ -66,6 +64,10 @@ struct gensec_ntlmssp_state
const char *workstation;
char *server_domain;
+ struct {
+ bool is_standalone;
+ } server;
+
DATA_BLOB internal_chal; /* Random challenge as supplied to the client for NTLM authentication */
DATA_BLOB chal; /* Random challenge as input into the actual NTLM (or NTLM2) authentication */
diff --git a/source4/auth/ntlmssp/ntlmssp_server.c b/source4/auth/ntlmssp/ntlmssp_server.c
index 428178158d..484cf3f51d 100644
--- a/source4/auth/ntlmssp/ntlmssp_server.c
+++ b/source4/auth/ntlmssp/ntlmssp_server.c
@@ -92,7 +92,7 @@ static const char *ntlmssp_target_name(struct gensec_ntlmssp_state *gensec_ntlms
if (neg_flags & NTLMSSP_REQUEST_TARGET) {
*chal_flags |= NTLMSSP_NEGOTIATE_TARGET_INFO;
*chal_flags |= NTLMSSP_REQUEST_TARGET;
- if (gensec_ntlmssp_state->server_role == ROLE_STANDALONE) {
+ if (gensec_ntlmssp_state->server.is_standalone) {
*chal_flags |= NTLMSSP_TARGET_TYPE_SERVER;
return gensec_ntlmssp_state->server_name;
} else {
@@ -819,7 +819,11 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security)
gensec_ntlmssp_state->may_set_challenge = auth_ntlmssp_may_set_challenge;
gensec_ntlmssp_state->set_challenge = auth_ntlmssp_set_challenge;
gensec_ntlmssp_state->check_password = auth_ntlmssp_check_password;
- gensec_ntlmssp_state->server_role = lp_server_role(gensec_security->settings->lp_ctx);
+ if (lp_server_role(gensec_security->settings->lp_ctx) == ROLE_STANDALONE) {
+ gensec_ntlmssp_state->server.is_standalone = true;
+ } else {
+ gensec_ntlmssp_state->server.is_standalone = false;
+ }
return NT_STATUS_OK;
}