1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-30 06:50:24 +03:00

s3:smbd: Use 'enum smb_encryption_setting' values

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Andreas Schneider 2020-05-26 09:34:54 +02:00 committed by Andreas Schneider
parent f03bb8ad8a
commit 58e31f7874
6 changed files with 12 additions and 11 deletions

View 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,

View 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;
}
}

View 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;
}

View 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;
}

View 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;
}

View 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);