s3:smbd: Use 'enum smb_encryption_setting' values
authorAndreas Schneider <asn@samba.org>
Tue, 26 May 2020 07:34:54 +0000 (09:34 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 19 Aug 2020 16:22:40 +0000 (16:22 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/param/loadparm.c
source3/smbd/service.c
source3/smbd/smb2_negprot.c
source3/smbd/smb2_sesssetup.c
source3/smbd/smb2_tcon.c
source3/smbd/trans2.c

index a2cb0fca16d4970ae97eebdb6c97a7719a2a020d..f4f3bce031cd058f87d2f6f1f1bebd4ab29f6a00 100644 (file)
@@ -241,7 +241,7 @@ static const struct loadparm_service _sDefault =
        .aio_write_size = 1,
        .map_readonly = MAP_READONLY_NO,
        .directory_name_cache_size = 100,
-       .server_smb_encrypt = SMB_SIGNING_DEFAULT,
+       .server_smb_encrypt = SMB_ENCRYPTION_DEFAULT,
        .kernel_share_modes = true,
        .durable_handles = true,
        .check_parent_directory_delete_on_close = false,
index a263c33b7e23cb5629bce78ec997d9bb59831b74..43803e721c2a32f6c618458db6993b77c70b6f9e 100644 (file)
@@ -568,16 +568,16 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn,
        conn->short_case_preserve = lp_short_preserve_case(snum);
 
        conn->encrypt_level = lp_server_smb_encrypt(snum);
-       if (conn->encrypt_level > SMB_SIGNING_OFF) {
-               if (lp_server_smb_encrypt(-1) == SMB_SIGNING_OFF) {
-                       if (conn->encrypt_level == SMB_SIGNING_REQUIRED) {
+       if (conn->encrypt_level > SMB_ENCRYPTION_OFF) {
+               if (lp_server_smb_encrypt(-1) == SMB_ENCRYPTION_OFF) {
+                       if (conn->encrypt_level == SMB_ENCRYPTION_REQUIRED) {
                                DBG_ERR("Service [%s] requires encryption, but "
                                        "it is disabled globally!\n",
                                        lp_const_servicename(snum));
                                status = NT_STATUS_ACCESS_DENIED;
                                goto err_root_exit;
                        }
-                       conn->encrypt_level = SMB_SIGNING_OFF;
+                       conn->encrypt_level = SMB_ENCRYPTION_OFF;
                }
        }
 
index 674942b71de879768e541bbb46f18c39e2f81f09..99303f1b07baee2058ba5091a991e7d56b95bb42 100644 (file)
@@ -335,7 +335,7 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
        }
 
        if ((protocol >= PROTOCOL_SMB2_24) &&
-           (lp_server_smb_encrypt(-1) != SMB_SIGNING_OFF) &&
+           (lp_server_smb_encrypt(-1) != SMB_ENCRYPTION_OFF) &&
            (in_capabilities & SMB2_CAP_ENCRYPTION)) {
                capabilities |= SMB2_CAP_ENCRYPTION;
        }
index 8957411e1676981fd0c7e5ce46f3855883a4aa6f..907dd92321e21f90258d34c822c45b9f186d0c35 100644 (file)
@@ -292,12 +292,12 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbXsrv_session *session,
                x->global->signing_flags = SMBXSRV_SIGNING_REQUIRED;
        }
 
-       if ((lp_server_smb_encrypt(-1) >= SMB_SIGNING_DESIRED) &&
+       if ((lp_server_smb_encrypt(-1) >= SMB_ENCRYPTION_DESIRED) &&
            (xconn->smb2.client.capabilities & SMB2_CAP_ENCRYPTION)) {
                x->global->encryption_flags = SMBXSRV_ENCRYPTION_DESIRED;
        }
 
-       if (lp_server_smb_encrypt(-1) == SMB_SIGNING_REQUIRED) {
+       if (lp_server_smb_encrypt(-1) == SMB_ENCRYPTION_REQUIRED) {
                x->global->encryption_flags = SMBXSRV_ENCRYPTION_REQUIRED |
                        SMBXSRV_ENCRYPTION_DESIRED;
        }
index 0dd3c653b4b91a55f2f0c7e4a637ef15b72d47e7..d7e0cf90f47449191a272906a34a81389ae1114e 100644 (file)
@@ -302,13 +302,13 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
                TALLOC_FREE(proxy);
        }
 
-       if ((lp_server_smb_encrypt(snum) >= SMB_SIGNING_DESIRED) &&
+       if ((lp_server_smb_encrypt(snum) >= SMB_ENCRYPTION_DESIRED) &&
            (conn->smb2.server.cipher != 0))
        {
                encryption_desired = true;
        }
 
-       if (lp_server_smb_encrypt(snum) == SMB_SIGNING_REQUIRED) {
+       if (lp_server_smb_encrypt(snum) == SMB_ENCRYPTION_REQUIRED) {
                encryption_desired = true;
                encryption_required = true;
        }
index 251bc4c3e665298be4453fc6917358d1f2015a51..16f8318663fb29d7cce0c7257053af1ac8c23804 100644 (file)
@@ -4491,7 +4491,8 @@ static void call_trans2setfsinfo(connection_struct *conn,
                                        return;
                                }
 
-                               if (lp_server_smb_encrypt(SNUM(conn)) == SMB_SIGNING_OFF) {
+                               if (lp_server_smb_encrypt(SNUM(conn)) ==
+                                   SMB_ENCRYPTION_OFF) {
                                        reply_nterror(
                                                req,
                                                NT_STATUS_NOT_SUPPORTED);