From: Stefan Metzmacher Date: Fri, 17 Aug 2012 07:40:52 +0000 (+0200) Subject: s3:smbd: lp_smb_encrypt() returns SMB_SIGNING_* values X-Git-Tag: samba-4.0.0beta7~153 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e5d4e8df6b8186b71aa72dd7817f5579b44fee2f;p=thirdparty%2Fsamba.git s3:smbd: lp_smb_encrypt() returns SMB_SIGNING_* values metze --- diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 73f8fb31653..8b9d94181f3 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -139,7 +139,7 @@ #define smb_len_large(buf) smb_len_tcp(buf) #define _smb_setlen_large(buf, len) _smb_setlen_tcp(buf, len) -#define ENCRYPTION_REQUIRED(conn) ((conn) ? ((conn)->encrypt_level == Required) : false) +#define ENCRYPTION_REQUIRED(conn) ((conn) ? ((conn)->encrypt_level == SMB_SIGNING_REQUIRED) : false) #define IS_CONN_ENCRYPTED(conn) ((conn) ? (conn)->encrypted_tid : false) /**************************************************************************** diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d7141ae6bc8..bce1c5b6105 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -281,7 +281,7 @@ static struct loadparm_service sDefault = #else .iDirectoryNameCacheSize = 100, #endif - .ismb_encrypt = Auto, + .ismb_encrypt = SMB_SIGNING_DEFAULT, .param_opt = NULL, .dummy = "" }; diff --git a/source3/smbd/process.c b/source3/smbd/process.c index dd26a27ec39..f412f7b4cfb 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1492,7 +1492,7 @@ static connection_struct *switch_message(uint8 type, struct smb_request *req) if (req->encrypted) { conn->encrypted_tid = true; /* encrypted required from now on. */ - conn->encrypt_level = Required; + conn->encrypt_level = SMB_SIGNING_REQUIRED; } else if (ENCRYPTION_REQUIRED(conn)) { if (req->cmd != SMBtrans2 && req->cmd != SMBtranss2) { exit_server_cleanly("encryption required " diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 2de6e41d113..f09ad246b64 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -3340,14 +3340,14 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned } switch (conn->encrypt_level) { - case 0: + case SMB_SIGNING_OFF: encrypt_caps = 0; break; - case 1: - case Auto: + case SMB_SIGNING_IF_REQUIRED: + case SMB_SIGNING_DEFAULT: encrypt_caps = CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP; break; - case Required: + case SMB_SIGNING_REQUIRED: encrypt_caps = CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP| CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP; large_write = false; @@ -3695,7 +3695,7 @@ static void call_trans2setfsinfo(connection_struct *conn, return; } - if (lp_smb_encrypt(SNUM(conn)) == false) { + if (lp_smb_encrypt(SNUM(conn)) == SMB_SIGNING_OFF) { reply_nterror( req, NT_STATUS_NOT_SUPPORTED);