From: Pranav Bhalerao (prbhaler) Date: Fri, 27 May 2022 12:49:07 +0000 (+0000) Subject: Pull request #3446: Revert "Pull request #3432: ftp_telnet: correct the configuration... X-Git-Tag: 3.1.31.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95475cf393a11d8b6956728b35ec1bff67c0cbbf;p=thirdparty%2Fsnort3.git Pull request #3446: Revert "Pull request #3432: ftp_telnet: correct the configuration of check_encrypted and encrypted_traffic, fix detection of encrypted control channel commands" Merge in SNORT/snort3 from ~ABHPAL/snort3:CSCwb69096 to master Squashed commit of the following: commit 543b5c6781025866bc7e43fa6df1d14aaf904759 Author: Abhijit Pal(abhpal) Date: Fri May 27 16:15:41 2022 +0530 Revert "Pull request #3432: ftp_telnet: correct the configuration of check_encrypted and encrypted_traffic, fix detection of encrypted control channel commands" This reverts commit 48d73d26f5d8c4307f98588a96cf4bc1a7da275f. --- diff --git a/src/service_inspectors/ftp_telnet/ftp_module.cc b/src/service_inspectors/ftp_telnet/ftp_module.cc index cb9a5cda8..c02ebe974 100644 --- a/src/service_inspectors/ftp_telnet/ftp_module.cc +++ b/src/service_inspectors/ftp_telnet/ftp_module.cc @@ -402,7 +402,7 @@ FTP_SERVER_PROTO_CONF* FtpServerModule::get_data() bool FtpServerModule::set(const char*, Value& v, SnortConfig*) { if ( v.is("check_encrypted") ) - conf->check_encrypted_data = v.get_bool(); + conf->detect_encrypted = v.get_bool(); else if ( v.is("chk_str_fmt") ) add_commands(v, CMD_CHECK); @@ -432,7 +432,7 @@ bool FtpServerModule::set(const char*, Value& v, SnortConfig*) add_commands(v, CMD_ENCR); else if ( v.is("encrypted_traffic") ) - conf->detect_encrypted = v.get_bool(); + conf->check_encrypted_data = v.get_bool(); else if ( v.is("file_get_cmds") ) add_commands(v, CMD_XFER|CMD_GET); diff --git a/src/service_inspectors/ftp_telnet/pp_ftp.cc b/src/service_inspectors/ftp_telnet/pp_ftp.cc index 4e62f1293..a703f07ed 100644 --- a/src/service_inspectors/ftp_telnet/pp_ftp.cc +++ b/src/service_inspectors/ftp_telnet/pp_ftp.cc @@ -1443,7 +1443,7 @@ int check_ftp(FTP_SESSION* ftpssn, Packet* p, int iMode) { if (!isalpha((int)(*ptr))) { - if (!isascii((int)(*ptr)) || (!isprint((int)(*ptr)) && (!isspace((int)(*ptr))))) + if (!isascii((int)(*ptr)) || !isprint((int)(*ptr))) { encrypted = 1; } @@ -1520,7 +1520,7 @@ int check_ftp(FTP_SESSION* ftpssn, Packet* p, int iMode) { if (!isdigit((int)(*ptr))) { - if (!isascii((int)(*ptr)) || (!isprint((int)(*ptr)) && (!isspace((int)(*ptr))))) + if (!isascii((int)(*ptr)) || !isprint((int)(*ptr))) { encrypted = 1; } diff --git a/src/service_inspectors/ftp_telnet/telnet_module.cc b/src/service_inspectors/ftp_telnet/telnet_module.cc index ab04b889f..cde9f63ee 100644 --- a/src/service_inspectors/ftp_telnet/telnet_module.cc +++ b/src/service_inspectors/ftp_telnet/telnet_module.cc @@ -101,10 +101,10 @@ bool TelnetModule::set(const char*, Value& v, SnortConfig*) conf->ayt_threshold = v.get_int32(); else if ( v.is("check_encrypted") ) - conf->check_encrypted_data = v.get_bool(); + conf->detect_encrypted = v.get_bool(); else if ( v.is("encrypted_traffic") ) - conf->detect_encrypted = v.get_bool(); + conf->check_encrypted_data = v.get_bool(); else if ( v.is("normalize") ) conf->normalize = v.get_bool();