commit 5751f64: [Minor] Use less strict rules for pkcs7 detection

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Dec 22 15:49:07 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-12-22 15:46:27 +0000
URL: https://github.com/rspamd/rspamd/commit/5751f64b8b05de57d34b4aca9b65b8b90ed47f75

[Minor] Use less strict rules for pkcs7 detection
Issue: #3568

---
 src/libmime/content_type.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c
index 7b9c213ca..cad48a03b 100644
--- a/src/libmime/content_type.c
+++ b/src/libmime/content_type.c
@@ -708,8 +708,9 @@ rspamd_content_type_parse (const gchar *in,
 			}
 
 			/* PKCS7 smime */
-			RSPAMD_FTOK_ASSIGN (&srch, "x-pkcs7-mime");
-			if (rspamd_ftok_casecmp (&res->subtype, &srch) == 0) {
+			RSPAMD_FTOK_ASSIGN (&srch, "pkcs7-mime");
+			if (rspamd_substring_search (res->subtype.begin, res->subtype.len,
+					srch.begin, srch.len) != -1) {
 				res->flags |= RSPAMD_CONTENT_TYPE_SMIME;
 			}
 		}


More information about the Commits mailing list