summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-11-02 19:07:45 +0100
committerStefan Metzmacher <metze@samba.org>2011-11-03 16:55:13 +0100
commitcaa134672c053f56360ef602b7f8b9d66b216ad3 (patch)
tree318f702fce63bc308d8cbe59f0066cd1f1ef0ba8 /source3
parent7de694974eb234ed45f907196f6415da998b23da (diff)
downloadsamba-caa134672c053f56360ef602b7f8b9d66b216ad3.tar.gz
samba-caa134672c053f56360ef602b7f8b9d66b216ad3.tar.bz2
samba-caa134672c053f56360ef602b7f8b9d66b216ad3.zip
s3:smbd: make use of SMB_SIGNING_* constants
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/negprot.c9
-rw-r--r--source3/smbd/signing.c7
-rw-r--r--source3/smbd/smb2_negprot.c2
-rw-r--r--source3/smbd/smb2_sesssetup.c4
4 files changed, 12 insertions, 10 deletions
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index a0ed52d659..3afa8b19e3 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -368,16 +368,16 @@ static void reply_nt1(struct smb_request *req, uint16 choice)
secword |= NEGOTIATE_SECURITY_CHALLENGE_RESPONSE;
}
- if (lp_server_signing()) {
+ if (lp_server_signing() != SMB_SIGNING_OFF) {
if (lp_security() >= SEC_USER) {
secword |= NEGOTIATE_SECURITY_SIGNATURES_ENABLED;
/* No raw mode with smb signing. */
capabilities &= ~CAP_RAW_MODE;
- if (lp_server_signing() == Required)
+ if (lp_server_signing() == SMB_SIGNING_REQUIRED)
secword |=NEGOTIATE_SECURITY_SIGNATURES_REQUIRED;
} else {
DEBUG(0,("reply_nt1: smb signing is incompatible with share level security !\n"));
- if (lp_server_signing() == Required) {
+ if (lp_server_signing() == SMB_SIGNING_REQUIRED) {
exit_server_cleanly("reply_nt1: smb signing required and share level security selected.");
}
}
@@ -736,7 +736,8 @@ void reply_negprot(struct smb_request *req)
DEBUG( 5, ( "negprot index=%d\n", choice ) );
- if ((lp_server_signing() == Required) && (get_Protocol() < PROTOCOL_NT1)) {
+ if ((lp_server_signing() == SMB_SIGNING_REQUIRED)
+ && (get_Protocol() < PROTOCOL_NT1)) {
exit_server_cleanly("SMB signing is required and "
"client negotiated a downlevel protocol");
}
diff --git a/source3/smbd/signing.c b/source3/smbd/signing.c
index 9d2e022133..8e4c50fbee 100644
--- a/source3/smbd/signing.c
+++ b/source3/smbd/signing.c
@@ -161,12 +161,13 @@ bool srv_init_signing(struct smbd_server_connection *conn)
bool mandatory = false;
switch (lp_server_signing()) {
- case Required:
+ case SMB_SIGNING_REQUIRED:
mandatory = true;
break;
- case True:
+ case SMB_SIGNING_IF_REQUIRED:
break;
- case False:
+ case SMB_SIGNING_DEFAULT:
+ case SMB_SIGNING_OFF:
allowed = false;
break;
}
diff --git a/source3/smbd/smb2_negprot.c b/source3/smbd/smb2_negprot.c
index 1733728c5f..ba55662094 100644
--- a/source3/smbd/smb2_negprot.c
+++ b/source3/smbd/smb2_negprot.c
@@ -186,7 +186,7 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
}
security_mode = SMB2_NEGOTIATE_SIGNING_ENABLED;
- if (lp_server_signing() == Required) {
+ if (lp_server_signing() == SMB_SIGNING_REQUIRED) {
security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
}
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index 6e06b9fe00..64fa446059 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -223,7 +223,7 @@ static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session,
}
if ((in_security_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) ||
- lp_server_signing() == Required) {
+ lp_server_signing() == SMB_SIGNING_REQUIRED) {
session->do_signing = true;
}
@@ -434,7 +434,7 @@ static NTSTATUS smbd_smb2_common_ntlmssp_auth_return(struct smbd_smb2_session *s
bool guest = false;
if ((in_security_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) ||
- lp_server_signing() == Required) {
+ lp_server_signing() == SMB_SIGNING_REQUIRED) {
session->do_signing = true;
}