From 311f03470e85e391eb9a6740945ac3c3ea1c3a63 Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Sun, 15 Oct 2023 06:33:52 -0400 Subject: [PATCH] style: auto-format update --- .../owasp/dependencycheck/agent/DependencyCheckScanAgent.java | 3 ++- .../owasp/dependencycheck/data/update/NvdApiDataSource.java | 1 - .../java/org/owasp/dependencycheck/utils/SettingsTest.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/owasp/dependencycheck/agent/DependencyCheckScanAgent.java b/core/src/main/java/org/owasp/dependencycheck/agent/DependencyCheckScanAgent.java index 99d0d8f5dec..2d357f2148d 100644 --- a/core/src/main/java/org/owasp/dependencycheck/agent/DependencyCheckScanAgent.java +++ b/core/src/main/java/org/owasp/dependencycheck/agent/DependencyCheckScanAgent.java @@ -247,6 +247,7 @@ public String getApplicationName() { public void setApplicationName(String applicationName) { this.applicationName = applicationName; } + /** * Get the value of nvdApiKey. * @@ -1002,7 +1003,7 @@ private void checkForFailure(Dependency[] dependencies) throws ScanAgentExceptio for (Dependency d : dependencies) { boolean addName = true; for (Vulnerability v : d.getVulnerabilities()) { - if ((v.getCvssV2() != null && v.getCvssV2().getCvssData().getBaseScore() >= failBuildOnCVSS) + if ((v.getCvssV2() != null && v.getCvssV2().getCvssData().getBaseScore() >= failBuildOnCVSS) || (v.getCvssV3() != null && v.getCvssV3().getCvssData().getBaseScore() >= failBuildOnCVSS) || (v.getUnscoredSeverity() != null && SeverityUtil.estimateCvssV2(v.getUnscoredSeverity()) >= failBuildOnCVSS) //safety net to fail on any if for some reason the above misses on 0 diff --git a/core/src/main/java/org/owasp/dependencycheck/data/update/NvdApiDataSource.java b/core/src/main/java/org/owasp/dependencycheck/data/update/NvdApiDataSource.java index b8a778d9a76..2e934a2d7c6 100644 --- a/core/src/main/java/org/owasp/dependencycheck/data/update/NvdApiDataSource.java +++ b/core/src/main/java/org/owasp/dependencycheck/data/update/NvdApiDataSource.java @@ -277,7 +277,6 @@ private boolean processApi() throws UpdateException { } //TODO consider using CVE_CPE_STARTS_WITH_FILTER - ExecutorService processingExecutorService = null; try { processingExecutorService = Executors.newFixedThreadPool(PROCESSING_THREAD_POOL_SIZE); diff --git a/utils/src/test/java/org/owasp/dependencycheck/utils/SettingsTest.java b/utils/src/test/java/org/owasp/dependencycheck/utils/SettingsTest.java index 81f938607d2..24d63cfa157 100644 --- a/utils/src/test/java/org/owasp/dependencycheck/utils/SettingsTest.java +++ b/utils/src/test/java/org/owasp/dependencycheck/utils/SettingsTest.java @@ -323,11 +323,11 @@ public void testMaskedKeys() { assertThat("password should be masked", getSettings().getPrintableValue("odc.database.password", "s3Cr3t!"), equalTo("********")); - + assertThat("tokens should be masked", getSettings().getPrintableValue("odc.api.token", "asf4b$3428vasd84$#$45asda"), equalTo("********")); - + assertThat("other keys should not be masked", getSettings().getPrintableValue("odc.version", "5.0.0"), equalTo("5.0.0"));