diff options
author | Andreas Schneider <asn@samba.org> | 2020-05-26 09:34:54 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2020-08-19 16:22:40 +0000 |
commit | 58e31f78745906e8657d5ebd97c6f8f389911a62 (patch) | |
tree | fa8597959665bccc00ef565332cf77fe2881f7bc /source3 | |
parent | f03bb8ad8a0f7238492542a2b2d8f196a79bc161 (diff) | |
download | samba-58e31f78745906e8657d5ebd97c6f8f389911a62.tar.gz |
s3:smbd: Use 'enum smb_encryption_setting' values
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/param/loadparm.c | 2 | ||||
-rw-r--r-- | source3/smbd/service.c | 8 | ||||
-rw-r--r-- | source3/smbd/smb2_negprot.c | 2 | ||||
-rw-r--r-- | source3/smbd/smb2_sesssetup.c | 4 | ||||
-rw-r--r-- | source3/smbd/smb2_tcon.c | 4 | ||||
-rw-r--r-- | source3/smbd/trans2.c | 3 |
6 files changed, 12 insertions, 11 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a2cb0fca16d..f4f3bce031c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -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, diff --git a/source3/smbd/service.c b/source3/smbd/service.c index a263c33b7e2..43803e721c2 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -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; } } diff --git a/source3/smbd/smb2_negprot.c b/source3/smbd/smb2_negprot.c index 674942b71de..99303f1b07b 100644 --- a/source3/smbd/smb2_negprot.c +++ b/source3/smbd/smb2_negprot.c @@ -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; } diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index 8957411e167..907dd92321e 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -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; } diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c index 0dd3c653b4b..d7e0cf90f47 100644 --- a/source3/smbd/smb2_tcon.c +++ b/source3/smbd/smb2_tcon.c @@ -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; } diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 251bc4c3e66..16f8318663f 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -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); |