summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-02-28 10:14:16 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-02-28 10:14:16 +0000
commit35085a042f85a5e371483de05e17717aab2fac25 (patch)
treeacd548bbe756c3062c255b995cb6430f515698c7 /src
parent8e8a09ffbfa9ac60fb59d045f0fa4c4234119d6f (diff)
downloadrspamd-35085a042f85a5e371483de05e17717aab2fac25.tar.gz
rspamd-35085a042f85a5e371483de05e17717aab2fac25.zip
[Minor] Detect encryption when libarchive is used
Diffstat (limited to 'src')
-rw-r--r--src/libmime/archives.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libmime/archives.c b/src/libmime/archives.c
index c4e9b9e90..528c6f21b 100644
--- a/src/libmime/archives.c
+++ b/src/libmime/archives.c
@@ -1135,6 +1135,7 @@ rspamd_7zip_read_folder(struct rspamd_task *task,
msg_debug_archive("7zip: read codec id: %L", tmp);
if (IS_SZ_ENCRYPTED(tmp)) {
+ msg_debug_archive("7zip: encrypted codec: %L", tmp);
arch->flags |= RSPAMD_ARCHIVE_ENCRYPTED;
}
@@ -1691,6 +1692,12 @@ rspamd_7zip_read_next_section(struct rspamd_task *task,
}
archive_read_data_skip(a);
}
+
+ if (archive_read_has_encrypted_entries(a) > 0) {
+ msg_debug_archive("7zip: found encrypted stuff");
+ arch->flags |= RSPAMD_ARCHIVE_ENCRYPTED;
+ }
+
archive_read_free(a);
p = NULL; /* Stop internal processor, as we rely on libarchive here */
break;