From bb80d1bdf7ba7b4ce7c87063c5d45517ed0b372c Mon Sep 17 00:00:00 2001
From: Greg DiCristofaro <gregd@basistech.com>
Date: Thu, 18 Feb 2021 13:30:14 -0500
Subject: [PATCH] update in encryption module

---
 .gitignore                                                   | 3 ++-
 Core/build.xml                                               | 1 -
 .../EncryptionDetectionFileIngestModule.java                 | 5 +++++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 16833523b6..9949c8b6fc 100755
--- a/.gitignore
+++ b/.gitignore
@@ -23,7 +23,8 @@
 !/CoreLibs/nbproject/project.xml
 !/CoreLibs/nbproject/project.properties
 
-/Core/test/qa-functional/data/
+/Core/test/qa-functional/data/*
+!/Core/test/qa-functional/data/PasswordDetection_img1_v1.img
 
 /KeywordSearch/release/
 /KeywordSearch/build/
diff --git a/Core/build.xml b/Core/build.xml
index 668a07b127..e8966c2508 100644
--- a/Core/build.xml
+++ b/Core/build.xml
@@ -164,7 +164,6 @@
         <get src="https://drive.google.com/uc?id=1lYzd--9YUB7yDccM7NPOo8PC1xxuOiKs" dest="${test-input}/SqlCipherDetection_img1_v1.vhd" skipexisting="true"/>
         <get src="https://drive.google.com/uc?id=1QRNKs824kksiJLZ4qcs59Nytw0fJKEjb" dest="${test-input}/IngestFilters_img1_v1.img" skipexisting="true"/>  
         <get src="https://drive.google.com/uc?id=1OMTB5gD4_VuaFkLWu2I33FN8VAHoRQbW" dest="${test-input}/IngestFilters_local1_v1.zip" skipexisting="true"/>
-        <get src="https://drive.google.com/uc?id=1WGMkivlDi_I_vB1aYY6puAPktbmlNSL-" dest="${test-input}/PasswordDetection_img1_v1.img" skipexisting="true"/>
         <get src="https://drive.google.com/uc?id=1X2DzJOJ1SjUkAtZXJ3oQHXkjF0NX_jOz" dest="${test-input}/VeracryptDetection_img1_v1.vhd" skipexisting="true"/>
         <get src="https://drive.google.com/uc?id=19gRepVVvLsDHtBwIkX2VVjsBWIub7aIV" dest="${test-input}/CommonFiles_img1_v1.vhd" skipexisting="true"/>
         <get src="https://drive.google.com/uc?id=1chUMtA0CNyPBZ0yuTl9F_O103R21Ox0p" dest="${test-input}/CommonFiles_img2_v1.vhd" skipexisting="true"/>
diff --git a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java
index aed3afc50d..df510873ff 100644
--- a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java
@@ -324,6 +324,11 @@ private boolean isFilePasswordProtected(AbstractFile file) throws ReadContentInp
                     Database accessDatabase;
                     try {
                         accessDatabase = databaseBuilder.open();
+                    } catch (InvalidCredentialsException ex) {
+                        logger.log(Level.INFO, String.format(
+                                "Jackcess throws invalid credentials exception for file (name: %s, id: %s).  It will be assumed to be password protected.", 
+                                file.getName(), file.getId()));
+                        return true;
                     } catch (Exception ex) { // Firewall, see JIRA-7097
                         logger.log(Level.WARNING, String.format("Unexpected exception "
                                 + "trying to open msaccess database using Jackcess "
-- 
GitLab