From: Andreas Schneider Date: Thu, 28 May 2020 08:04:19 +0000 (+0200) Subject: param: Create and use enum_smb_encryption_vals X-Git-Tag: talloc-2.3.2~812 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f03bb8ad8a0f7238492542a2b2d8f196a79bc161;p=thirdparty%2Fsamba.git param: Create and use enum_smb_encryption_vals Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- diff --git a/docs-xml/smbdotconf/security/serversmbencrypt.xml b/docs-xml/smbdotconf/security/serversmbencrypt.xml index 714aacbf1ca..5f38b46419e 100644 --- a/docs-xml/smbdotconf/security/serversmbencrypt.xml +++ b/docs-xml/smbdotconf/security/serversmbencrypt.xml @@ -1,7 +1,7 @@ diff --git a/docs-xml/smbdotconf/security/smbencrypt.xml b/docs-xml/smbdotconf/security/smbencrypt.xml index 798e616b765..60271200c0a 100644 --- a/docs-xml/smbdotconf/security/smbencrypt.xml +++ b/docs-xml/smbdotconf/security/smbencrypt.xml @@ -1,7 +1,7 @@ diff --git a/lib/param/param_table.c b/lib/param/param_table.c index 47b85de1f87..e2f737279dc 100644 --- a/lib/param/param_table.c +++ b/lib/param/param_table.c @@ -138,6 +138,29 @@ static const struct enum_list enum_smb_signing_vals[] = { {-1, NULL} }; +static const struct enum_list enum_smb_encryption_vals[] = { + {SMB_ENCRYPTION_DEFAULT, "default"}, + {SMB_ENCRYPTION_OFF, "No"}, + {SMB_ENCRYPTION_OFF, "False"}, + {SMB_ENCRYPTION_OFF, "0"}, + {SMB_ENCRYPTION_OFF, "Off"}, + {SMB_ENCRYPTION_OFF, "disabled"}, + {SMB_ENCRYPTION_IF_REQUIRED, "if_required"}, + {SMB_ENCRYPTION_IF_REQUIRED, "Yes"}, + {SMB_ENCRYPTION_IF_REQUIRED, "True"}, + {SMB_ENCRYPTION_IF_REQUIRED, "1"}, + {SMB_ENCRYPTION_IF_REQUIRED, "On"}, + {SMB_ENCRYPTION_IF_REQUIRED, "enabled"}, + {SMB_ENCRYPTION_IF_REQUIRED, "auto"}, + {SMB_ENCRYPTION_DESIRED, "desired"}, + {SMB_ENCRYPTION_REQUIRED, "required"}, + {SMB_ENCRYPTION_REQUIRED, "mandatory"}, + {SMB_ENCRYPTION_REQUIRED, "force"}, + {SMB_ENCRYPTION_REQUIRED, "forced"}, + {SMB_ENCRYPTION_REQUIRED, "enforced"}, + {-1, NULL} +}; + static const struct enum_list enum_mdns_name_values[] = { {MDNS_NAME_NETBIOS, "netbios"}, {MDNS_NAME_MDNS, "mdns"}, diff --git a/libcli/smb/smb_constants.h b/libcli/smb/smb_constants.h index b424b13cde4..2fb1fd7189e 100644 --- a/libcli/smb/smb_constants.h +++ b/libcli/smb/smb_constants.h @@ -106,6 +106,15 @@ enum smb_signing_setting { SMB_SIGNING_REQUIRED = 3, }; +/* This MUST align with 'enum smb_signing_setting' */ +enum smb_encryption_setting { + SMB_ENCRYPTION_DEFAULT = SMB_SIGNING_DEFAULT, + SMB_ENCRYPTION_OFF = SMB_SIGNING_OFF, + SMB_ENCRYPTION_IF_REQUIRED = SMB_SIGNING_IF_REQUIRED, + SMB_ENCRYPTION_DESIRED = SMB_SIGNING_DESIRED, + SMB_ENCRYPTION_REQUIRED = SMB_SIGNING_REQUIRED, +}; + /* types of buffers in core SMB protocol */ #define SMB_DATA_BLOCK 0x1 #define SMB_ASCII4 0x4