mirror of
https://github.com/elisspace/autopsy.git
synced 2026-10-01 06:49:52 +00:00
Added reset for out of range values.
This commit is contained in:
+3
-3
@@ -50,9 +50,9 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter
|
||||
static final boolean DEFAULT_CONFIG_FILE_SIZE_MULTIPLE_ENFORCED = true;
|
||||
static final boolean DEFAULT_CONFIG_SLACK_FILES_ALLOWED = true;
|
||||
|
||||
private static final double MINIMUM_ENTROPY_INPUT_RANGE_MIN = 6.0;
|
||||
private static final double MINIMUM_ENTROPY_INPUT_RANGE_MAX = 8.0;
|
||||
private static final int MINIMUM_FILE_SIZE_INPUT_RANGE_MIN = 1;
|
||||
static final double MINIMUM_ENTROPY_INPUT_RANGE_MIN = 6.0;
|
||||
static final double MINIMUM_ENTROPY_INPUT_RANGE_MAX = 8.0;
|
||||
static final int MINIMUM_FILE_SIZE_INPUT_RANGE_MIN = 1;
|
||||
|
||||
private static final int FILE_SIZE_MODULUS = 512;
|
||||
private static final double ONE_OVER_LOG2 = 1.4426950408889634073599246810019; // (1 / log(2))
|
||||
|
||||
+23
-2
@@ -25,6 +25,11 @@ import javax.swing.text.DefaultFormatterFactory;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
|
||||
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettingsPanel;
|
||||
import static org.sleuthkit.autopsy.modules.encryptiondetection.EncryptionDetectionFileIngestModule.DEFAULT_CONFIG_MINIMUM_ENTROPY;
|
||||
import static org.sleuthkit.autopsy.modules.encryptiondetection.EncryptionDetectionFileIngestModule.DEFAULT_CONFIG_MINIMUM_FILE_SIZE;
|
||||
import static org.sleuthkit.autopsy.modules.encryptiondetection.EncryptionDetectionFileIngestModule.MINIMUM_ENTROPY_INPUT_RANGE_MAX;
|
||||
import static org.sleuthkit.autopsy.modules.encryptiondetection.EncryptionDetectionFileIngestModule.MINIMUM_ENTROPY_INPUT_RANGE_MIN;
|
||||
import static org.sleuthkit.autopsy.modules.encryptiondetection.EncryptionDetectionFileIngestModule.MINIMUM_FILE_SIZE_INPUT_RANGE_MIN;
|
||||
|
||||
/**
|
||||
* Ingest job settings panel for the Encryption Detection module.
|
||||
@@ -55,8 +60,24 @@ final class EncryptionDetectionIngestJobSettingsPanel extends IngestModuleIngest
|
||||
* @param settings The ingest job settings.
|
||||
*/
|
||||
private void customizeComponents(EncryptionDetectionIngestJobSettings settings) {
|
||||
minimumEntropyTextbox.setText(String.valueOf(settings.getMinimumEntropy()));
|
||||
minimumFileSizeTextbox.setText(String.valueOf(settings.getMinimumFileSize() / MEGABYTE_SIZE));
|
||||
/*
|
||||
* If minimum entropy is out of range, reset it to the default.
|
||||
*/
|
||||
double minimumEntropy = settings.getMinimumEntropy();
|
||||
if (minimumEntropy < MINIMUM_ENTROPY_INPUT_RANGE_MIN || minimumEntropy > MINIMUM_ENTROPY_INPUT_RANGE_MAX) {
|
||||
minimumEntropy = DEFAULT_CONFIG_MINIMUM_ENTROPY;
|
||||
}
|
||||
minimumEntropyTextbox.setText(String.valueOf(minimumEntropy));
|
||||
|
||||
/*
|
||||
* If minimum file size is out of range, reset it to the default.
|
||||
*/
|
||||
int minimumFileSize = settings.getMinimumFileSize();
|
||||
if (minimumFileSize < MINIMUM_FILE_SIZE_INPUT_RANGE_MIN) {
|
||||
minimumFileSize = DEFAULT_CONFIG_MINIMUM_FILE_SIZE;
|
||||
}
|
||||
minimumFileSizeTextbox.setText(String.valueOf(minimumFileSize / MEGABYTE_SIZE));
|
||||
|
||||
fileSizeMultiplesEnforcedCheckbox.setSelected(settings.isFileSizeMultipleEnforced());
|
||||
slackFilesAllowedCheckbox.setSelected(settings.isSlackFilesAllowed());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user