]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: lp_smb_encrypt() returns SMB_SIGNING_* values
authorStefan Metzmacher <metze@samba.org>
Fri, 17 Aug 2012 07:40:52 +0000 (09:40 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 17 Aug 2012 12:51:57 +0000 (14:51 +0200)
metze

source3/include/smb_macros.h
source3/param/loadparm.c
source3/smbd/process.c
source3/smbd/trans2.c

index 73f8fb31653d38ee119f34c9e37a9be977f27024..8b9d94181f37195f721e5ba6cd393baed43ec73a 100644 (file)
 #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)
 
 /****************************************************************************
index d7141ae6bc8bf3a4e6e8a3737a386027296b6349..bce1c5b6105e742b0d204dfb37421260055104ce 100644 (file)
@@ -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 = ""
 };
index dd26a27ec391eae7ecff4fa57bcfd81c7184242c..f412f7b4cfb82fbdf1a145e33342c6df0340096e 100644 (file)
@@ -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 "
index 2de6e41d1137272a87e382f5f84d1946422845bb..f09ad246b648bbb8a8206151dcae8d1982ad1716 100644 (file)
@@ -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);