Skip to content

Commit

Permalink
Notify user that ole2 files are encrypted
Browse files Browse the repository at this point in the history
Add keys to the metadata.json file that informs the user that a scanned
ole2 file is encrypted.  Information about the type of encryption is
provided when the information is available.  This feature co-authored by
Micah Snyder.
  • Loading branch information
ragusaa authored and micahsnyder committed Jul 22, 2024
1 parent 652d5f6 commit 481a8b6
Show file tree
Hide file tree
Showing 17 changed files with 942 additions and 22 deletions.
363 changes: 341 additions & 22 deletions libclamav/ole2_extract.c

Large diffs are not rendered by default.

587 changes: 587 additions & 0 deletions unit_tests/clamscan/ole2_encryption_test.py

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
14 changes: 14 additions & 0 deletions unit_tests/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,20 @@ def execute_command(self, cmd, **kwargs):
"""
return self.execute(cmd, **kwargs)

# Find the metadata.json file and verify its contents.
def verify_metadata_json(self, tempdir, expected=[], unexpected=[]):
for parent, dirs, files in os.walk(tempdir):
for f in files:
if "metadata.json" == f:
with open(os.path.join(parent, f)) as handle:
metadata_json = handle.read()
self.verify_output(metadata_json, expected=expected, unexpected=unexpected)

# There is only one metadata.json per scan.
# We found it, so we can break out of the loop.
break



class Logger(object):

Expand Down

0 comments on commit 481a8b6

Please sign in to comment.