+
org/owasp/dependencycheck/dependency/Dependency.java
+
+
+| Severity |
+Category |
+Rule |
+Message |
+Line |
+
+ Error |
sizes |
MethodCount |
Total number of methods is 54 (max allowed is 40). |
@@ -2458,7 +2479,7 @@
+
+ |
+ dependency-check-maven/target/generated-classes/cobertura/mojo.properties
+ |
+
+ 0
+ |
+
+ 0
+ |
+
+ 0
+ |
|
@@ -183,6 +197,20 @@ under the License.
|
0
|
+
+
+ |
+ dependency-check-ant/target/generated-classes/cobertura/cobertura.properties
+ |
+
+ 0
+ |
+
+ 0
+ |
+
+ 0
+ |
|
@@ -281,6 +309,20 @@ under the License.
|
0
|
+
+
+ |
+ dependency-check-ant/target/generated-classes/cobertura/task.properties
+ |
+
+ 0
+ |
+
+ 0
+ |
+
+ 0
+ |
|
@@ -295,6 +337,20 @@ under the License.
|
0
|
+
+
+ |
+ dependency-check-maven/target/maven-archiver/pom.properties
+ |
+
+ 0
+ |
+
+ 0
+ |
+
+ 0
+ |
|
@@ -379,6 +435,20 @@ under the License.
|
0
|
+
+
+ |
+ dependency-check-maven/target/maven-plugin-help.properties
+ |
+
+ 0
+ |
+
+ 0
+ |
+
+ 0
+ |
|
@@ -463,6 +533,20 @@ under the License.
|
0
|
+
+
+ |
+ dependency-check-ant/target/classes/task.properties
+ |
+
+ 0
+ |
+
+ 0
+ |
+
+ 0
+ |
|
@@ -729,6 +813,20 @@ under the License.
|
0
|
+
+
+ |
+ dependency-check-ant/target/classes/dependency-check-taskdefs.properties
+ |
+
+ 0
+ |
+
+ 0
+ |
+
+ 0
+ |
|
@@ -799,6 +897,20 @@ under the License.
|
0
|
+
+
+ |
+ dependency-check-ant/target/maven-archiver/pom.properties
+ |
+
+ 0
+ |
+
+ 0
+ |
+
+ 0
+ |
|
@@ -883,6 +995,20 @@ under the License.
|
0
|
+
+
+ |
+ dependency-check-ant/target/generated-classes/cobertura/dependency-check-taskdefs.properties
+ |
+
+ 0
+ |
+
+ 0
+ |
+
+ 0
+ |
|
@@ -939,6 +1065,20 @@ under the License.
|
5
|
+
+
+ |
+ dependency-check-cli/target/maven-archiver/pom.properties
+ |
+
+ 0
+ |
+
+ 0
+ |
+
+ 0
+ |
|
@@ -1541,6 +1681,20 @@ under the License.
|
0
|
+
+
+ |
+ dependency-check-maven/target/generated-classes/cobertura/cobertura.properties
+ |
+
+ 0
+ |
+
+ 0
+ |
+
+ 0
+ |
|
@@ -2003,6 +2157,20 @@ under the License.
|
0
|
+
+
+ |
+ dependency-check-cli/target/generated-classes/cobertura/cobertura.properties
+ |
+
+ 0
+ |
+
+ 0
+ |
+
+ 0
+ |
|
@@ -2129,6 +2297,20 @@ under the License.
|
0
|
+
+
+ |
+ dependency-check-maven/target/test-classes/mojo.properties
+ |
+
+ 0
+ |
+
+ 0
+ |
+
+ 0
+ |
|
@@ -2281,7 +2463,7 @@ under the License.
0
|
- 0
+ 1
|
@@ -2325,6 +2507,20 @@ under the License.
|
0
|
+
+
+ |
+ dependency-check-maven/target/classes/mojo.properties
+ |
+
+ 0
+ |
+
+ 0
+ |
+
+ 0
+ |
|
@@ -2393,7 +2589,7 @@ under the License.
0
|
- 1
+ 0
|
@@ -2491,7 +2687,7 @@ under the License.
0
|
- 0
+ 2
|
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.analyzer.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.analyzer.html
index de54a0ba2..7aa26eed7 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.analyzer.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.analyzer.html
@@ -42,7 +42,7 @@ org.owasp.dependencycheck.analyzer
AutoconfAnalyzer (92%) |
-| CMakeAnalyzer (93%) |
+CMakeAnalyzer (91%) |
| CPEAnalyzer (74%) |
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.nvdcve.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.nvdcve.html
index 6d38685fc..d6984507b 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.nvdcve.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.nvdcve.html
@@ -27,7 +27,7 @@ org.owasp.dependencycheck.data.nvdcve
DatabaseException (0%) |
-| DatabaseProperties (22%) |
+DatabaseProperties (18%) |
| DriverLoadException (33%) |
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.html
index 18d1823a2..893e8c8c4 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.html
@@ -24,7 +24,7 @@ org.owasp.dependencycheck.data.update
CpeUpdater (0%) |
-| EngineVersionCheck (47%) |
+EngineVersionCheck (43%) |
| NvdCveUpdater (0%) |
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.suppression.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.suppression.html
index 8e673b05a..d51c7a0dd 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.suppression.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.suppression.html
@@ -30,7 +30,7 @@ org.owasp.dependencycheck.suppression
SuppressionParser (65%) |
-| SuppressionRule (73%) |
+SuppressionRule (75%) |
diff --git a/dependency-check-core/cobertura/frame-sourcefiles.html b/dependency-check-core/cobertura/frame-sourcefiles.html
index 0d9369b33..1dfff2614 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles.html
@@ -57,7 +57,7 @@ All Packages
BaseUpdater (70%) |
-| CMakeAnalyzer (93%) |
+CMakeAnalyzer (91%) |
| CPEAnalyzer (74%) |
@@ -123,7 +123,7 @@ All Packages
DatabaseException (0%) |
-| DatabaseProperties (22%) |
+DatabaseProperties (18%) |
| DateUtil (50%) |
@@ -162,7 +162,7 @@ All Packages
Engine (54%) |
-| EngineVersionCheck (47%) |
+EngineVersionCheck (43%) |
| EscapeTool (0%) |
@@ -327,7 +327,7 @@ All Packages
SuppressionParser (65%) |
-| SuppressionRule (73%) |
+SuppressionRule (75%) |
| TokenPairConcatenatingFilter (60%) |
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.agent.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.agent.html
index 3edbd04ef..4e420c1a0 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.agent.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.agent.html
@@ -37,6 +37,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.exception.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.exception.html
index 632435dfd..f08dc7b8b 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.exception.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.exception.html
@@ -39,6 +39,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.html
index 8f5d70712..6fc7ef38d 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.html
@@ -16,7 +16,7 @@
@@ -43,15 +43,15 @@ packageTable.sort(0);
| ArchiveAnalyzer | | | 5.1875;5.188 |
-
| AssemblyAnalyzer | | | 6.0;6 |
+
| AssemblyAnalyzer | | | 6.0;6 |
| AutoconfAnalyzer | | | 3.111111111111111;3.111 |
-
| CMakeAnalyzer | | | 2.0;2 |
+
| CMakeAnalyzer | | | 2.142857142857143;2.143 |
-
| CPEAnalyzer | | | 4.571428571428571;4.571 |
-
| CPEAnalyzer$IdentifierConfidence | | | 4.571428571428571;4.571 |
-
| CPEAnalyzer$IdentifierMatch | | | 4.571428571428571;4.571 |
+
| CPEAnalyzer | | | 4.607142857142857;4.607 |
+
| CPEAnalyzer$IdentifierConfidence | | | 4.607142857142857;4.607 |
+
| CPEAnalyzer$IdentifierMatch | | | 4.607142857142857;4.607 |
| CentralAnalyzer | | | 3.625;3.625 |
@@ -69,7 +69,7 @@ packageTable.sort(0);
| HintAnalyzer | | | 6.0;6 |
-
| JarAnalyzer | | | 7.096774193548387;7.097 |
+
| JarAnalyzer | | | 7.096774193548387;7.097 |
| JarAnalyzer$ClassNameInformation | | | 7.096774193548387;7.097 |
| NexusAnalyzer | | | 3.375;3.375 |
@@ -86,7 +86,7 @@ packageTable.sort(0);
| PythonPackageAnalyzer | | | 2.090909090909091;2.091 |
-
| RubyBundleAuditAnalyzer | | | 4.3076923076923075;4.308 |
+
| RubyBundleAuditAnalyzer | | | 4.384615384615385;4.385 |
| RubyGemspecAnalyzer | | | 1.875;1.875 |
@@ -99,6 +99,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.central.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.central.html
index 648c58f42..cf411bd49 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.central.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.central.html
@@ -37,6 +37,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.composer.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.composer.html
index 7f943a745..c2a2aa1d7 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.composer.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.composer.html
@@ -41,6 +41,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cpe.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cpe.html
index f04ea9f0e..f734d8df3 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cpe.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cpe.html
@@ -43,6 +43,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cwe.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cwe.html
index d60c3e1e5..225f39e86 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cwe.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cwe.html
@@ -39,6 +39,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.lucene.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.lucene.html
index 08126881f..3c45323e0 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.lucene.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.lucene.html
@@ -51,6 +51,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nexus.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nexus.html
index 32a4ee7d5..19818f258 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nexus.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nexus.html
@@ -39,6 +39,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nuget.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nuget.html
index d3ee8ad7b..a78aecf42 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nuget.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nuget.html
@@ -43,6 +43,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nvdcve.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nvdcve.html
index 37f211154..dfcc5471a 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nvdcve.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nvdcve.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.cpe.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.cpe.html
index 1f02d9420..0bb812e18 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.cpe.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.cpe.html
@@ -40,6 +40,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.exception.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.exception.html
index b7bf88ab9..f97b438bd 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.exception.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.exception.html
@@ -39,6 +39,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.html
index 39cc50d57..13c31d51e 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.html
@@ -16,10 +16,10 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.nvd.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.nvd.html
index 0687e98e7..b7a724a85 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.nvd.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.nvd.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.dependency.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.dependency.html
index 15d452de1..559e760ee 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.dependency.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.dependency.html
@@ -58,6 +58,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.exception.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.exception.html
index d45455c99..aafa287d8 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.exception.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.exception.html
@@ -39,6 +39,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html
index 88e52ab19..abb4f1647 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html
@@ -18,7 +18,7 @@
| org.owasp.dependencycheck | 1 | | | 3.1739130434782608;3.174 |
| org.owasp.dependencycheck.agent | 1 | | | 1.3194444444444444;1.319 |
- | org.owasp.dependencycheck.analyzer | 33 | | | 4.257575757575758;4.258 |
+ | org.owasp.dependencycheck.analyzer | 33 | | | 4.268939393939394;4.269 |
| org.owasp.dependencycheck.analyzer.exception | 2 | | | 1.0;1 |
| org.owasp.dependencycheck.data.central | 1 | | | 10.0;10 |
| org.owasp.dependencycheck.data.composer | 3 | | | 3.4166666666666665;3.417 |
@@ -27,15 +27,15 @@
| org.owasp.dependencycheck.data.lucene | 8 | | | 3.32;3.32 |
| org.owasp.dependencycheck.data.nexus | 2 | | | 2.4444444444444446;2.444 |
| org.owasp.dependencycheck.data.nuget | 4 | | | 2.238095238095238;2.238 |
- | org.owasp.dependencycheck.data.nvdcve | 9 | | | 3.9523809523809526;3.952 |
- | org.owasp.dependencycheck.data.update | 6 | | | 5.375;5.375 |
+ | org.owasp.dependencycheck.data.nvdcve | 9 | | | 4.0;4 |
+ | org.owasp.dependencycheck.data.update | 6 | | | 5.52;5.52 |
| org.owasp.dependencycheck.data.update.cpe | 3 | | | 1.5;1.5 |
| org.owasp.dependencycheck.data.update.exception | 2 | | | 1.0;1 |
- | org.owasp.dependencycheck.data.update.nvd | 8 | | | 2.546666666666667;2.547 |
+ | org.owasp.dependencycheck.data.update.nvd | 8 | | | 2.6164383561643834;2.616 |
| org.owasp.dependencycheck.dependency | 14 | | | 1.988950276243094;1.989 |
| org.owasp.dependencycheck.exception | 2 | | | 1.0;1 |
| org.owasp.dependencycheck.reporting | 4 | | | 5.066666666666666;5.067 |
- | org.owasp.dependencycheck.suppression | 6 | | | 3.037037037037037;3.037 |
+ | org.owasp.dependencycheck.suppression | 6 | | | 3.018181818181818;3.018 |
| org.owasp.dependencycheck.utils | 11 | | | 3.759259259259259;3.759 |
| org.owasp.dependencycheck.xml.pom | 7 | | | 2.3191489361702127;2.319 |
@@ -58,6 +58,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.reporting.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.reporting.html
index 496e23936..33719fa09 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.reporting.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.reporting.html
@@ -42,6 +42,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.suppression.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.suppression.html
index 6801360d0..913293617 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.suppression.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.suppression.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.utils.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.utils.html
index ae021c66f..068057083 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.utils.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.utils.html
@@ -55,6 +55,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.xml.pom.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.xml.pom.html
index 40120b499..0954ae77c 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.xml.pom.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.xml.pom.html
@@ -48,6 +48,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary.html b/dependency-check-core/cobertura/frame-summary.html
index 69eb1f5cf..98b5440a2 100644
--- a/dependency-check-core/cobertura/frame-summary.html
+++ b/dependency-check-core/cobertura/frame-summary.html
@@ -16,10 +16,10 @@
| Package | # Classes | Line Coverage | Branch Coverage | Complexity |
- | All Packages | 133 | | | 3.0571151984511133;3.057 |
+ | All Packages | 133 | | | 3.072674418604651;3.073 |
| org.owasp.dependencycheck | 1 | | | 3.1739130434782608;3.174 |
| org.owasp.dependencycheck.agent | 1 | | | 1.3194444444444444;1.319 |
- | org.owasp.dependencycheck.analyzer | 33 | | | 4.257575757575758;4.258 |
+ | org.owasp.dependencycheck.analyzer | 33 | | | 4.268939393939394;4.269 |
| org.owasp.dependencycheck.analyzer.exception | 2 | | | 1.0;1 |
| org.owasp.dependencycheck.data.central | 1 | | | 10.0;10 |
| org.owasp.dependencycheck.data.composer | 3 | | | 3.4166666666666665;3.417 |
@@ -28,15 +28,15 @@
| org.owasp.dependencycheck.data.lucene | 8 | | | 3.32;3.32 |
| org.owasp.dependencycheck.data.nexus | 2 | | | 2.4444444444444446;2.444 |
| org.owasp.dependencycheck.data.nuget | 4 | | | 2.238095238095238;2.238 |
- | org.owasp.dependencycheck.data.nvdcve | 9 | | | 3.9523809523809526;3.952 |
- | org.owasp.dependencycheck.data.update | 6 | | | 5.375;5.375 |
+ | org.owasp.dependencycheck.data.nvdcve | 9 | | | 4.0;4 |
+ | org.owasp.dependencycheck.data.update | 6 | | | 5.52;5.52 |
| org.owasp.dependencycheck.data.update.cpe | 3 | | | 1.5;1.5 |
| org.owasp.dependencycheck.data.update.exception | 2 | | | 1.0;1 |
- | org.owasp.dependencycheck.data.update.nvd | 8 | | | 2.546666666666667;2.547 |
+ | org.owasp.dependencycheck.data.update.nvd | 8 | | | 2.6164383561643834;2.616 |
| org.owasp.dependencycheck.dependency | 14 | | | 1.988950276243094;1.989 |
| org.owasp.dependencycheck.exception | 2 | | | 1.0;1 |
| org.owasp.dependencycheck.reporting | 4 | | | 5.066666666666666;5.067 |
- | org.owasp.dependencycheck.suppression | 6 | | | 3.037037037037037;3.037 |
+ | org.owasp.dependencycheck.suppression | 6 | | | 3.018181818181818;3.018 |
| org.owasp.dependencycheck.utils | 11 | | | 3.759259259259259;3.759 |
| org.owasp.dependencycheck.xml.pom | 7 | | | 2.3191489361702127;2.319 |
@@ -46,6 +46,6 @@ var packageTable = new SortableTable(document.getElementById("packageResults"),
["String", "Number", "Percentage", "Percentage", "FormattedNumber"]);
packageTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html
index 81e4165b6..58701d6e8 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html
@@ -842,6 +842,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.agent.DependencyCheckScanAgent.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.agent.DependencyCheckScanAgent.html
index 8a7b5a08a..e74b4c051 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.agent.DependencyCheckScanAgent.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.agent.DependencyCheckScanAgent.html
@@ -1849,6 +1849,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html
index c202f0fbc..c7f3cb858 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html
@@ -106,6 +106,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer.html
index 2b290a12f..2b74bb10e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer.html
@@ -426,6 +426,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.html
index a2779d7f3..3920ba662 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.html
@@ -313,6 +313,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html
index 6ca89533a..c812a22f1 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html
@@ -78,7 +78,7 @@
| 31 | |
|
| 32 | |
- |
+
|
| 33 | |
|
| 34 | 1 | PRE_INFORMATION_COLLECTION, |
@@ -142,6 +142,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html
index e73379580..f353cac85 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html
@@ -161,6 +161,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html
index 889f67b60..8db027143 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html
@@ -121,6 +121,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.html
index 2e317ed04..8d7dbc352 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.html
@@ -849,6 +849,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.html
index 1c26c7a54..a1bf01f73 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.html
@@ -12,7 +12,7 @@
@@ -400,130 +400,126 @@
| 236 | 0 | throw new AnalysisException("Could not execute .NET AssemblyAnalyzer"); |
| 237 | |
} |
-
| 238 | 0 | } catch (Throwable e) { |
-
| 239 | 0 | if (e instanceof AnalysisException) { |
-
| 240 | 0 | throw (AnalysisException) e; |
-
| 241 | |
- } else { |
-
| 242 | 0 | LOGGER.warn("An error occurred with the .NET AssemblyAnalyzer;\n" |
-
| 243 | |
- + "this can be ignored unless you are scanning .NET DLLs. Please see the log for more details."); |
-
| 244 | 0 | LOGGER.debug("Could not execute GrokAssembly {}", e.getMessage()); |
-
| 245 | 0 | this.setEnabled(false); |
-
| 246 | 0 | throw new AnalysisException("An error occured with the .NET AssemblyAnalyzer", e); |
-
| 247 | |
- } |
-
| 248 | 5 | } |
-
| 249 | 5 | builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); |
-
| 250 | 5 | } |
+
| 238 | 0 | } catch (AnalysisException e) { |
+
| 239 | 0 | throw e; |
+
| 240 | 0 | } catch (Throwable e) { |
+
| 241 | 0 | LOGGER.warn("An error occurred with the .NET AssemblyAnalyzer;\n" |
+
| 242 | |
+ + "this can be ignored unless you are scanning .NET DLLs. Please see the log for more details."); |
+
| 243 | 0 | LOGGER.debug("Could not execute GrokAssembly {}", e.getMessage()); |
+
| 244 | 0 | this.setEnabled(false); |
+
| 245 | 0 | throw new AnalysisException("An error occurred with the .NET AssemblyAnalyzer", e); |
+
| 246 | 5 | } |
+
| 247 | 5 | builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); |
+
| 248 | 5 | } |
+
| 249 | |
+ |
+
| 250 | |
+ |
| 251 | |
- |
-
| 252 | |
- |
-
| 253 | |
|
-
| 254 | |
+
| 252 | |
|
-
| 255 | |
+
| 253 | |
|
+
| 254 | |
+ |
+
| 255 | |
+ @Override |
| 256 | |
- |
-
| 257 | |
- @Override |
-
| 258 | |
public void close() throws Exception { |
-
| 259 | 6 | super.close(); |
-
| 260 | |
+
| 257 | 6 | super.close(); |
+
| 258 | |
try { |
-
| 261 | 6 | if (grokAssemblyExe != null && !grokAssemblyExe.delete()) { |
-
| 262 | 0 | grokAssemblyExe.deleteOnExit(); |
-
| 263 | |
+
| 259 | 6 | if (grokAssemblyExe != null && !grokAssemblyExe.delete()) { |
+
| 260 | 0 | grokAssemblyExe.deleteOnExit(); |
+
| 261 | |
} |
-
| 264 | 0 | } catch (SecurityException se) { |
-
| 265 | 0 | LOGGER.debug("Can't delete temporary GrokAssembly.exe"); |
-
| 266 | 6 | } |
-
| 267 | 6 | } |
+
| 262 | 0 | } catch (SecurityException se) { |
+
| 263 | 0 | LOGGER.debug("Can't delete temporary GrokAssembly.exe"); |
+
| 264 | 6 | } |
+
| 265 | 6 | } |
+
| 266 | |
+ |
+
| 267 | |
+ |
| 268 | |
- |
-
| 269 | |
- |
-
| 270 | |
|
+
| 269 | |
+ |
+
| 270 | 1 | private static final FileFilter FILTER = FileFilterBuilder.newInstance().addExtensions( |
| 271 | |
- |
-
| 272 | 1 | private static final FileFilter FILTER = FileFilterBuilder.newInstance().addExtensions( |
-
| 273 | |
SUPPORTED_EXTENSIONS).build(); |
+
| 272 | |
+ |
+
| 273 | |
+ @Override |
| 274 | |
- |
-
| 275 | |
- @Override |
-
| 276 | |
protected FileFilter getFileFilter() { |
-
| 277 | 858 | return FILTER; |
+
| 275 | 858 | return FILTER; |
+
| 276 | |
+ } |
+
| 277 | |
+ |
| 278 | |
- } |
+
|
| 279 | |
- |
-
| 280 | |
- |
-
| 281 | |
|
-
| 282 | |
+
| 280 | |
|
-
| 283 | |
+
| 281 | |
|
+
| 282 | |
+ |
+
| 283 | |
+ @Override |
| 284 | |
- |
-
| 285 | |
- @Override |
-
| 286 | |
public String getName() { |
-
| 287 | 5 | return ANALYZER_NAME; |
+
| 285 | 5 | return ANALYZER_NAME; |
+
| 286 | |
+ } |
+
| 287 | |
+ |
| 288 | |
- } |
+
|
| 289 | |
- |
-
| 290 | |
- |
-
| 291 | |
|
-
| 292 | |
+
| 290 | |
|
-
| 293 | |
+
| 291 | |
|
+
| 292 | |
+ |
+
| 293 | |
+ @Override |
| 294 | |
- |
-
| 295 | |
- @Override |
-
| 296 | |
public AnalysisPhase getAnalysisPhase() { |
-
| 297 | 3 | return ANALYSIS_PHASE; |
-
| 298 | |
+
| 295 | 3 | return ANALYSIS_PHASE; |
+
| 296 | |
} |
-
| 299 | |
+
| 297 | |
|
-
| 300 | |
+
| 298 | |
|
-
| 301 | |
+
| 299 | |
|
-
| 302 | |
+
| 300 | |
|
-
| 303 | |
+
| 301 | |
|
-
| 304 | |
+
| 302 | |
|
-
| 305 | |
+
| 303 | |
@Override |
-
| 306 | |
+
| 304 | |
protected String getAnalyzerEnabledSettingKey() { |
-
| 307 | 9 | return Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED; |
-
| 308 | |
+
| 305 | 9 | return Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED; |
+
| 306 | |
} |
-
| 309 | |
+
| 307 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AutoconfAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AutoconfAnalyzer.html
index fc379a8c1..06b96c3c9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AutoconfAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AutoconfAnalyzer.html
@@ -510,6 +510,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CMakeAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CMakeAnalyzer.html
index 937d04efc..e593dc333 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CMakeAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CMakeAnalyzer.html
@@ -12,7 +12,7 @@
@@ -86,340 +86,350 @@
| 34 | |
import java.io.IOException; |
| 35 | |
- import java.security.MessageDigest; |
+
import java.io.UnsupportedEncodingException; |
| 36 | |
- import java.security.NoSuchAlgorithmException; |
+
import java.security.MessageDigest; |
| 37 | |
- import java.util.regex.Matcher; |
+
import java.security.NoSuchAlgorithmException; |
| 38 | |
- import java.util.regex.Pattern; |
+
import java.util.logging.Level; |
| 39 | |
- |
+
import java.util.regex.Matcher; |
| 40 | |
- |
+
import java.util.regex.Pattern; |
| 41 | |
- |
+
|
| 42 | |
- |
+
|
| 43 | |
- |
-
| 44 | |
|
+
| 44 | |
+ |
| 45 | |
- |
+
|
| 46 | |
- |
+
|
| 47 | |
- |
+
|
| 48 | |
- |
+
|
| 49 | |
- |
+
|
| 50 | |
- |
+
|
| 51 | |
- |
-
| 52 | 9 | public class CMakeAnalyzer extends AbstractFileTypeAnalyzer { |
+
|
+
| 52 | |
+ |
| 53 | |
- |
-
| 54 | |
- |
+
|
+
| 54 | 9 | public class CMakeAnalyzer extends AbstractFileTypeAnalyzer { |
| 55 | |
- |
+
|
| 56 | |
- |
-
| 57 | 1 | private static final Logger LOGGER = LoggerFactory.getLogger(CMakeAnalyzer.class); |
+
|
+
| 57 | |
+ |
| 58 | |
- |
-
| 59 | |
- |
+
|
+
| 59 | 1 | private static final Logger LOGGER = LoggerFactory.getLogger(CMakeAnalyzer.class); |
| 60 | |
- |
+
|
| 61 | |
- |
+
|
| 62 | |
- private static final int REGEX_OPTIONS = Pattern.DOTALL |
+
|
| 63 | |
- | Pattern.CASE_INSENSITIVE | Pattern.MULTILINE; |
-
| 64 | |
- |
-
| 65 | |
- |
-
| 66 | |
- |
-
| 67 | |
|
-
| 68 | 1 | private static final Pattern PROJECT = Pattern.compile( |
-
| 69 | |
- "^ *project *\\([ \\n]*(\\w+)[ \\n]*.*?\\)", REGEX_OPTIONS); |
-
| 70 | |
+
| 64 | |
+ private static final int REGEX_OPTIONS = Pattern.DOTALL |
+
| 65 | |
+ | Pattern.CASE_INSENSITIVE | Pattern.MULTILINE; |
+
| 66 | |
|
-
| 71 | |
+
| 67 | |
|
+
| 68 | |
+ |
+
| 69 | |
+ |
+
| 70 | 1 | private static final Pattern PROJECT = Pattern.compile( |
+
| 71 | |
+ "^ *project *\\([ \\n]*(\\w+)[ \\n]*.*?\\)", REGEX_OPTIONS); |
| 72 | |
- |
+
|
| 73 | |
- |
+
|
| 74 | |
- |
+
|
| 75 | |
|
| 76 | |
- |
+
|
| 77 | |
- |
-
| 78 | 1 | private static final Pattern SET_VERSION = Pattern |
-
| 79 | |
- .compile( |
-
| 80 | |
- "^ *set\\s*\\(\\s*(\\w+)_version\\s+\"?(\\d+(?:\\.\\d+)+)[\\s\"]?\\)", |
-
| 81 | |
- REGEX_OPTIONS); |
-
| 82 | |
- |
-
| 83 | |
- |
-
| 84 | |
- |
-
| 85 | |
- |
-
| 86 | 1 | private static final FileFilter FILTER = FileFilterBuilder.newInstance().addExtensions(".cmake") |
-
| 87 | |
- .addFilenames("CMakeLists.txt").build(); |
-
| 88 | |
- |
-
| 89 | |
- |
-
| 90 | |
- |
-
| 91 | |
- |
-
| 92 | 1 | private static MessageDigest sha1 = null; |
-
| 93 | |
- |
-
| 94 | |
- static { |
-
| 95 | |
- try { |
-
| 96 | 1 | sha1 = MessageDigest.getInstance("SHA1"); |
-
| 97 | 0 | } catch (NoSuchAlgorithmException e) { |
-
| 98 | 0 | LOGGER.error(e.getMessage()); |
-
| 99 | 1 | } |
-
| 100 | 1 | } |
-
| 101 | |
- |
-
| 102 | |
- |
-
| 103 | |
- |
-
| 104 | |
|
+
| 78 | |
+ |
+
| 79 | |
+ |
+
| 80 | 1 | private static final Pattern SET_VERSION = Pattern |
+
| 81 | |
+ .compile( |
+
| 82 | |
+ "^ *set\\s*\\(\\s*(\\w+)_version\\s+\"?(\\d+(?:\\.\\d+)+)[\\s\"]?\\)", |
+
| 83 | |
+ REGEX_OPTIONS); |
+
| 84 | |
+ |
+
| 85 | |
+ |
+
| 86 | |
+ |
+
| 87 | |
+ |
+
| 88 | 1 | private static final FileFilter FILTER = FileFilterBuilder.newInstance().addExtensions(".cmake") |
+
| 89 | |
+ .addFilenames("CMakeLists.txt").build(); |
+
| 90 | |
+ |
+
| 91 | |
+ |
+
| 92 | |
+ |
+
| 93 | |
+ |
+
| 94 | 1 | private static MessageDigest sha1 = null; |
+
| 95 | |
+ |
+
| 96 | |
+ static { |
+
| 97 | |
+ try { |
+
| 98 | 1 | sha1 = MessageDigest.getInstance("SHA1"); |
+
| 99 | 0 | } catch (NoSuchAlgorithmException e) { |
+
| 100 | 0 | LOGGER.error(e.getMessage()); |
+
| 101 | 1 | } |
+
| 102 | 1 | } |
+
| 103 | |
+ |
+
| 104 | |
+ |
| 105 | |
- |
+
|
| 106 | |
|
| 107 | |
- |
+
|
| 108 | |
- @Override |
+
|
| 109 | |
- public String getName() { |
-
| 110 | 5 | return "CMake Analyzer"; |
+
|
+
| 110 | |
+ @Override |
| 111 | |
- } |
-
| 112 | |
- |
+
public String getName() { |
+
| 112 | 5 | return "CMake Analyzer"; |
| 113 | |
- |
+
} |
| 114 | |
- |
+
|
| 115 | |
- |
+
|
| 116 | |
- |
+
|
| 117 | |
- |
+
|
| 118 | |
- @Override |
+
|
| 119 | |
- public AnalysisPhase getAnalysisPhase() { |
-
| 120 | 3 | return AnalysisPhase.INFORMATION_COLLECTION; |
+
|
+
| 120 | |
+ @Override |
| 121 | |
- } |
-
| 122 | |
- |
+
public AnalysisPhase getAnalysisPhase() { |
+
| 122 | 3 | return AnalysisPhase.INFORMATION_COLLECTION; |
| 123 | |
- |
+
} |
| 124 | |
- |
+
|
| 125 | |
- |
+
|
| 126 | |
- |
+
|
| 127 | |
- |
+
|
| 128 | |
- @Override |
+
|
| 129 | |
- protected FileFilter getFileFilter() { |
-
| 130 | 855 | return FILTER; |
+
|
+
| 130 | |
+ @Override |
| 131 | |
- } |
-
| 132 | |
- |
+
protected FileFilter getFileFilter() { |
+
| 132 | 855 | return FILTER; |
| 133 | |
- |
-
| 134 | |
- |
-
| 135 | |
- |
-
| 136 | |
- |
-
| 137 | |
- |
-
| 138 | |
- @Override |
-
| 139 | |
- protected void initializeFileTypeAnalyzer() throws Exception { |
-
| 140 | |
- |
-
| 141 | 5 | } |
-
| 142 | |
- |
-
| 143 | |
- |
-
| 144 | |
- |
-
| 145 | |
- |
-
| 146 | |
- |
-
| 147 | |
- |
-
| 148 | |
- |
-
| 149 | |
- |
-
| 150 | |
- @Override |
-
| 151 | |
- protected void analyzeFileType(Dependency dependency, Engine engine) |
-
| 152 | |
- throws AnalysisException { |
-
| 153 | 3 | final File file = dependency.getActualFile(); |
-
| 154 | 3 | final String parentName = file.getParentFile().getName(); |
-
| 155 | 3 | final String name = file.getName(); |
-
| 156 | 3 | dependency.setDisplayFileName(String.format("%s%c%s", parentName, File.separatorChar, name)); |
-
| 157 | |
- String contents; |
-
| 158 | |
- try { |
-
| 159 | 3 | contents = FileUtils.readFileToString(file).trim(); |
-
| 160 | 0 | } catch (IOException e) { |
-
| 161 | 0 | throw new AnalysisException( |
-
| 162 | |
- "Problem occurred while reading dependency file.", e); |
-
| 163 | 3 | } |
-
| 164 | |
- |
-
| 165 | 3 | if (StringUtils.isNotBlank(contents)) { |
-
| 166 | 3 | final Matcher m = PROJECT.matcher(contents); |
-
| 167 | 3 | int count = 0; |
-
| 168 | 5 | while (m.find()) { |
-
| 169 | 2 | count++; |
-
| 170 | 2 | LOGGER.debug(String.format( |
-
| 171 | |
- "Found project command match with %d groups: %s", |
-
| 172 | |
- m.groupCount(), m.group(0))); |
-
| 173 | 2 | final String group = m.group(1); |
-
| 174 | 2 | LOGGER.debug("Group 1: " + group); |
-
| 175 | 2 | dependency.getProductEvidence().addEvidence(name, "Project", |
-
| 176 | |
- group, Confidence.HIGH); |
-
| 177 | 2 | } |
-
| 178 | 3 | LOGGER.debug("Found {} matches.", count); |
-
| 179 | 3 | analyzeSetVersionCommand(dependency, engine, contents); |
-
| 180 | |
- } |
-
| 181 | 3 | } |
-
| 182 | |
- |
-
| 183 | |
- |
-
| 184 | |
- |
-
| 185 | |
- |
-
| 186 | |
- |
-
| 187 | |
- |
-
| 188 | |
- |
-
| 189 | |
- |
-
| 190 | |
- |
-
| 191 | |
- private void analyzeSetVersionCommand(Dependency dependency, Engine engine, String contents) { |
-
| 192 | 3 | Dependency currentDep = dependency; |
-
| 193 | |
- |
-
| 194 | 3 | final Matcher m = SET_VERSION.matcher(contents); |
-
| 195 | 3 | int count = 0; |
-
| 196 | 8 | while (m.find()) { |
-
| 197 | 5 | count++; |
-
| 198 | 5 | LOGGER.debug("Found project command match with {} groups: {}", |
-
| 199 | |
- m.groupCount(), m.group(0)); |
-
| 200 | 5 | String product = m.group(1); |
-
| 201 | 5 | final String version = m.group(2); |
-
| 202 | 5 | LOGGER.debug("Group 1: " + product); |
-
| 203 | 5 | LOGGER.debug("Group 2: " + version); |
-
| 204 | 5 | final String aliasPrefix = "ALIASOF_"; |
-
| 205 | 5 | if (product.startsWith(aliasPrefix)) { |
-
| 206 | 5 | product = product.replaceFirst(aliasPrefix, ""); |
-
| 207 | |
- } |
-
| 208 | 5 | if (count > 1) { |
-
| 209 | |
- |
-
| 210 | 4 | currentDep = new Dependency(dependency.getActualFile()); |
-
| 211 | 4 | currentDep.setDisplayFileName(String.format("%s:%s", dependency.getDisplayFileName(), product)); |
-
| 212 | 4 | final String filePath = String.format("%s:%s", dependency.getFilePath(), product); |
-
| 213 | 4 | currentDep.setFilePath(filePath); |
-
| 214 | |
- |
-
| 215 | |
- |
-
| 216 | 4 | currentDep.setSha1sum(Checksum.getHex(sha1.digest(filePath.getBytes()))); |
-
| 217 | 4 | engine.getDependencies().add(currentDep); |
-
| 218 | |
- } |
-
| 219 | 5 | final String source = currentDep.getDisplayFileName(); |
-
| 220 | 5 | currentDep.getProductEvidence().addEvidence(source, "Product", |
-
| 221 | |
- product, Confidence.MEDIUM); |
-
| 222 | 5 | currentDep.getVersionEvidence().addEvidence(source, "Version", |
-
| 223 | |
- version, Confidence.MEDIUM); |
-
| 224 | 5 | } |
-
| 225 | 3 | LOGGER.debug(String.format("Found %d matches.", count)); |
-
| 226 | 3 | } |
-
| 227 | |
- |
-
| 228 | |
- @Override |
-
| 229 | |
- protected String getAnalyzerEnabledSettingKey() { |
-
| 230 | 9 | return Settings.KEYS.ANALYZER_CMAKE_ENABLED; |
-
| 231 | |
} |
-
| 232 | |
+
| 134 | |
+ |
+
| 135 | |
+ |
+
| 136 | |
+ |
+
| 137 | |
+ |
+
| 138 | |
+ |
+
| 139 | |
+ |
+
| 140 | |
+ @Override |
+
| 141 | |
+ protected void initializeFileTypeAnalyzer() throws Exception { |
+
| 142 | |
+ |
+
| 143 | 5 | } |
+
| 144 | |
+ |
+
| 145 | |
+ |
+
| 146 | |
+ |
+
| 147 | |
+ |
+
| 148 | |
+ |
+
| 149 | |
+ |
+
| 150 | |
+ |
+
| 151 | |
+ |
+
| 152 | |
+ @Override |
+
| 153 | |
+ protected void analyzeFileType(Dependency dependency, Engine engine) |
+
| 154 | |
+ throws AnalysisException { |
+
| 155 | 3 | final File file = dependency.getActualFile(); |
+
| 156 | 3 | final String parentName = file.getParentFile().getName(); |
+
| 157 | 3 | final String name = file.getName(); |
+
| 158 | 3 | dependency.setDisplayFileName(String.format("%s%c%s", parentName, File.separatorChar, name)); |
+
| 159 | |
+ String contents; |
+
| 160 | |
+ try { |
+
| 161 | 3 | contents = FileUtils.readFileToString(file).trim(); |
+
| 162 | 0 | } catch (IOException e) { |
+
| 163 | 0 | throw new AnalysisException( |
+
| 164 | |
+ "Problem occurred while reading dependency file.", e); |
+
| 165 | 3 | } |
+
| 166 | |
+ |
+
| 167 | 3 | if (StringUtils.isNotBlank(contents)) { |
+
| 168 | 3 | final Matcher m = PROJECT.matcher(contents); |
+
| 169 | 3 | int count = 0; |
+
| 170 | 5 | while (m.find()) { |
+
| 171 | 2 | count++; |
+
| 172 | 2 | LOGGER.debug(String.format( |
+
| 173 | |
+ "Found project command match with %d groups: %s", |
+
| 174 | |
+ m.groupCount(), m.group(0))); |
+
| 175 | 2 | final String group = m.group(1); |
+
| 176 | 2 | LOGGER.debug("Group 1: " + group); |
+
| 177 | 2 | dependency.getProductEvidence().addEvidence(name, "Project", |
+
| 178 | |
+ group, Confidence.HIGH); |
+
| 179 | 2 | } |
+
| 180 | 3 | LOGGER.debug("Found {} matches.", count); |
+
| 181 | 3 | analyzeSetVersionCommand(dependency, engine, contents); |
+
| 182 | |
+ } |
+
| 183 | 3 | } |
+
| 184 | |
+ |
+
| 185 | |
+ |
+
| 186 | |
+ |
+
| 187 | |
+ |
+
| 188 | |
+ |
+
| 189 | |
+ |
+
| 190 | |
+ |
+
| 191 | |
+ |
+
| 192 | |
+ |
+
| 193 | |
+ private void analyzeSetVersionCommand(Dependency dependency, Engine engine, String contents) { |
+
| 194 | 3 | Dependency currentDep = dependency; |
+
| 195 | |
+ |
+
| 196 | 3 | final Matcher m = SET_VERSION.matcher(contents); |
+
| 197 | 3 | int count = 0; |
+
| 198 | 8 | while (m.find()) { |
+
| 199 | 5 | count++; |
+
| 200 | 5 | LOGGER.debug("Found project command match with {} groups: {}", |
+
| 201 | |
+ m.groupCount(), m.group(0)); |
+
| 202 | 5 | String product = m.group(1); |
+
| 203 | 5 | final String version = m.group(2); |
+
| 204 | 5 | LOGGER.debug("Group 1: " + product); |
+
| 205 | 5 | LOGGER.debug("Group 2: " + version); |
+
| 206 | 5 | final String aliasPrefix = "ALIASOF_"; |
+
| 207 | 5 | if (product.startsWith(aliasPrefix)) { |
+
| 208 | 5 | product = product.replaceFirst(aliasPrefix, ""); |
+
| 209 | |
+ } |
+
| 210 | 5 | if (count > 1) { |
+
| 211 | |
+ |
+
| 212 | 4 | currentDep = new Dependency(dependency.getActualFile()); |
+
| 213 | 4 | currentDep.setDisplayFileName(String.format("%s:%s", dependency.getDisplayFileName(), product)); |
+
| 214 | 4 | final String filePath = String.format("%s:%s", dependency.getFilePath(), product); |
+
| 215 | 4 | currentDep.setFilePath(filePath); |
+
| 216 | |
+ |
+
| 217 | |
+ byte[] path; |
+
| 218 | |
+ try { |
+
| 219 | 4 | path = filePath.getBytes("UTF-8"); |
+
| 220 | 0 | } catch (UnsupportedEncodingException ex) { |
+
| 221 | 0 | path = filePath.getBytes(); |
+
| 222 | 4 | } |
+
| 223 | 4 | currentDep.setSha1sum(Checksum.getHex(sha1.digest(path))); |
+
| 224 | 4 | engine.getDependencies().add(currentDep); |
+
| 225 | |
+ } |
+
| 226 | 5 | final String source = currentDep.getDisplayFileName(); |
+
| 227 | 5 | currentDep.getProductEvidence().addEvidence(source, "Product", |
+
| 228 | |
+ product, Confidence.MEDIUM); |
+
| 229 | 5 | currentDep.getVersionEvidence().addEvidence(source, "Version", |
+
| 230 | |
+ version, Confidence.MEDIUM); |
+
| 231 | 5 | } |
+
| 232 | 3 | LOGGER.debug(String.format("Found %d matches.", count)); |
+
| 233 | 3 | } |
+
| 234 | |
+ |
+
| 235 | |
+ @Override |
+
| 236 | |
+ protected String getAnalyzerEnabledSettingKey() { |
+
| 237 | 9 | return Settings.KEYS.ANALYZER_CMAKE_ENABLED; |
+
| 238 | |
+ } |
+
| 239 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html
index d6bac791d..c1d4d5644 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html
@@ -12,9 +12,9 @@
@@ -285,1015 +285,1018 @@
|
| 136 | |
public void open() throws IOException, DatabaseException { |
-
| 137 | 1 | cve = new CveDB(); |
-
| 138 | 1 | cve.open(); |
-
| 139 | 1 | cpe = CpeMemoryIndex.getInstance(); |
-
| 140 | |
- try { |
-
| 141 | 1 | LOGGER.info("Creating the CPE Index"); |
-
| 142 | 1 | final long creationStart = System.currentTimeMillis(); |
-
| 143 | 1 | cpe.open(cve); |
-
| 144 | 1 | LOGGER.info("CPE Index Created ({} ms)", System.currentTimeMillis() - creationStart); |
-
| 145 | 0 | } catch (IndexException ex) { |
-
| 146 | 0 | LOGGER.debug("IndexException", ex); |
-
| 147 | 0 | throw new DatabaseException(ex); |
-
| 148 | 1 | } |
-
| 149 | 1 | } |
+
| 137 | 1 | if (!isOpen()) { |
+
| 138 | 1 | cve = new CveDB(); |
+
| 139 | 1 | cve.open(); |
+
| 140 | 1 | cpe = CpeMemoryIndex.getInstance(); |
+
| 141 | |
+ try { |
+
| 142 | 1 | LOGGER.info("Creating the CPE Index"); |
+
| 143 | 1 | final long creationStart = System.currentTimeMillis(); |
+
| 144 | 1 | cpe.open(cve); |
+
| 145 | 1 | LOGGER.info("CPE Index Created ({} ms)", System.currentTimeMillis() - creationStart); |
+
| 146 | 0 | } catch (IndexException ex) { |
+
| 147 | 0 | LOGGER.debug("IndexException", ex); |
+
| 148 | 0 | throw new DatabaseException(ex); |
+
| 149 | 1 | } |
| 150 | |
- |
-
| 151 | |
- |
+
} |
+
| 151 | 1 | } |
| 152 | |
- |
+
|
| 153 | |
- |
+
|
| 154 | |
- @Override |
+
|
| 155 | |
+ |
+
| 156 | |
+ @Override |
+
| 157 | |
public void close() { |
-
| 156 | 1 | if (cpe != null) { |
-
| 157 | 1 | cpe.close(); |
-
| 158 | 1 | cpe = null; |
-
| 159 | |
+
| 158 | 1 | if (cpe != null) { |
+
| 159 | 1 | cpe.close(); |
+
| 160 | 1 | cpe = null; |
+
| 161 | |
} |
-
| 160 | 1 | if (cve != null) { |
-
| 161 | 1 | cve.close(); |
-
| 162 | 1 | cve = null; |
-
| 163 | |
- } |
-
| 164 | 1 | } |
+
| 162 | 1 | if (cve != null) { |
+
| 163 | 1 | cve.close(); |
+
| 164 | 1 | cve = null; |
| 165 | |
- |
-
| 166 | |
- public boolean isOpen() { |
-
| 167 | 0 | return cpe != null && cpe.isOpen(); |
-
| 168 | |
- } |
-
| 169 | |
- |
-
| 170 | |
- |
-
| 171 | |
- |
-
| 172 | |
- |
-
| 173 | |
- |
-
| 174 | |
- |
-
| 175 | |
- |
-
| 176 | |
- |
-
| 177 | |
- |
-
| 178 | |
- |
-
| 179 | |
- protected void determineCPE(Dependency dependency) throws CorruptIndexException, IOException, ParseException { |
-
| 180 | |
- |
-
| 181 | 2 | String vendors = ""; |
-
| 182 | 2 | String products = ""; |
-
| 183 | 7 | for (Confidence confidence : Confidence.values()) { |
-
| 184 | 6 | if (dependency.getVendorEvidence().contains(confidence)) { |
-
| 185 | 5 | vendors = addEvidenceWithoutDuplicateTerms(vendors, dependency.getVendorEvidence(), confidence); |
-
| 186 | 5 | LOGGER.debug("vendor search: {}", vendors); |
-
| 187 | |
- } |
-
| 188 | 6 | if (dependency.getProductEvidence().contains(confidence)) { |
-
| 189 | 5 | products = addEvidenceWithoutDuplicateTerms(products, dependency.getProductEvidence(), confidence); |
-
| 190 | 5 | LOGGER.debug("product search: {}", products); |
-
| 191 | |
- } |
-
| 192 | 6 | if (!vendors.isEmpty() && !products.isEmpty()) { |
-
| 193 | 6 | final List<IndexEntry> entries = searchCPE(vendors, products, dependency.getProductEvidence().getWeighting(), |
-
| 194 | |
- dependency.getVendorEvidence().getWeighting()); |
-
| 195 | 6 | if (entries == null) { |
-
| 196 | 0 | continue; |
-
| 197 | |
- } |
-
| 198 | 6 | boolean identifierAdded = false; |
-
| 199 | 6 | for (IndexEntry e : entries) { |
-
| 200 | 43 | LOGGER.debug("Verifying entry: {}", e); |
-
| 201 | 43 | if (verifyEntry(e, dependency)) { |
-
| 202 | 3 | final String vendor = e.getVendor(); |
-
| 203 | 3 | final String product = e.getProduct(); |
-
| 204 | 3 | LOGGER.debug("identified vendor/product: {}/{}", vendor, product); |
-
| 205 | 3 | identifierAdded |= determineIdentifiers(dependency, vendor, product, confidence); |
-
| 206 | |
- } |
-
| 207 | 43 | } |
-
| 208 | 6 | if (identifierAdded) { |
-
| 209 | 1 | break; |
-
| 210 | |
- } |
-
| 211 | |
- } |
-
| 212 | |
} |
-
| 213 | 2 | } |
-
| 214 | |
+
| 166 | 1 | } |
+
| 167 | |
|
-
| 215 | |
- |
-
| 216 | |
- |
-
| 217 | |
- |
-
| 218 | |
- |
-
| 219 | |
- |
-
| 220 | |
- |
-
| 221 | |
- |
-
| 222 | |
- |
-
| 223 | |
- |
-
| 224 | |
- |
-
| 225 | |
- private String addEvidenceWithoutDuplicateTerms(final String text, final EvidenceCollection ec, Confidence confidenceFilter) { |
-
| 226 | 10 | final String txt = (text == null) ? "" : text; |
-
| 227 | 10 | final StringBuilder sb = new StringBuilder(txt.length() + (20 * ec.size())); |
-
| 228 | 10 | sb.append(' ').append(txt).append(' '); |
-
| 229 | 10 | for (Evidence e : ec.iterator(confidenceFilter)) { |
-
| 230 | 41 | String value = e.getValue(); |
-
| 231 | |
- |
-
| 232 | |
- |
-
| 233 | |
- |
-
| 234 | 41 | if (value.startsWith("http://")) { |
-
| 235 | 2 | value = value.substring(7).replaceAll("\\.", " "); |
-
| 236 | |
- } |
-
| 237 | 41 | if (value.startsWith("https://")) { |
-
| 238 | 0 | value = value.substring(8).replaceAll("\\.", " "); |
-
| 239 | |
- } |
-
| 240 | 41 | if (sb.indexOf(" " + value + " ") < 0) { |
-
| 241 | 37 | sb.append(value).append(' '); |
-
| 242 | |
- } |
-
| 243 | 41 | } |
-
| 244 | 10 | return sb.toString().trim(); |
-
| 245 | |
+
| 168 | |
+ public boolean isOpen() { |
+
| 169 | 1 | return cpe != null && cpe.isOpen(); |
+
| 170 | |
} |
-
| 246 | |
+
| 171 | |
|
-
| 247 | |
+
| 172 | |
|
-
| 248 | |
- |
-
| 249 | |
- |
-
| 250 | |
- |
-
| 251 | |
+
| 173 | |
+ |
+
| 174 | |
+ |
+
| 175 | |
|
-
| 252 | |
- |
-
| 253 | |
- |
-
| 254 | |
- |
-
| 255 | |
- |
-
| 256 | |
- |
-
| 257 | |
- |
-
| 258 | |
- |
-
| 259 | |
- |
-
| 260 | |
- |
-
| 261 | |
+
| 176 | |
+ |
+
| 177 | |
+ |
+
| 178 | |
+ |
+
| 179 | |
+ |
+
| 180 | |
|
-
| 262 | |
- protected List<IndexEntry> searchCPE(String vendor, String product, |
-
| 263 | |
- Set<String> vendorWeightings, Set<String> productWeightings) { |
-
| 264 | |
+
| 181 | |
+ protected void determineCPE(Dependency dependency) throws CorruptIndexException, IOException, ParseException { |
+
| 182 | |
+ |
+
| 183 | 2 | String vendors = ""; |
+
| 184 | 2 | String products = ""; |
+
| 185 | 7 | for (Confidence confidence : Confidence.values()) { |
+
| 186 | 6 | if (dependency.getVendorEvidence().contains(confidence)) { |
+
| 187 | 5 | vendors = addEvidenceWithoutDuplicateTerms(vendors, dependency.getVendorEvidence(), confidence); |
+
| 188 | 5 | LOGGER.debug("vendor search: {}", vendors); |
+
| 189 | |
+ } |
+
| 190 | 6 | if (dependency.getProductEvidence().contains(confidence)) { |
+
| 191 | 5 | products = addEvidenceWithoutDuplicateTerms(products, dependency.getProductEvidence(), confidence); |
+
| 192 | 5 | LOGGER.debug("product search: {}", products); |
+
| 193 | |
+ } |
+
| 194 | 6 | if (!vendors.isEmpty() && !products.isEmpty()) { |
+
| 195 | 6 | final List<IndexEntry> entries = searchCPE(vendors, products, dependency.getProductEvidence().getWeighting(), |
+
| 196 | |
+ dependency.getVendorEvidence().getWeighting()); |
+
| 197 | 6 | if (entries == null) { |
+
| 198 | 0 | continue; |
+
| 199 | |
+ } |
+
| 200 | 6 | boolean identifierAdded = false; |
+
| 201 | 6 | for (IndexEntry e : entries) { |
+
| 202 | 43 | LOGGER.debug("Verifying entry: {}", e); |
+
| 203 | 43 | if (verifyEntry(e, dependency)) { |
+
| 204 | 3 | final String vendor = e.getVendor(); |
+
| 205 | 3 | final String product = e.getProduct(); |
+
| 206 | 3 | LOGGER.debug("identified vendor/product: {}/{}", vendor, product); |
+
| 207 | 3 | identifierAdded |= determineIdentifiers(dependency, vendor, product, confidence); |
+
| 208 | |
+ } |
+
| 209 | 43 | } |
+
| 210 | 6 | if (identifierAdded) { |
+
| 211 | 1 | break; |
+
| 212 | |
+ } |
+
| 213 | |
+ } |
+
| 214 | |
+ } |
+
| 215 | 2 | } |
+
| 216 | |
|
-
| 265 | 6 | final List<IndexEntry> ret = new ArrayList<IndexEntry>(MAX_QUERY_RESULTS); |
+
| 217 | |
+ |
+
| 218 | |
+ |
+
| 219 | |
+ |
+
| 220 | |
+ |
+
| 221 | |
+ |
+
| 222 | |
+ |
+
| 223 | |
+ |
+
| 224 | |
+ |
+
| 225 | |
+ |
+
| 226 | |
+ |
+
| 227 | |
+ private String addEvidenceWithoutDuplicateTerms(final String text, final EvidenceCollection ec, Confidence confidenceFilter) { |
+
| 228 | 10 | final String txt = (text == null) ? "" : text; |
+
| 229 | 10 | final StringBuilder sb = new StringBuilder(txt.length() + (20 * ec.size())); |
+
| 230 | 10 | sb.append(' ').append(txt).append(' '); |
+
| 231 | 10 | for (Evidence e : ec.iterator(confidenceFilter)) { |
+
| 232 | 41 | String value = e.getValue(); |
+
| 233 | |
+ |
+
| 234 | |
+ |
+
| 235 | |
+ |
+
| 236 | 41 | if (value.startsWith("http://")) { |
+
| 237 | 2 | value = value.substring(7).replaceAll("\\.", " "); |
+
| 238 | |
+ } |
+
| 239 | 41 | if (value.startsWith("https://")) { |
+
| 240 | 0 | value = value.substring(8).replaceAll("\\.", " "); |
+
| 241 | |
+ } |
+
| 242 | 41 | if (sb.indexOf(" " + value + " ") < 0) { |
+
| 243 | 37 | sb.append(value).append(' '); |
+
| 244 | |
+ } |
+
| 245 | 41 | } |
+
| 246 | 10 | return sb.toString().trim(); |
+
| 247 | |
+ } |
+
| 248 | |
+ |
+
| 249 | |
+ |
+
| 250 | |
+ |
+
| 251 | |
+ |
+
| 252 | |
+ |
+
| 253 | |
+ |
+
| 254 | |
+ |
+
| 255 | |
+ |
+
| 256 | |
+ |
+
| 257 | |
+ |
+
| 258 | |
+ |
+
| 259 | |
+ |
+
| 260 | |
+ |
+
| 261 | |
+ |
+
| 262 | |
+ |
+
| 263 | |
+ |
+
| 264 | |
+ protected List<IndexEntry> searchCPE(String vendor, String product, |
+
| 265 | |
+ Set<String> vendorWeightings, Set<String> productWeightings) { |
| 266 | |
|
-
| 267 | 6 | final String searchString = buildSearch(vendor, product, vendorWeightings, productWeightings); |
-
| 268 | 6 | if (searchString == null) { |
-
| 269 | 0 | return ret; |
-
| 270 | |
+
| 267 | 6 | final List<IndexEntry> ret = new ArrayList<IndexEntry>(MAX_QUERY_RESULTS); |
+
| 268 | |
+ |
+
| 269 | 6 | final String searchString = buildSearch(vendor, product, vendorWeightings, productWeightings); |
+
| 270 | 6 | if (searchString == null) { |
+
| 271 | 0 | return ret; |
+
| 272 | |
} |
-
| 271 | |
+
| 273 | |
try { |
-
| 272 | 6 | final TopDocs docs = cpe.search(searchString, MAX_QUERY_RESULTS); |
-
| 273 | 156 | for (ScoreDoc d : docs.scoreDocs) { |
-
| 274 | 150 | if (d.score >= 0.08) { |
-
| 275 | 43 | final Document doc = cpe.getDocument(d.doc); |
-
| 276 | 43 | final IndexEntry entry = new IndexEntry(); |
-
| 277 | 43 | entry.setVendor(doc.get(Fields.VENDOR)); |
-
| 278 | 43 | entry.setProduct(doc.get(Fields.PRODUCT)); |
-
| 279 | 43 | entry.setSearchScore(d.score); |
-
| 280 | 43 | if (!ret.contains(entry)) { |
-
| 281 | 43 | ret.add(entry); |
-
| 282 | |
- } |
-
| 283 | |
- } |
+
| 274 | 6 | final TopDocs docs = cpe.search(searchString, MAX_QUERY_RESULTS); |
+
| 275 | 156 | for (ScoreDoc d : docs.scoreDocs) { |
+
| 276 | 150 | if (d.score >= 0.08) { |
+
| 277 | 43 | final Document doc = cpe.getDocument(d.doc); |
+
| 278 | 43 | final IndexEntry entry = new IndexEntry(); |
+
| 279 | 43 | entry.setVendor(doc.get(Fields.VENDOR)); |
+
| 280 | 43 | entry.setProduct(doc.get(Fields.PRODUCT)); |
+
| 281 | 43 | entry.setSearchScore(d.score); |
+
| 282 | 43 | if (!ret.contains(entry)) { |
+
| 283 | 43 | ret.add(entry); |
| 284 | |
+ } |
+
| 285 | |
+ } |
+
| 286 | |
} |
-
| 285 | 6 | return ret; |
-
| 286 | 0 | } catch (ParseException ex) { |
-
| 287 | 0 | LOGGER.warn("An error occured querying the CPE data. See the log for more details."); |
-
| 288 | 0 | LOGGER.info("Unable to parse: {}", searchString, ex); |
-
| 289 | 0 | } catch (IOException ex) { |
-
| 290 | 0 | LOGGER.warn("An error occured reading CPE data. See the log for more details."); |
-
| 291 | 0 | LOGGER.info("IO Error with search string: {}", searchString, ex); |
-
| 292 | 0 | } |
-
| 293 | 0 | return null; |
-
| 294 | |
- } |
-
| 295 | |
- |
+
| 287 | 6 | return ret; |
+
| 288 | 0 | } catch (ParseException ex) { |
+
| 289 | 0 | LOGGER.warn("An error occurred querying the CPE data. See the log for more details."); |
+
| 290 | 0 | LOGGER.info("Unable to parse: {}", searchString, ex); |
+
| 291 | 0 | } catch (IOException ex) { |
+
| 292 | 0 | LOGGER.warn("An error occurred reading CPE data. See the log for more details."); |
+
| 293 | 0 | LOGGER.info("IO Error with search string: {}", searchString, ex); |
+
| 294 | 0 | } |
+
| 295 | 0 | return null; |
| 296 | |
- |
-
| 297 | |
- |
-
| 298 | |
- |
-
| 299 | |
- |
-
| 300 | |
- |
-
| 301 | |
- |
-
| 302 | |
- |
-
| 303 | |
- |
-
| 304 | |
- |
-
| 305 | |
- |
-
| 306 | |
- |
-
| 307 | |
- |
-
| 308 | |
- |
-
| 309 | |
- |
-
| 310 | |
- protected String buildSearch(String vendor, String product, |
-
| 311 | |
- Set<String> vendorWeighting, Set<String> productWeightings) { |
-
| 312 | 6 | final String v = vendor; |
-
| 313 | 6 | final String p = product; |
-
| 314 | 6 | final StringBuilder sb = new StringBuilder(v.length() + p.length() |
-
| 315 | |
- + Fields.PRODUCT.length() + Fields.VENDOR.length() + STRING_BUILDER_BUFFER); |
-
| 316 | |
- |
-
| 317 | 6 | if (!appendWeightedSearch(sb, Fields.PRODUCT, p, productWeightings)) { |
-
| 318 | 0 | return null; |
-
| 319 | |
- } |
-
| 320 | 6 | sb.append(" AND "); |
-
| 321 | 6 | if (!appendWeightedSearch(sb, Fields.VENDOR, v, vendorWeighting)) { |
-
| 322 | 0 | return null; |
-
| 323 | |
- } |
-
| 324 | 6 | return sb.toString(); |
-
| 325 | |
} |
-
| 326 | |
+
| 297 | |
|
-
| 327 | |
+
| 298 | |
|
-
| 328 | |
- |
-
| 329 | |
- |
-
| 330 | |
+
| 299 | |
+ |
+
| 300 | |
+ |
+
| 301 | |
|
-
| 331 | |
- |
-
| 332 | |
- |
-
| 333 | |
- |
-
| 334 | |
- |
-
| 335 | |
- |
-
| 336 | |
+
| 302 | |
+ |
+
| 303 | |
+ |
+
| 304 | |
+ |
+
| 305 | |
+ |
+
| 306 | |
+ |
+
| 307 | |
+ |
+
| 308 | |
+ |
+
| 309 | |
+ |
+
| 310 | |
+ |
+
| 311 | |
|
-
| 337 | |
- private boolean appendWeightedSearch(StringBuilder sb, String field, String searchText, Set<String> weightedText) { |
-
| 338 | 12 | sb.append(' ').append(field).append(":( "); |
-
| 339 | |
+
| 312 | |
+ protected String buildSearch(String vendor, String product, |
+
| 313 | |
+ Set<String> vendorWeighting, Set<String> productWeightings) { |
+
| 314 | 6 | final String v = vendor; |
+
| 315 | 6 | final String p = product; |
+
| 316 | 6 | final StringBuilder sb = new StringBuilder(v.length() + p.length() |
+
| 317 | |
+ + Fields.PRODUCT.length() + Fields.VENDOR.length() + STRING_BUILDER_BUFFER); |
+
| 318 | |
|
-
| 340 | 12 | final String cleanText = cleanseText(searchText); |
+
| 319 | 6 | if (!appendWeightedSearch(sb, Fields.PRODUCT, p, productWeightings)) { |
+
| 320 | 0 | return null; |
+
| 321 | |
+ } |
+
| 322 | 6 | sb.append(" AND "); |
+
| 323 | 6 | if (!appendWeightedSearch(sb, Fields.VENDOR, v, vendorWeighting)) { |
+
| 324 | 0 | return null; |
+
| 325 | |
+ } |
+
| 326 | 6 | return sb.toString(); |
+
| 327 | |
+ } |
+
| 328 | |
+ |
+
| 329 | |
+ |
+
| 330 | |
+ |
+
| 331 | |
+ |
+
| 332 | |
+ |
+
| 333 | |
+ |
+
| 334 | |
+ |
+
| 335 | |
+ |
+
| 336 | |
+ |
+
| 337 | |
+ |
+
| 338 | |
+ |
+
| 339 | |
+ private boolean appendWeightedSearch(StringBuilder sb, String field, String searchText, Set<String> weightedText) { |
+
| 340 | 12 | sb.append(' ').append(field).append(":( "); |
| 341 | |
|
-
| 342 | 12 | if (cleanText.isEmpty()) { |
-
| 343 | 0 | return false; |
-
| 344 | |
- } |
-
| 345 | |
+
| 342 | 12 | final String cleanText = cleanseText(searchText); |
+
| 343 | |
|
-
| 346 | 12 | if (weightedText == null || weightedText.isEmpty()) { |
-
| 347 | 0 | LuceneUtils.appendEscapedLuceneQuery(sb, cleanText); |
-
| 348 | |
+
| 344 | 12 | if (cleanText.isEmpty()) { |
+
| 345 | 0 | return false; |
+
| 346 | |
+ } |
+
| 347 | |
+ |
+
| 348 | 12 | if (weightedText == null || weightedText.isEmpty()) { |
+
| 349 | 0 | LuceneUtils.appendEscapedLuceneQuery(sb, cleanText); |
+
| 350 | |
} else { |
-
| 349 | 12 | final StringTokenizer tokens = new StringTokenizer(cleanText); |
-
| 350 | 154 | while (tokens.hasMoreElements()) { |
-
| 351 | 142 | final String word = tokens.nextToken(); |
-
| 352 | 142 | StringBuilder temp = null; |
-
| 353 | 142 | for (String weighted : weightedText) { |
-
| 354 | 308 | final String weightedStr = cleanseText(weighted); |
-
| 355 | 308 | if (equalsIgnoreCaseAndNonAlpha(word, weightedStr)) { |
-
| 356 | 22 | temp = new StringBuilder(word.length() + 2); |
-
| 357 | 22 | LuceneUtils.appendEscapedLuceneQuery(temp, word); |
-
| 358 | 22 | temp.append(WEIGHTING_BOOST); |
-
| 359 | 22 | if (!word.equalsIgnoreCase(weightedStr)) { |
-
| 360 | 0 | temp.append(' '); |
-
| 361 | 0 | LuceneUtils.appendEscapedLuceneQuery(temp, weightedStr); |
-
| 362 | 0 | temp.append(WEIGHTING_BOOST); |
-
| 363 | |
- } |
-
| 364 | |
- break; |
+
| 351 | 12 | final StringTokenizer tokens = new StringTokenizer(cleanText); |
+
| 352 | 154 | while (tokens.hasMoreElements()) { |
+
| 353 | 142 | final String word = tokens.nextToken(); |
+
| 354 | 142 | StringBuilder temp = null; |
+
| 355 | 142 | for (String weighted : weightedText) { |
+
| 356 | 308 | final String weightedStr = cleanseText(weighted); |
+
| 357 | 308 | if (equalsIgnoreCaseAndNonAlpha(word, weightedStr)) { |
+
| 358 | 22 | temp = new StringBuilder(word.length() + 2); |
+
| 359 | 22 | LuceneUtils.appendEscapedLuceneQuery(temp, word); |
+
| 360 | 22 | temp.append(WEIGHTING_BOOST); |
+
| 361 | 22 | if (!word.equalsIgnoreCase(weightedStr)) { |
+
| 362 | 0 | temp.append(' '); |
+
| 363 | 0 | LuceneUtils.appendEscapedLuceneQuery(temp, weightedStr); |
+
| 364 | 0 | temp.append(WEIGHTING_BOOST); |
| 365 | |
- } |
-
| 366 | 286 | } |
-
| 367 | 142 | sb.append(' '); |
-
| 368 | 142 | if (temp == null) { |
-
| 369 | 120 | LuceneUtils.appendEscapedLuceneQuery(sb, word); |
-
| 370 | |
- } else { |
-
| 371 | 22 | sb.append(temp); |
-
| 372 | |
- } |
-
| 373 | 142 | } |
-
| 374 | |
- } |
-
| 375 | 12 | sb.append(" ) "); |
-
| 376 | 12 | return true; |
-
| 377 | |
- } |
-
| 378 | |
- |
-
| 379 | |
- |
-
| 380 | |
- |
-
| 381 | |
- |
-
| 382 | |
- |
-
| 383 | |
- |
-
| 384 | |
- |
-
| 385 | |
- private String cleanseText(String text) { |
-
| 386 | 320 | return text.replaceAll(CLEANSE_CHARACTER_RX, " "); |
-
| 387 | |
- } |
-
| 388 | |
- |
-
| 389 | |
- |
-
| 390 | |
- |
-
| 391 | |
- |
-
| 392 | |
- |
-
| 393 | |
- |
-
| 394 | |
- |
-
| 395 | |
- |
-
| 396 | |
- private boolean equalsIgnoreCaseAndNonAlpha(String l, String r) { |
-
| 397 | 308 | if (l == null || r == null) { |
-
| 398 | 0 | return false; |
-
| 399 | |
- } |
-
| 400 | |
- |
-
| 401 | 308 | final String left = l.replaceAll(CLEANSE_NONALPHA_RX, ""); |
-
| 402 | 308 | final String right = r.replaceAll(CLEANSE_NONALPHA_RX, ""); |
-
| 403 | 308 | return left.equalsIgnoreCase(right); |
-
| 404 | |
- } |
-
| 405 | |
- |
-
| 406 | |
- |
-
| 407 | |
- |
-
| 408 | |
- |
-
| 409 | |
- |
-
| 410 | |
- |
-
| 411 | |
- |
-
| 412 | |
- |
-
| 413 | |
- |
-
| 414 | |
- private boolean verifyEntry(final IndexEntry entry, final Dependency dependency) { |
-
| 415 | 43 | boolean isValid = false; |
-
| 416 | |
- |
-
| 417 | |
- |
-
| 418 | |
- |
-
| 419 | 43 | if (collectionContainsString(dependency.getProductEvidence(), entry.getProduct()) |
-
| 420 | |
- && collectionContainsString(dependency.getVendorEvidence(), entry.getVendor())) { |
-
| 421 | |
- |
-
| 422 | 3 | isValid = true; |
-
| 423 | |
- } |
-
| 424 | 43 | return isValid; |
-
| 425 | |
- } |
-
| 426 | |
- |
-
| 427 | |
- |
-
| 428 | |
- |
-
| 429 | |
- |
-
| 430 | |
- |
-
| 431 | |
- |
-
| 432 | |
- |
-
| 433 | |
- |
-
| 434 | |
- private boolean collectionContainsString(EvidenceCollection ec, String text) { |
-
| 435 | |
- |
-
| 436 | 47 | if (text == null) { |
-
| 437 | 0 | return false; |
-
| 438 | |
- } |
-
| 439 | 47 | final String[] words = text.split("[\\s_-]"); |
-
| 440 | 47 | final List<String> list = new ArrayList<String>(); |
-
| 441 | 47 | String tempWord = null; |
-
| 442 | 170 | for (String word : words) { |
-
| 443 | |
- |
-
| 444 | |
- |
-
| 445 | |
- |
-
| 446 | |
- |
-
| 447 | 123 | if (tempWord != null) { |
-
| 448 | 5 | list.add(tempWord + word); |
-
| 449 | 5 | tempWord = null; |
-
| 450 | 118 | } else if (word.length() <= 2) { |
-
| 451 | 5 | tempWord = word; |
-
| 452 | |
- } else { |
-
| 453 | 113 | list.add(word); |
-
| 454 | |
- } |
-
| 455 | |
- } |
-
| 456 | 47 | if (tempWord != null) { |
-
| 457 | 0 | if (!list.isEmpty()) { |
-
| 458 | 0 | final String tmp = list.get(list.size() - 1) + tempWord; |
-
| 459 | 0 | list.add(tmp); |
-
| 460 | 0 | } else { |
-
| 461 | 0 | list.add(tempWord); |
-
| 462 | |
- } |
-
| 463 | |
- } |
-
| 464 | 47 | if (list.isEmpty()) { |
-
| 465 | 0 | return false; |
-
| 466 | |
- } |
-
| 467 | 47 | boolean contains = true; |
-
| 468 | 47 | for (String word : list) { |
-
| 469 | 118 | contains &= ec.containsUsedString(word); |
-
| 470 | 118 | } |
-
| 471 | 47 | return contains; |
-
| 472 | |
- } |
-
| 473 | |
- |
-
| 474 | |
- |
-
| 475 | |
- |
-
| 476 | |
- |
-
| 477 | |
- |
-
| 478 | |
- |
-
| 479 | |
- |
-
| 480 | |
- |
-
| 481 | |
- @Override |
-
| 482 | |
- public void analyze(Dependency dependency, Engine engine) throws AnalysisException { |
-
| 483 | |
- try { |
-
| 484 | 2 | determineCPE(dependency); |
-
| 485 | 0 | } catch (CorruptIndexException ex) { |
-
| 486 | 0 | throw new AnalysisException("CPE Index is corrupt.", ex); |
-
| 487 | 0 | } catch (IOException ex) { |
-
| 488 | 0 | throw new AnalysisException("Failure opening the CPE Index.", ex); |
-
| 489 | 0 | } catch (ParseException ex) { |
-
| 490 | 0 | throw new AnalysisException("Unable to parse the generated Lucene query for this dependency.", ex); |
-
| 491 | 2 | } |
-
| 492 | 2 | } |
-
| 493 | |
- |
-
| 494 | |
- |
-
| 495 | |
- |
-
| 496 | |
- |
-
| 497 | |
- |
-
| 498 | |
- |
-
| 499 | |
- |
-
| 500 | |
- |
-
| 501 | |
- |
-
| 502 | |
- |
-
| 503 | |
- |
-
| 504 | |
- |
-
| 505 | |
- |
-
| 506 | |
- protected boolean determineIdentifiers(Dependency dependency, String vendor, String product, |
-
| 507 | |
- Confidence currentConfidence) throws UnsupportedEncodingException { |
-
| 508 | 3 | final Set<VulnerableSoftware> cpes = cve.getCPEs(vendor, product); |
-
| 509 | 3 | DependencyVersion bestGuess = new DependencyVersion("-"); |
-
| 510 | 3 | Confidence bestGuessConf = null; |
-
| 511 | 3 | boolean hasBroadMatch = false; |
-
| 512 | 3 | final List<IdentifierMatch> collected = new ArrayList<IdentifierMatch>(); |
-
| 513 | 15 | for (Confidence conf : Confidence.values()) { |
-
| 514 | |
- |
-
| 515 | |
- |
-
| 516 | |
- |
-
| 517 | 12 | for (Evidence evidence : dependency.getVersionEvidence().iterator(conf)) { |
-
| 518 | 12 | final DependencyVersion evVer = DependencyVersionUtil.parseVersion(evidence.getValue()); |
-
| 519 | 12 | if (evVer == null) { |
-
| 520 | 0 | continue; |
-
| 521 | |
- } |
-
| 522 | 12 | for (VulnerableSoftware vs : cpes) { |
-
| 523 | |
- DependencyVersion dbVer; |
-
| 524 | 436 | if (vs.getUpdate() != null && !vs.getUpdate().isEmpty()) { |
-
| 525 | 128 | dbVer = DependencyVersionUtil.parseVersion(vs.getVersion() + '.' + vs.getUpdate()); |
-
| 526 | |
- } else { |
-
| 527 | 308 | dbVer = DependencyVersionUtil.parseVersion(vs.getVersion()); |
-
| 528 | |
- } |
-
| 529 | 436 | if (dbVer == null) { |
-
| 530 | 0 | hasBroadMatch = true; |
-
| 531 | 0 | final String url = String.format(NVD_SEARCH_URL, URLEncoder.encode(vs.getName(), "UTF-8")); |
-
| 532 | 0 | final IdentifierMatch match = new IdentifierMatch("cpe", vs.getName(), url, IdentifierConfidence.BROAD_MATCH, conf); |
-
| 533 | 0 | collected.add(match); |
-
| 534 | 0 | } else if (evVer.equals(dbVer)) { |
-
| 535 | 8 | final String url = String.format(NVD_SEARCH_URL, URLEncoder.encode(vs.getName(), "UTF-8")); |
-
| 536 | 8 | final IdentifierMatch match = new IdentifierMatch("cpe", vs.getName(), url, IdentifierConfidence.EXACT_MATCH, conf); |
-
| 537 | 8 | collected.add(match); |
-
| 538 | 8 | } else { |
-
| 539 | |
- |
-
| 540 | 428 | if (evVer.getVersionParts().size() <= dbVer.getVersionParts().size() |
-
| 541 | |
- && evVer.matchesAtLeastThreeLevels(dbVer)) { |
-
| 542 | 64 | if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) { |
-
| 543 | 2 | if (bestGuess.getVersionParts().size() < dbVer.getVersionParts().size()) { |
-
| 544 | 2 | bestGuess = dbVer; |
-
| 545 | 2 | bestGuessConf = conf; |
-
| 546 | |
- } |
-
| 547 | |
- } |
-
| 548 | |
} |
-
| 549 | |
+
| 366 | |
+ break; |
+
| 367 | |
} |
-
| 550 | 436 | } |
-
| 551 | 12 | if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) { |
-
| 552 | 1 | if (bestGuess.getVersionParts().size() < evVer.getVersionParts().size()) { |
-
| 553 | 1 | bestGuess = evVer; |
-
| 554 | 1 | bestGuessConf = conf; |
-
| 555 | |
- } |
-
| 556 | |
- } |
-
| 557 | 12 | } |
-
| 558 | |
- } |
-
| 559 | 3 | final String cpeName = String.format("cpe:/a:%s:%s:%s", vendor, product, bestGuess.toString()); |
-
| 560 | 3 | String url = null; |
-
| 561 | 3 | if (hasBroadMatch) { |
-
| 562 | 0 | final String cpeUrlName = String.format("cpe:/a:%s:%s", vendor, product); |
-
| 563 | 0 | url = String.format(NVD_SEARCH_URL, URLEncoder.encode(cpeUrlName, "UTF-8")); |
-
| 564 | |
- } |
-
| 565 | 3 | if (bestGuessConf == null) { |
-
| 566 | 0 | bestGuessConf = Confidence.LOW; |
-
| 567 | |
- } |
-
| 568 | 3 | final IdentifierMatch match = new IdentifierMatch("cpe", cpeName, url, IdentifierConfidence.BEST_GUESS, bestGuessConf); |
-
| 569 | 3 | collected.add(match); |
-
| 570 | |
- |
-
| 571 | 3 | Collections.sort(collected); |
-
| 572 | 3 | final IdentifierConfidence bestIdentifierQuality = collected.get(0).getConfidence(); |
-
| 573 | 3 | final Confidence bestEvidenceQuality = collected.get(0).getEvidenceConfidence(); |
-
| 574 | 3 | boolean identifierAdded = false; |
-
| 575 | 3 | for (IdentifierMatch m : collected) { |
-
| 576 | 11 | if (bestIdentifierQuality.equals(m.getConfidence()) |
-
| 577 | |
- && bestEvidenceQuality.equals(m.getEvidenceConfidence())) { |
-
| 578 | 3 | final Identifier i = m.getIdentifier(); |
-
| 579 | 3 | if (bestIdentifierQuality == IdentifierConfidence.BEST_GUESS) { |
-
| 580 | 1 | i.setConfidence(Confidence.LOW); |
-
| 581 | |
+
| 368 | 286 | } |
+
| 369 | 142 | sb.append(' '); |
+
| 370 | 142 | if (temp == null) { |
+
| 371 | 120 | LuceneUtils.appendEscapedLuceneQuery(sb, word); |
+
| 372 | |
} else { |
-
| 582 | 2 | i.setConfidence(bestEvidenceQuality); |
+
| 373 | 22 | sb.append(temp); |
+
| 374 | |
+ } |
+
| 375 | 142 | } |
+
| 376 | |
+ } |
+
| 377 | 12 | sb.append(" ) "); |
+
| 378 | 12 | return true; |
+
| 379 | |
+ } |
+
| 380 | |
+ |
+
| 381 | |
+ |
+
| 382 | |
+ |
+
| 383 | |
+ |
+
| 384 | |
+ |
+
| 385 | |
+ |
+
| 386 | |
+ |
+
| 387 | |
+ private String cleanseText(String text) { |
+
| 388 | 320 | return text.replaceAll(CLEANSE_CHARACTER_RX, " "); |
+
| 389 | |
+ } |
+
| 390 | |
+ |
+
| 391 | |
+ |
+
| 392 | |
+ |
+
| 393 | |
+ |
+
| 394 | |
+ |
+
| 395 | |
+ |
+
| 396 | |
+ |
+
| 397 | |
+ |
+
| 398 | |
+ private boolean equalsIgnoreCaseAndNonAlpha(String l, String r) { |
+
| 399 | 308 | if (l == null || r == null) { |
+
| 400 | 0 | return false; |
+
| 401 | |
+ } |
+
| 402 | |
+ |
+
| 403 | 308 | final String left = l.replaceAll(CLEANSE_NONALPHA_RX, ""); |
+
| 404 | 308 | final String right = r.replaceAll(CLEANSE_NONALPHA_RX, ""); |
+
| 405 | 308 | return left.equalsIgnoreCase(right); |
+
| 406 | |
+ } |
+
| 407 | |
+ |
+
| 408 | |
+ |
+
| 409 | |
+ |
+
| 410 | |
+ |
+
| 411 | |
+ |
+
| 412 | |
+ |
+
| 413 | |
+ |
+
| 414 | |
+ |
+
| 415 | |
+ |
+
| 416 | |
+ private boolean verifyEntry(final IndexEntry entry, final Dependency dependency) { |
+
| 417 | 43 | boolean isValid = false; |
+
| 418 | |
+ |
+
| 419 | |
+ |
+
| 420 | |
+ |
+
| 421 | 43 | if (collectionContainsString(dependency.getProductEvidence(), entry.getProduct()) |
+
| 422 | |
+ && collectionContainsString(dependency.getVendorEvidence(), entry.getVendor())) { |
+
| 423 | |
+ |
+
| 424 | 3 | isValid = true; |
+
| 425 | |
+ } |
+
| 426 | 43 | return isValid; |
+
| 427 | |
+ } |
+
| 428 | |
+ |
+
| 429 | |
+ |
+
| 430 | |
+ |
+
| 431 | |
+ |
+
| 432 | |
+ |
+
| 433 | |
+ |
+
| 434 | |
+ |
+
| 435 | |
+ |
+
| 436 | |
+ private boolean collectionContainsString(EvidenceCollection ec, String text) { |
+
| 437 | |
+ |
+
| 438 | 47 | if (text == null) { |
+
| 439 | 0 | return false; |
+
| 440 | |
+ } |
+
| 441 | 47 | final String[] words = text.split("[\\s_-]"); |
+
| 442 | 47 | final List<String> list = new ArrayList<String>(); |
+
| 443 | 47 | String tempWord = null; |
+
| 444 | 170 | for (String word : words) { |
+
| 445 | |
+ |
+
| 446 | |
+ |
+
| 447 | |
+ |
+
| 448 | |
+ |
+
| 449 | 123 | if (tempWord != null) { |
+
| 450 | 5 | list.add(tempWord + word); |
+
| 451 | 5 | tempWord = null; |
+
| 452 | 118 | } else if (word.length() <= 2) { |
+
| 453 | 5 | tempWord = word; |
+
| 454 | |
+ } else { |
+
| 455 | 113 | list.add(word); |
+
| 456 | |
+ } |
+
| 457 | |
+ } |
+
| 458 | 47 | if (tempWord != null) { |
+
| 459 | 0 | if (!list.isEmpty()) { |
+
| 460 | 0 | final String tmp = list.get(list.size() - 1) + tempWord; |
+
| 461 | 0 | list.add(tmp); |
+
| 462 | 0 | } else { |
+
| 463 | 0 | list.add(tempWord); |
+
| 464 | |
+ } |
+
| 465 | |
+ } |
+
| 466 | 47 | if (list.isEmpty()) { |
+
| 467 | 0 | return false; |
+
| 468 | |
+ } |
+
| 469 | 47 | boolean contains = true; |
+
| 470 | 47 | for (String word : list) { |
+
| 471 | 118 | contains &= ec.containsUsedString(word); |
+
| 472 | 118 | } |
+
| 473 | 47 | return contains; |
+
| 474 | |
+ } |
+
| 475 | |
+ |
+
| 476 | |
+ |
+
| 477 | |
+ |
+
| 478 | |
+ |
+
| 479 | |
+ |
+
| 480 | |
+ |
+
| 481 | |
+ |
+
| 482 | |
+ |
+
| 483 | |
+ @Override |
+
| 484 | |
+ public void analyze(Dependency dependency, Engine engine) throws AnalysisException { |
+
| 485 | |
+ try { |
+
| 486 | 2 | determineCPE(dependency); |
+
| 487 | 0 | } catch (CorruptIndexException ex) { |
+
| 488 | 0 | throw new AnalysisException("CPE Index is corrupt.", ex); |
+
| 489 | 0 | } catch (IOException ex) { |
+
| 490 | 0 | throw new AnalysisException("Failure opening the CPE Index.", ex); |
+
| 491 | 0 | } catch (ParseException ex) { |
+
| 492 | 0 | throw new AnalysisException("Unable to parse the generated Lucene query for this dependency.", ex); |
+
| 493 | 2 | } |
+
| 494 | 2 | } |
+
| 495 | |
+ |
+
| 496 | |
+ |
+
| 497 | |
+ |
+
| 498 | |
+ |
+
| 499 | |
+ |
+
| 500 | |
+ |
+
| 501 | |
+ |
+
| 502 | |
+ |
+
| 503 | |
+ |
+
| 504 | |
+ |
+
| 505 | |
+ |
+
| 506 | |
+ |
+
| 507 | |
+ |
+
| 508 | |
+ protected boolean determineIdentifiers(Dependency dependency, String vendor, String product, |
+
| 509 | |
+ Confidence currentConfidence) throws UnsupportedEncodingException { |
+
| 510 | 3 | final Set<VulnerableSoftware> cpes = cve.getCPEs(vendor, product); |
+
| 511 | 3 | DependencyVersion bestGuess = new DependencyVersion("-"); |
+
| 512 | 3 | Confidence bestGuessConf = null; |
+
| 513 | 3 | boolean hasBroadMatch = false; |
+
| 514 | 3 | final List<IdentifierMatch> collected = new ArrayList<IdentifierMatch>(); |
+
| 515 | 15 | for (Confidence conf : Confidence.values()) { |
+
| 516 | |
+ |
+
| 517 | |
+ |
+
| 518 | |
+ |
+
| 519 | 12 | for (Evidence evidence : dependency.getVersionEvidence().iterator(conf)) { |
+
| 520 | 12 | final DependencyVersion evVer = DependencyVersionUtil.parseVersion(evidence.getValue()); |
+
| 521 | 12 | if (evVer == null) { |
+
| 522 | 0 | continue; |
+
| 523 | |
+ } |
+
| 524 | 12 | for (VulnerableSoftware vs : cpes) { |
+
| 525 | |
+ DependencyVersion dbVer; |
+
| 526 | 436 | if (vs.getUpdate() != null && !vs.getUpdate().isEmpty()) { |
+
| 527 | 128 | dbVer = DependencyVersionUtil.parseVersion(vs.getVersion() + '.' + vs.getUpdate()); |
+
| 528 | |
+ } else { |
+
| 529 | 308 | dbVer = DependencyVersionUtil.parseVersion(vs.getVersion()); |
+
| 530 | |
+ } |
+
| 531 | 436 | if (dbVer == null) { |
+
| 532 | 0 | hasBroadMatch = true; |
+
| 533 | 0 | final String url = String.format(NVD_SEARCH_URL, URLEncoder.encode(vs.getName(), "UTF-8")); |
+
| 534 | 0 | final IdentifierMatch match = new IdentifierMatch("cpe", vs.getName(), url, IdentifierConfidence.BROAD_MATCH, conf); |
+
| 535 | 0 | collected.add(match); |
+
| 536 | 0 | } else if (evVer.equals(dbVer)) { |
+
| 537 | 8 | final String url = String.format(NVD_SEARCH_URL, URLEncoder.encode(vs.getName(), "UTF-8")); |
+
| 538 | 8 | final IdentifierMatch match = new IdentifierMatch("cpe", vs.getName(), url, IdentifierConfidence.EXACT_MATCH, conf); |
+
| 539 | 8 | collected.add(match); |
+
| 540 | 8 | } else { |
+
| 541 | |
+ |
+
| 542 | 428 | if (evVer.getVersionParts().size() <= dbVer.getVersionParts().size() |
+
| 543 | |
+ && evVer.matchesAtLeastThreeLevels(dbVer)) { |
+
| 544 | 64 | if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) { |
+
| 545 | 2 | if (bestGuess.getVersionParts().size() < dbVer.getVersionParts().size()) { |
+
| 546 | 2 | bestGuess = dbVer; |
+
| 547 | 2 | bestGuessConf = conf; |
+
| 548 | |
+ } |
+
| 549 | |
+ } |
+
| 550 | |
+ } |
+
| 551 | |
+ } |
+
| 552 | 436 | } |
+
| 553 | 12 | if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) { |
+
| 554 | 1 | if (bestGuess.getVersionParts().size() < evVer.getVersionParts().size()) { |
+
| 555 | 1 | bestGuess = evVer; |
+
| 556 | 1 | bestGuessConf = conf; |
+
| 557 | |
+ } |
+
| 558 | |
+ } |
+
| 559 | 12 | } |
+
| 560 | |
+ } |
+
| 561 | 3 | final String cpeName = String.format("cpe:/a:%s:%s:%s", vendor, product, bestGuess.toString()); |
+
| 562 | 3 | String url = null; |
+
| 563 | 3 | if (hasBroadMatch) { |
+
| 564 | 0 | final String cpeUrlName = String.format("cpe:/a:%s:%s", vendor, product); |
+
| 565 | 0 | url = String.format(NVD_SEARCH_URL, URLEncoder.encode(cpeUrlName, "UTF-8")); |
+
| 566 | |
+ } |
+
| 567 | 3 | if (bestGuessConf == null) { |
+
| 568 | 0 | bestGuessConf = Confidence.LOW; |
+
| 569 | |
+ } |
+
| 570 | 3 | final IdentifierMatch match = new IdentifierMatch("cpe", cpeName, url, IdentifierConfidence.BEST_GUESS, bestGuessConf); |
+
| 571 | 3 | collected.add(match); |
+
| 572 | |
+ |
+
| 573 | 3 | Collections.sort(collected); |
+
| 574 | 3 | final IdentifierConfidence bestIdentifierQuality = collected.get(0).getConfidence(); |
+
| 575 | 3 | final Confidence bestEvidenceQuality = collected.get(0).getEvidenceConfidence(); |
+
| 576 | 3 | boolean identifierAdded = false; |
+
| 577 | 3 | for (IdentifierMatch m : collected) { |
+
| 578 | 11 | if (bestIdentifierQuality.equals(m.getConfidence()) |
+
| 579 | |
+ && bestEvidenceQuality.equals(m.getEvidenceConfidence())) { |
+
| 580 | 3 | final Identifier i = m.getIdentifier(); |
+
| 581 | 3 | if (bestIdentifierQuality == IdentifierConfidence.BEST_GUESS) { |
+
| 582 | 1 | i.setConfidence(Confidence.LOW); |
| 583 | |
+ } else { |
+
| 584 | 2 | i.setConfidence(bestEvidenceQuality); |
+
| 585 | |
} |
-
| 584 | 3 | dependency.addIdentifier(i); |
-
| 585 | 3 | identifierAdded = true; |
-
| 586 | |
+
| 586 | 3 | dependency.addIdentifier(i); |
+
| 587 | 3 | identifierAdded = true; |
+
| 588 | |
} |
-
| 587 | 11 | } |
-
| 588 | 3 | return identifierAdded; |
-
| 589 | |
- } |
-
| 590 | |
- |
+
| 589 | 11 | } |
+
| 590 | 3 | return identifierAdded; |
| 591 | |
- |
+
} |
| 592 | |
- |
+
|
| 593 | |
- |
-
| 594 | 4 | private enum IdentifierConfidence { |
-
| 595 | |
- |
-
| 596 | |
- |
-
| 597 | |
- |
-
| 598 | |
- |
-
| 599 | 1 | EXACT_MATCH, |
-
| 600 | |
- |
-
| 601 | |
- |
-
| 602 | |
- |
-
| 603 | 1 | BEST_GUESS, |
-
| 604 | |
- |
-
| 605 | |
- |
-
| 606 | |
- |
-
| 607 | |
- |
-
| 608 | 1 | BROAD_MATCH |
-
| 609 | |
- } |
-
| 610 | |
- |
-
| 611 | |
|
-
| 612 | |
- |
-
| 613 | |
+
| 594 | |
+ |
+
| 595 | |
|
-
| 614 | 8 | private static class IdentifierMatch implements Comparable<IdentifierMatch> { |
-
| 615 | |
+
| 596 | 4 | private enum IdentifierConfidence { |
+
| 597 | |
|
-
| 616 | |
+
| 598 | |
|
-
| 617 | |
- |
-
| 618 | |
- |
-
| 619 | |
- |
-
| 620 | |
- |
-
| 621 | |
- |
-
| 622 | |
- |
-
| 623 | |
- |
-
| 624 | |
+
| 599 | |
+ |
+
| 600 | |
|
-
| 625 | 11 | IdentifierMatch(String type, String value, String url, IdentifierConfidence identifierConfidence, Confidence evidenceConfidence) { |
-
| 626 | 11 | this.identifier = new Identifier(type, value, url); |
-
| 627 | 11 | this.confidence = identifierConfidence; |
-
| 628 | 11 | this.evidenceConfidence = evidenceConfidence; |
-
| 629 | 11 | } |
-
| 630 | |
- |
-
| 631 | |
+
| 601 | 1 | EXACT_MATCH, |
+
| 602 | |
|
-
| 632 | |
- |
-
| 633 | |
+
| 603 | |
+ |
+
| 604 | |
|
-
| 634 | |
- private Confidence evidenceConfidence; |
-
| 635 | |
- |
-
| 636 | |
+
| 605 | 1 | BEST_GUESS, |
+
| 606 | |
|
-
| 637 | |
- |
-
| 638 | |
- |
-
| 639 | |
- |
-
| 640 | |
+
| 607 | |
+ |
+
| 608 | |
+ |
+
| 609 | |
|
-
| 641 | |
- public Confidence getEvidenceConfidence() { |
-
| 642 | 12 | return evidenceConfidence; |
-
| 643 | |
- } |
-
| 644 | |
- |
-
| 645 | |
- |
-
| 646 | |
- |
-
| 647 | |
- |
-
| 648 | |
- |
-
| 649 | |
- |
-
| 650 | |
- public void setEvidenceConfidence(Confidence evidenceConfidence) { |
-
| 651 | 0 | this.evidenceConfidence = evidenceConfidence; |
-
| 652 | 0 | } |
-
| 653 | |
- |
-
| 654 | |
- |
-
| 655 | |
- |
-
| 656 | |
- private IdentifierConfidence confidence; |
-
| 657 | |
- |
-
| 658 | |
- |
-
| 659 | |
- |
-
| 660 | |
- |
-
| 661 | |
- |
-
| 662 | |
- |
-
| 663 | |
- public IdentifierConfidence getConfidence() { |
-
| 664 | 14 | return confidence; |
-
| 665 | |
- } |
-
| 666 | |
- |
-
| 667 | |
- |
-
| 668 | |
- |
-
| 669 | |
- |
-
| 670 | |
- |
-
| 671 | |
- |
-
| 672 | |
- public void setConfidence(IdentifierConfidence confidence) { |
-
| 673 | 0 | this.confidence = confidence; |
-
| 674 | 0 | } |
-
| 675 | |
- |
-
| 676 | |
- |
-
| 677 | |
- |
-
| 678 | |
- private Identifier identifier; |
-
| 679 | |
- |
-
| 680 | |
- |
-
| 681 | |
- |
-
| 682 | |
- |
-
| 683 | |
- |
-
| 684 | |
- |
-
| 685 | |
- public Identifier getIdentifier() { |
-
| 686 | 3 | return identifier; |
-
| 687 | |
- } |
-
| 688 | |
- |
-
| 689 | |
- |
-
| 690 | |
- |
-
| 691 | |
- |
-
| 692 | |
- |
-
| 693 | |
- |
-
| 694 | |
- public void setIdentifier(Identifier identifier) { |
-
| 695 | 0 | this.identifier = identifier; |
-
| 696 | 0 | } |
-
| 697 | |
- |
-
| 698 | |
- |
-
| 699 | |
- |
-
| 700 | |
- |
-
| 701 | |
- |
-
| 702 | |
- |
-
| 703 | |
- |
-
| 704 | |
- |
-
| 705 | |
- @Override |
-
| 706 | |
- public String toString() { |
-
| 707 | 0 | return "IdentifierMatch{" + "evidenceConfidence=" + evidenceConfidence |
-
| 708 | |
- + ", confidence=" + confidence + ", identifier=" + identifier + '}'; |
-
| 709 | |
- } |
-
| 710 | |
- |
-
| 711 | |
- |
-
| 712 | |
- |
-
| 713 | |
- |
-
| 714 | |
- |
-
| 715 | |
- |
-
| 716 | |
- @Override |
-
| 717 | |
- public int hashCode() { |
-
| 718 | 0 | int hash = 5; |
-
| 719 | 0 | hash = 97 * hash + (this.evidenceConfidence != null ? this.evidenceConfidence.hashCode() : 0); |
-
| 720 | 0 | hash = 97 * hash + (this.confidence != null ? this.confidence.hashCode() : 0); |
-
| 721 | 0 | hash = 97 * hash + (this.identifier != null ? this.identifier.hashCode() : 0); |
-
| 722 | 0 | return hash; |
-
| 723 | |
- } |
-
| 724 | |
- |
-
| 725 | |
- |
-
| 726 | |
- |
-
| 727 | |
- |
-
| 728 | |
- |
-
| 729 | |
- |
-
| 730 | |
- |
-
| 731 | |
- @Override |
-
| 732 | |
- public boolean equals(Object obj) { |
-
| 733 | 0 | if (obj == null) { |
-
| 734 | 0 | return false; |
-
| 735 | |
- } |
-
| 736 | 0 | if (getClass() != obj.getClass()) { |
-
| 737 | 0 | return false; |
-
| 738 | |
- } |
-
| 739 | 0 | final IdentifierMatch other = (IdentifierMatch) obj; |
-
| 740 | 0 | if (this.evidenceConfidence != other.evidenceConfidence) { |
-
| 741 | 0 | return false; |
-
| 742 | |
- } |
-
| 743 | 0 | if (this.confidence != other.confidence) { |
-
| 744 | 0 | return false; |
-
| 745 | |
- } |
-
| 746 | 0 | if (this.identifier != other.identifier && (this.identifier == null || !this.identifier.equals(other.identifier))) { |
-
| 747 | 0 | return false; |
-
| 748 | |
- } |
-
| 749 | 0 | return true; |
-
| 750 | |
- } |
-
| 751 | |
- |
-
| 752 | |
- |
-
| 753 | |
- |
-
| 754 | |
- |
-
| 755 | |
- |
-
| 756 | |
- |
-
| 757 | |
- |
-
| 758 | |
- |
-
| 759 | |
- @Override |
-
| 760 | |
- public int compareTo(IdentifierMatch o) { |
-
| 761 | 8 | int conf = this.confidence.compareTo(o.confidence); |
-
| 762 | 8 | if (conf == 0) { |
-
| 763 | 6 | conf = this.evidenceConfidence.compareTo(o.evidenceConfidence); |
-
| 764 | 6 | if (conf == 0) { |
-
| 765 | 2 | conf = identifier.compareTo(o.identifier); |
-
| 766 | |
- } |
-
| 767 | |
- } |
-
| 768 | 8 | return conf; |
-
| 769 | |
- } |
-
| 770 | |
+
| 610 | 1 | BROAD_MATCH |
+
| 611 | |
} |
+
| 612 | |
+ |
+
| 613 | |
+ |
+
| 614 | |
+ |
+
| 615 | |
+ |
+
| 616 | 8 | private static class IdentifierMatch implements Comparable<IdentifierMatch> { |
+
| 617 | |
+ |
+
| 618 | |
+ |
+
| 619 | |
+ |
+
| 620 | |
+ |
+
| 621 | |
+ |
+
| 622 | |
+ |
+
| 623 | |
+ |
+
| 624 | |
+ |
+
| 625 | |
+ |
+
| 626 | |
+ |
+
| 627 | 11 | IdentifierMatch(String type, String value, String url, IdentifierConfidence identifierConfidence, Confidence evidenceConfidence) { |
+
| 628 | 11 | this.identifier = new Identifier(type, value, url); |
+
| 629 | 11 | this.confidence = identifierConfidence; |
+
| 630 | 11 | this.evidenceConfidence = evidenceConfidence; |
+
| 631 | 11 | } |
+
| 632 | |
+ |
+
| 633 | |
+ |
+
| 634 | |
+ |
+
| 635 | |
+ |
+
| 636 | |
+ private Confidence evidenceConfidence; |
+
| 637 | |
+ |
+
| 638 | |
+ |
+
| 639 | |
+ |
+
| 640 | |
+ |
+
| 641 | |
+ |
+
| 642 | |
+ |
+
| 643 | |
+ public Confidence getEvidenceConfidence() { |
+
| 644 | 12 | return evidenceConfidence; |
+
| 645 | |
+ } |
+
| 646 | |
+ |
+
| 647 | |
+ |
+
| 648 | |
+ |
+
| 649 | |
+ |
+
| 650 | |
+ |
+
| 651 | |
+ |
+
| 652 | |
+ public void setEvidenceConfidence(Confidence evidenceConfidence) { |
+
| 653 | 0 | this.evidenceConfidence = evidenceConfidence; |
+
| 654 | 0 | } |
+
| 655 | |
+ |
+
| 656 | |
+ |
+
| 657 | |
+ |
+
| 658 | |
+ private IdentifierConfidence confidence; |
+
| 659 | |
+ |
+
| 660 | |
+ |
+
| 661 | |
+ |
+
| 662 | |
+ |
+
| 663 | |
+ |
+
| 664 | |
+ |
+
| 665 | |
+ public IdentifierConfidence getConfidence() { |
+
| 666 | 14 | return confidence; |
+
| 667 | |
+ } |
+
| 668 | |
+ |
+
| 669 | |
+ |
+
| 670 | |
+ |
+
| 671 | |
+ |
+
| 672 | |
+ |
+
| 673 | |
+ |
+
| 674 | |
+ public void setConfidence(IdentifierConfidence confidence) { |
+
| 675 | 0 | this.confidence = confidence; |
+
| 676 | 0 | } |
+
| 677 | |
+ |
+
| 678 | |
+ |
+
| 679 | |
+ |
+
| 680 | |
+ private Identifier identifier; |
+
| 681 | |
+ |
+
| 682 | |
+ |
+
| 683 | |
+ |
+
| 684 | |
+ |
+
| 685 | |
+ |
+
| 686 | |
+ |
+
| 687 | |
+ public Identifier getIdentifier() { |
+
| 688 | 3 | return identifier; |
+
| 689 | |
+ } |
+
| 690 | |
+ |
+
| 691 | |
+ |
+
| 692 | |
+ |
+
| 693 | |
+ |
+
| 694 | |
+ |
+
| 695 | |
+ |
+
| 696 | |
+ public void setIdentifier(Identifier identifier) { |
+
| 697 | 0 | this.identifier = identifier; |
+
| 698 | 0 | } |
+
| 699 | |
+ |
+
| 700 | |
+ |
+
| 701 | |
+ |
+
| 702 | |
+ |
+
| 703 | |
+ |
+
| 704 | |
+ |
+
| 705 | |
+ |
+
| 706 | |
+ |
+
| 707 | |
+ @Override |
+
| 708 | |
+ public String toString() { |
+
| 709 | 0 | return "IdentifierMatch{" + "evidenceConfidence=" + evidenceConfidence |
+
| 710 | |
+ + ", confidence=" + confidence + ", identifier=" + identifier + '}'; |
+
| 711 | |
+ } |
+
| 712 | |
+ |
+
| 713 | |
+ |
+
| 714 | |
+ |
+
| 715 | |
+ |
+
| 716 | |
+ |
+
| 717 | |
+ |
+
| 718 | |
+ @Override |
+
| 719 | |
+ public int hashCode() { |
+
| 720 | 0 | int hash = 5; |
+
| 721 | 0 | hash = 97 * hash + (this.evidenceConfidence != null ? this.evidenceConfidence.hashCode() : 0); |
+
| 722 | 0 | hash = 97 * hash + (this.confidence != null ? this.confidence.hashCode() : 0); |
+
| 723 | 0 | hash = 97 * hash + (this.identifier != null ? this.identifier.hashCode() : 0); |
+
| 724 | 0 | return hash; |
+
| 725 | |
+ } |
+
| 726 | |
+ |
+
| 727 | |
+ |
+
| 728 | |
+ |
+
| 729 | |
+ |
+
| 730 | |
+ |
+
| 731 | |
+ |
+
| 732 | |
+ |
+
| 733 | |
+ @Override |
+
| 734 | |
+ public boolean equals(Object obj) { |
+
| 735 | 0 | if (obj == null) { |
+
| 736 | 0 | return false; |
+
| 737 | |
+ } |
+
| 738 | 0 | if (getClass() != obj.getClass()) { |
+
| 739 | 0 | return false; |
+
| 740 | |
+ } |
+
| 741 | 0 | final IdentifierMatch other = (IdentifierMatch) obj; |
+
| 742 | 0 | if (this.evidenceConfidence != other.evidenceConfidence) { |
+
| 743 | 0 | return false; |
+
| 744 | |
+ } |
+
| 745 | 0 | if (this.confidence != other.confidence) { |
+
| 746 | 0 | return false; |
+
| 747 | |
+ } |
+
| 748 | 0 | if (this.identifier != other.identifier && (this.identifier == null || !this.identifier.equals(other.identifier))) { |
+
| 749 | 0 | return false; |
+
| 750 | |
+ } |
+
| 751 | 0 | return true; |
+
| 752 | |
+ } |
+
| 753 | |
+ |
+
| 754 | |
+ |
+
| 755 | |
+ |
+
| 756 | |
+ |
+
| 757 | |
+ |
+
| 758 | |
+ |
+
| 759 | |
+ |
+
| 760 | |
+ |
+
| 761 | |
+ @Override |
+
| 762 | |
+ public int compareTo(IdentifierMatch o) { |
+
| 763 | 8 | int conf = this.confidence.compareTo(o.confidence); |
+
| 764 | 8 | if (conf == 0) { |
+
| 765 | 6 | conf = this.evidenceConfidence.compareTo(o.evidenceConfidence); |
+
| 766 | 6 | if (conf == 0) { |
+
| 767 | 2 | conf = identifier.compareTo(o.identifier); |
+
| 768 | |
+ } |
+
| 769 | |
+ } |
+
| 770 | 8 | return conf; |
| 771 | |
+ } |
+
| 772 | |
+ } |
+
| 773 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CentralAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CentralAnalyzer.html
index 2a18d26a8..04a685812 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CentralAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CentralAnalyzer.html
@@ -429,6 +429,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ComposerLockAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ComposerLockAnalyzer.html
index 9010e5a2d..2616db2e7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ComposerLockAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ComposerLockAnalyzer.html
@@ -306,6 +306,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CpeSuppressionAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CpeSuppressionAnalyzer.html
index d17468250..01e400640 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CpeSuppressionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CpeSuppressionAnalyzer.html
@@ -152,13 +152,13 @@
| 70 | |
|
| 71 | 2 | for (final SuppressionRule rule : getRules()) { |
-
| 72 | 48 | rule.process(dependency); |
-
| 73 | 48 | } |
+
| 72 | 60 | rule.process(dependency); |
+
| 73 | 60 | } |
| 74 | 2 | } |
| 75 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer.html
index 0eb9c79bf..ed44af829 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer.html
@@ -728,6 +728,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.html
index b401d242e..4260f5654 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.html
@@ -811,6 +811,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html
index 3a91fd306..5011cee45 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html
@@ -225,6 +225,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileTypeAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileTypeAnalyzer.html
index 33e5f01f8..33301ed6f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileTypeAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileTypeAnalyzer.html
@@ -85,6 +85,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html
index 728a6aae5..d4b01bdd7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html
@@ -322,6 +322,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JarAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JarAnalyzer.html
index 59e1c3954..38de1cfda 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JarAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JarAnalyzer.html
@@ -12,7 +12,7 @@
@@ -587,7 +587,7 @@
| 321 | |
} |
| 322 | 0 | } catch (AnalysisException ex) { |
-
| 323 | 0 | LOGGER.warn("An error occured while analyzing '{}'.", dependency.getActualFilePath()); |
+
| 323 | 0 | LOGGER.warn("An error occurred while analyzing '{}'.", dependency.getActualFilePath()); |
| 324 | 0 | LOGGER.trace("", ex); |
| 325 | 1 | } |
| 326 | 1 | } |
@@ -1333,558 +1333,555 @@
| 836 | |
|
| 837 | 0 | if (pos > 0) { |
-
| 838 | 0 | final StringBuilder sb = new StringBuilder(pos + 3); |
-
| 839 | 0 | sb.append(desc.substring(0, pos)); |
-
| 840 | 0 | sb.append("..."); |
-
| 841 | 0 | desc = sb.toString(); |
-
| 842 | |
+
| 838 | 0 | desc = desc.substring(0, pos) + "..."; |
+
| 839 | |
} |
-
| 843 | 0 | dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.LOW); |
-
| 844 | 0 | dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.LOW); |
-
| 845 | 0 | } else { |
-
| 846 | 9 | dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.MEDIUM); |
-
| 847 | 9 | dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.MEDIUM); |
+
| 840 | 0 | dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.LOW); |
+
| 841 | 0 | dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.LOW); |
+
| 842 | 0 | } else { |
+
| 843 | 9 | dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.MEDIUM); |
+
| 844 | 9 | dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.MEDIUM); |
+
| 845 | |
+ } |
+
| 846 | 9 | return desc; |
+
| 847 | |
+ } |
| 848 | |
- } |
-
| 849 | 9 | return desc; |
+
|
+
| 849 | |
+ |
| 850 | |
- } |
-
| 851 | |
- |
-
| 852 | |
- |
-
| 853 | |
|
-
| 854 | |
+
| 851 | |
|
-
| 855 | |
+
| 852 | |
|
-
| 856 | |
+
| 853 | |
|
-
| 857 | |
+
| 854 | |
|
-
| 858 | |
+
| 855 | |
private void addLicense(Dependency d, String license) { |
-
| 859 | 2 | if (d.getLicense() == null) { |
-
| 860 | 2 | d.setLicense(license); |
-
| 861 | 0 | } else if (!d.getLicense().contains(license)) { |
-
| 862 | 0 | d.setLicense(d.getLicense() + NEWLINE + license); |
+
| 856 | 2 | if (d.getLicense() == null) { |
+
| 857 | 2 | d.setLicense(license); |
+
| 858 | 0 | } else if (!d.getLicense().contains(license)) { |
+
| 859 | 0 | d.setLicense(d.getLicense() + NEWLINE + license); |
+
| 860 | |
+ } |
+
| 861 | 2 | } |
+
| 862 | |
+ |
| 863 | |
- } |
-
| 864 | 2 | } |
-
| 865 | |
- |
-
| 866 | |
|
-
| 867 | |
+
| 864 | |
|
+
| 865 | |
+ |
+
| 866 | 7 | private File tempFileLocation = null; |
+
| 867 | |
+ |
| 868 | |
- |
-
| 869 | 7 | private File tempFileLocation = null; |
-
| 870 | |
- |
-
| 871 | |
|
-
| 872 | |
+
| 869 | |
|
-
| 873 | |
+
| 870 | |
|
-
| 874 | |
+
| 871 | |
|
-
| 875 | |
+
| 872 | |
|
-
| 876 | |
+
| 873 | |
@Override |
-
| 877 | |
+
| 874 | |
public void initializeFileTypeAnalyzer() throws Exception { |
-
| 878 | 1 | final File baseDir = Settings.getTempDirectory(); |
-
| 879 | 1 | tempFileLocation = File.createTempFile("check", "tmp", baseDir); |
-
| 880 | 1 | if (!tempFileLocation.delete()) { |
-
| 881 | 0 | final String msg = String.format("Unable to delete temporary file '%s'.", tempFileLocation.getAbsolutePath()); |
-
| 882 | 0 | throw new AnalysisException(msg); |
-
| 883 | |
+
| 875 | 1 | final File baseDir = Settings.getTempDirectory(); |
+
| 876 | 1 | tempFileLocation = File.createTempFile("check", "tmp", baseDir); |
+
| 877 | 1 | if (!tempFileLocation.delete()) { |
+
| 878 | 0 | final String msg = String.format("Unable to delete temporary file '%s'.", tempFileLocation.getAbsolutePath()); |
+
| 879 | 0 | throw new AnalysisException(msg); |
+
| 880 | |
} |
-
| 884 | 1 | if (!tempFileLocation.mkdirs()) { |
-
| 885 | 0 | final String msg = String.format("Unable to create directory '%s'.", tempFileLocation.getAbsolutePath()); |
-
| 886 | 0 | throw new AnalysisException(msg); |
+
| 881 | 1 | if (!tempFileLocation.mkdirs()) { |
+
| 882 | 0 | final String msg = String.format("Unable to create directory '%s'.", tempFileLocation.getAbsolutePath()); |
+
| 883 | 0 | throw new AnalysisException(msg); |
+
| 884 | |
+ } |
+
| 885 | 1 | } |
+
| 886 | |
+ |
| 887 | |
- } |
-
| 888 | 1 | } |
-
| 889 | |
- |
-
| 890 | |
|
-
| 891 | |
+
| 888 | |
|
-
| 892 | |
+
| 889 | |
|
-
| 893 | |
+
| 890 | |
@Override |
-
| 894 | |
+
| 891 | |
public void close() { |
-
| 895 | 1 | if (tempFileLocation != null && tempFileLocation.exists()) { |
-
| 896 | 1 | LOGGER.debug("Attempting to delete temporary files"); |
-
| 897 | 1 | final boolean success = FileUtils.delete(tempFileLocation); |
-
| 898 | 1 | if (!success) { |
-
| 899 | 0 | LOGGER.warn("Failed to delete some temporary files, see the log for more details"); |
+
| 892 | 1 | if (tempFileLocation != null && tempFileLocation.exists()) { |
+
| 893 | 1 | LOGGER.debug("Attempting to delete temporary files"); |
+
| 894 | 1 | final boolean success = FileUtils.delete(tempFileLocation); |
+
| 895 | 1 | if (!success) { |
+
| 896 | 0 | LOGGER.warn("Failed to delete some temporary files, see the log for more details"); |
+
| 897 | |
+ } |
+
| 898 | |
+ } |
+
| 899 | 1 | } |
| 900 | |
- } |
+
|
| 901 | |
- } |
-
| 902 | 1 | } |
-
| 903 | |
- |
-
| 904 | |
|
-
| 905 | |
+
| 902 | |
|
-
| 906 | |
+
| 903 | |
|
-
| 907 | |
+
| 904 | |
|
-
| 908 | |
+
| 905 | |
|
-
| 909 | |
+
| 906 | |
|
-
| 910 | |
+
| 907 | |
|
-
| 911 | |
+
| 908 | |
private boolean isImportPackage(String key, String value) { |
-
| 912 | 14 | final Pattern packageRx = Pattern.compile("^([a-zA-Z0-9_#\\$\\*\\.]+\\s*[,;]\\s*)+([a-zA-Z0-9_#\\$\\*\\.]+\\s*)?$"); |
-
| 913 | 14 | final boolean matches = packageRx.matcher(value).matches(); |
-
| 914 | 14 | return matches && (key.contains("import") || key.contains("include") || value.length() > 10); |
+
| 909 | 14 | final Pattern packageRx = Pattern.compile("^([a-zA-Z0-9_#\\$\\*\\.]+\\s*[,;]\\s*)+([a-zA-Z0-9_#\\$\\*\\.]+\\s*)?$"); |
+
| 910 | 14 | final boolean matches = packageRx.matcher(value).matches(); |
+
| 911 | 14 | return matches && (key.contains("import") || key.contains("include") || value.length() > 10); |
+
| 912 | |
+ } |
+
| 913 | |
+ |
+
| 914 | |
+ |
| 915 | |
- } |
-
| 916 | |
- |
-
| 917 | |
- |
-
| 918 | |
|
-
| 919 | |
+
| 916 | |
|
-
| 920 | |
+
| 917 | |
|
-
| 921 | |
+
| 918 | |
|
-
| 922 | |
+
| 919 | |
|
-
| 923 | |
+
| 920 | |
|
-
| 924 | |
+
| 921 | |
private List<ClassNameInformation> collectClassNames(Dependency dependency) { |
-
| 925 | 5 | final List<ClassNameInformation> classNames = new ArrayList<ClassNameInformation>(); |
-
| 926 | 5 | JarFile jar = null; |
-
| 927 | |
+
| 922 | 5 | final List<ClassNameInformation> classNames = new ArrayList<ClassNameInformation>(); |
+
| 923 | 5 | JarFile jar = null; |
+
| 924 | |
try { |
-
| 928 | 5 | jar = new JarFile(dependency.getActualFilePath()); |
-
| 929 | 5 | final Enumeration<JarEntry> entries = jar.entries(); |
-
| 930 | 1848 | while (entries.hasMoreElements()) { |
-
| 931 | 1843 | final JarEntry entry = entries.nextElement(); |
-
| 932 | 1843 | final String name = entry.getName().toLowerCase(); |
-
| 933 | |
+
| 925 | 5 | jar = new JarFile(dependency.getActualFilePath()); |
+
| 926 | 5 | final Enumeration<JarEntry> entries = jar.entries(); |
+
| 927 | 1848 | while (entries.hasMoreElements()) { |
+
| 928 | 1843 | final JarEntry entry = entries.nextElement(); |
+
| 929 | 1843 | final String name = entry.getName().toLowerCase(); |
+
| 930 | |
|
-
| 934 | 1843 | if (name.endsWith(".class") && !name.matches("^javax?\\..*$")) { |
-
| 935 | 1535 | final ClassNameInformation className = new ClassNameInformation(name.substring(0, name.length() - 6)); |
-
| 936 | 1535 | classNames.add(className); |
-
| 937 | |
+
| 931 | 1843 | if (name.endsWith(".class") && !name.matches("^javax?\\..*$")) { |
+
| 932 | 1535 | final ClassNameInformation className = new ClassNameInformation(name.substring(0, name.length() - 6)); |
+
| 933 | 1535 | classNames.add(className); |
+
| 934 | |
} |
-
| 938 | 1843 | } |
-
| 939 | 0 | } catch (IOException ex) { |
-
| 940 | 0 | LOGGER.warn("Unable to open jar file '{}'.", dependency.getFileName()); |
-
| 941 | 0 | LOGGER.debug("", ex); |
-
| 942 | |
+
| 935 | 1843 | } |
+
| 936 | 0 | } catch (IOException ex) { |
+
| 937 | 0 | LOGGER.warn("Unable to open jar file '{}'.", dependency.getFileName()); |
+
| 938 | 0 | LOGGER.debug("", ex); |
+
| 939 | |
} finally { |
-
| 943 | 5 | if (jar != null) { |
-
| 944 | |
+
| 940 | 5 | if (jar != null) { |
+
| 941 | |
try { |
-
| 945 | 5 | jar.close(); |
-
| 946 | 0 | } catch (IOException ex) { |
-
| 947 | 0 | LOGGER.trace("", ex); |
-
| 948 | 5 | } |
+
| 942 | 5 | jar.close(); |
+
| 943 | 0 | } catch (IOException ex) { |
+
| 944 | 0 | LOGGER.trace("", ex); |
+
| 945 | 5 | } |
+
| 946 | |
+ } |
+
| 947 | |
+ } |
+
| 948 | 5 | return classNames; |
| 949 | |
- } |
-
| 950 | |
- } |
-
| 951 | 5 | return classNames; |
-
| 952 | |
} |
-
| 953 | |
+
| 950 | |
|
-
| 954 | |
+
| 951 | |
|
-
| 955 | |
+
| 952 | |
|
-
| 956 | |
+
| 953 | |
|
-
| 957 | |
+
| 954 | |
|
-
| 958 | |
+
| 955 | |
|
-
| 959 | |
+
| 956 | |
|
-
| 960 | |
+
| 957 | |
|
-
| 961 | |
+
| 958 | |
|
-
| 962 | |
+
| 959 | |
private void analyzeFullyQualifiedClassNames(List<ClassNameInformation> classNames, |
-
| 963 | |
+
| 960 | |
Map<String, Integer> vendor, Map<String, Integer> product) { |
-
| 964 | 5 | for (ClassNameInformation entry : classNames) { |
-
| 965 | 1535 | final List<String> list = entry.getPackageStructure(); |
-
| 966 | 1535 | addEntry(vendor, list.get(0)); |
+
| 961 | 5 | for (ClassNameInformation entry : classNames) { |
+
| 962 | 1535 | final List<String> list = entry.getPackageStructure(); |
+
| 963 | 1535 | addEntry(vendor, list.get(0)); |
+
| 964 | |
+ |
+
| 965 | 1535 | if (list.size() == 2) { |
+
| 966 | 0 | addEntry(product, list.get(1)); |
| 967 | |
- |
-
| 968 | 1535 | if (list.size() == 2) { |
-
| 969 | 0 | addEntry(product, list.get(1)); |
-
| 970 | |
} |
-
| 971 | 1535 | if (list.size() == 3) { |
-
| 972 | 345 | addEntry(vendor, list.get(1)); |
-
| 973 | 345 | addEntry(product, list.get(1)); |
-
| 974 | 345 | addEntry(product, list.get(2)); |
-
| 975 | |
+
| 968 | 1535 | if (list.size() == 3) { |
+
| 969 | 345 | addEntry(vendor, list.get(1)); |
+
| 970 | 345 | addEntry(product, list.get(1)); |
+
| 971 | 345 | addEntry(product, list.get(2)); |
+
| 972 | |
} |
-
| 976 | 1535 | if (list.size() >= 4) { |
-
| 977 | 1190 | addEntry(vendor, list.get(1)); |
-
| 978 | 1190 | addEntry(vendor, list.get(2)); |
-
| 979 | 1190 | addEntry(product, list.get(1)); |
-
| 980 | 1190 | addEntry(product, list.get(2)); |
-
| 981 | 1190 | addEntry(product, list.get(3)); |
+
| 973 | 1535 | if (list.size() >= 4) { |
+
| 974 | 1190 | addEntry(vendor, list.get(1)); |
+
| 975 | 1190 | addEntry(vendor, list.get(2)); |
+
| 976 | 1190 | addEntry(product, list.get(1)); |
+
| 977 | 1190 | addEntry(product, list.get(2)); |
+
| 978 | 1190 | addEntry(product, list.get(3)); |
+
| 979 | |
+ } |
+
| 980 | 1535 | } |
+
| 981 | 5 | } |
| 982 | |
- } |
-
| 983 | 1535 | } |
-
| 984 | 5 | } |
-
| 985 | |
|
-
| 986 | |
+
| 983 | |
|
-
| 987 | |
+
| 984 | |
|
-
| 988 | |
+
| 985 | |
|
-
| 989 | |
+
| 986 | |
|
-
| 990 | |
+
| 987 | |
|
-
| 991 | |
+
| 988 | |
|
-
| 992 | |
+
| 989 | |
|
-
| 993 | |
+
| 990 | |
private void addEntry(Map<String, Integer> collection, String key) { |
-
| 994 | 8520 | if (collection.containsKey(key)) { |
-
| 995 | 7487 | collection.put(key, collection.get(key) + 1); |
-
| 996 | |
+
| 991 | 8520 | if (collection.containsKey(key)) { |
+
| 992 | 7487 | collection.put(key, collection.get(key) + 1); |
+
| 993 | |
} else { |
-
| 997 | 1033 | collection.put(key, 1); |
+
| 994 | 1033 | collection.put(key, 1); |
+
| 995 | |
+ } |
+
| 996 | 8520 | } |
+
| 997 | |
+ |
| 998 | |
- } |
-
| 999 | 8520 | } |
-
| 1000 | |
- |
-
| 1001 | |
|
-
| 1002 | |
+
| 999 | |
|
-
| 1003 | |
+
| 1000 | |
|
-
| 1004 | |
+
| 1001 | |
|
-
| 1005 | |
+
| 1002 | |
|
-
| 1006 | |
+
| 1003 | |
|
-
| 1007 | |
+
| 1004 | |
|
-
| 1008 | |
+
| 1005 | |
|
-
| 1009 | |
+
| 1006 | |
|
-
| 1010 | |
+
| 1007 | |
private static void addMatchingValues(List<ClassNameInformation> classes, String value, EvidenceCollection evidence) { |
-
| 1011 | 38 | if (value == null || value.isEmpty() || classes == null || classes.isEmpty()) { |
-
| 1012 | 0 | return; |
-
| 1013 | |
+
| 1008 | 38 | if (value == null || value.isEmpty() || classes == null || classes.isEmpty()) { |
+
| 1009 | 0 | return; |
+
| 1010 | |
} |
-
| 1014 | 38 | final String text = value.toLowerCase(); |
-
| 1015 | 38 | for (ClassNameInformation cni : classes) { |
-
| 1016 | 15262 | for (String key : cni.getPackageStructure()) { |
-
| 1017 | 59006 | if (text.contains(key)) { |
-
| 1018 | 14439 | evidence.addEvidence("jar", "package name", key, Confidence.HIGHEST); |
-
| 1019 | |
+
| 1011 | 38 | final String text = value.toLowerCase(); |
+
| 1012 | 38 | for (ClassNameInformation cni : classes) { |
+
| 1013 | 15262 | for (String key : cni.getPackageStructure()) { |
+
| 1014 | 59006 | if (text.contains(key)) { |
+
| 1015 | 14439 | evidence.addEvidence("jar", "package name", key, Confidence.HIGHEST); |
+
| 1016 | |
} |
-
| 1020 | 59006 | } |
-
| 1021 | 15262 | } |
-
| 1022 | 38 | } |
-
| 1023 | |
+
| 1017 | 59006 | } |
+
| 1018 | 15262 | } |
+
| 1019 | 38 | } |
+
| 1020 | |
|
-
| 1024 | |
+
| 1021 | |
|
-
| 1025 | |
+
| 1022 | |
|
-
| 1026 | |
+
| 1023 | |
|
-
| 1027 | |
+
| 1024 | |
|
-
| 1028 | |
+
| 1025 | |
|
-
| 1029 | |
+
| 1026 | |
|
-
| 1030 | |
+
| 1027 | |
|
-
| 1031 | |
+
| 1028 | |
private boolean isPackage(String key, String value) { |
+
| 1029 | |
+ |
+
| 1030 | 14 | return !key.matches(".*(version|title|vendor|name|license|description).*") |
+
| 1031 | |
+ && value.matches("^([a-zA-Z_][a-zA-Z0-9_\\$]*(\\.[a-zA-Z_][a-zA-Z0-9_\\$]*)*)?$"); |
| 1032 | |
|
-
| 1033 | 14 | return !key.matches(".*(version|title|vendor|name|license|description).*") |
-
| 1034 | |
- && value.matches("^([a-zA-Z_][a-zA-Z0-9_\\$]*(\\.[a-zA-Z_][a-zA-Z0-9_\\$]*)*)?$"); |
-
| 1035 | |
- |
-
| 1036 | |
+
| 1033 | |
} |
-
| 1037 | |
+
| 1034 | |
|
-
| 1038 | |
+
| 1035 | |
|
-
| 1039 | |
+
| 1036 | |
|
-
| 1040 | |
+
| 1037 | |
|
-
| 1041 | |
+
| 1038 | |
|
-
| 1042 | |
+
| 1039 | |
|
-
| 1043 | |
+
| 1040 | |
|
-
| 1044 | |
+
| 1041 | |
public static void extractLicense(Model pom, Dependency dependency) { |
-
| 1045 | |
+
| 1042 | |
|
-
| 1046 | 1 | if (pom.getLicenses() != null) { |
-
| 1047 | 1 | String license = null; |
-
| 1048 | 1 | for (License lic : pom.getLicenses()) { |
-
| 1049 | 0 | String tmp = null; |
-
| 1050 | 0 | if (lic.getName() != null) { |
-
| 1051 | 0 | tmp = lic.getName(); |
-
| 1052 | |
+
| 1043 | 1 | if (pom.getLicenses() != null) { |
+
| 1044 | 1 | String license = null; |
+
| 1045 | 1 | for (License lic : pom.getLicenses()) { |
+
| 1046 | 0 | String tmp = null; |
+
| 1047 | 0 | if (lic.getName() != null) { |
+
| 1048 | 0 | tmp = lic.getName(); |
+
| 1049 | |
} |
-
| 1053 | 0 | if (lic.getUrl() != null) { |
-
| 1054 | 0 | if (tmp == null) { |
-
| 1055 | 0 | tmp = lic.getUrl(); |
-
| 1056 | |
+
| 1050 | 0 | if (lic.getUrl() != null) { |
+
| 1051 | 0 | if (tmp == null) { |
+
| 1052 | 0 | tmp = lic.getUrl(); |
+
| 1053 | |
} else { |
-
| 1057 | 0 | tmp += ": " + lic.getUrl(); |
-
| 1058 | |
+
| 1054 | 0 | tmp += ": " + lic.getUrl(); |
+
| 1055 | |
} |
+
| 1056 | |
+ } |
+
| 1057 | 0 | if (tmp == null) { |
+
| 1058 | 0 | continue; |
| 1059 | |
} |
-
| 1060 | 0 | if (tmp == null) { |
-
| 1061 | 0 | continue; |
+
| 1060 | 0 | if (HTML_DETECTION_PATTERN.matcher(tmp).find()) { |
+
| 1061 | 0 | tmp = Jsoup.parse(tmp).text(); |
| 1062 | |
} |
-
| 1063 | 0 | if (HTML_DETECTION_PATTERN.matcher(tmp).find()) { |
-
| 1064 | 0 | tmp = Jsoup.parse(tmp).text(); |
+
| 1063 | 0 | if (license == null) { |
+
| 1064 | 0 | license = tmp; |
| 1065 | |
- } |
-
| 1066 | 0 | if (license == null) { |
-
| 1067 | 0 | license = tmp; |
-
| 1068 | |
} else { |
-
| 1069 | 0 | license += "\n" + tmp; |
-
| 1070 | |
+
| 1066 | 0 | license += "\n" + tmp; |
+
| 1067 | |
} |
-
| 1071 | 0 | } |
-
| 1072 | 1 | if (license != null) { |
-
| 1073 | 0 | dependency.setLicense(license); |
-
| 1074 | |
+
| 1068 | 0 | } |
+
| 1069 | 1 | if (license != null) { |
+
| 1070 | 0 | dependency.setLicense(license); |
+
| 1071 | |
|
-
| 1075 | |
+
| 1072 | |
} |
-
| 1076 | |
+
| 1073 | |
} |
-
| 1077 | 1 | } |
-
| 1078 | |
+
| 1074 | 1 | } |
+
| 1075 | |
|
-
| 1079 | |
+
| 1076 | |
|
-
| 1080 | |
+
| 1077 | |
|
-
| 1081 | |
+
| 1078 | |
|
-
| 1082 | |
+
| 1079 | |
protected static class ClassNameInformation { |
-
| 1083 | |
+
| 1080 | |
|
-
| 1084 | |
+
| 1081 | |
|
-
| 1085 | |
+
| 1082 | |
|
-
| 1086 | |
+
| 1083 | |
|
-
| 1087 | |
+
| 1084 | |
|
-
| 1088 | |
+
| 1085 | |
|
-
| 1089 | |
+
| 1086 | |
|
-
| 1090 | |
+
| 1087 | |
|
-
| 1091 | |
+
| 1088 | |
|
-
| 1092 | |
+
| 1089 | |
|
-
| 1093 | |
+
| 1090 | |
|
-
| 1094 | |
+
| 1091 | |
|
-
| 1095 | |
+
| 1092 | |
|
-
| 1096 | |
+
| 1093 | |
|
-
| 1097 | |
+
| 1094 | |
|
-
| 1098 | |
+
| 1095 | |
|
-
| 1099 | |
+
| 1096 | |
|
-
| 1100 | |
+
| 1097 | |
|
-
| 1101 | |
+
| 1098 | |
|
-
| 1102 | |
+
| 1099 | |
|
-
| 1103 | |
+
| 1100 | |
|
-
| 1104 | 1535 | ClassNameInformation(String className) { |
-
| 1105 | 1535 | name = className; |
-
| 1106 | 1535 | if (name.contains("/")) { |
-
| 1107 | 1535 | final String[] tmp = className.toLowerCase().split("/"); |
-
| 1108 | 1535 | int start = 0; |
-
| 1109 | 1535 | int end = 3; |
-
| 1110 | 1535 | if ("com".equals(tmp[0]) || "org".equals(tmp[0])) { |
-
| 1111 | 1535 | start = 1; |
-
| 1112 | 1535 | end = 4; |
+
| 1101 | 1535 | ClassNameInformation(String className) { |
+
| 1102 | 1535 | name = className; |
+
| 1103 | 1535 | if (name.contains("/")) { |
+
| 1104 | 1535 | final String[] tmp = className.toLowerCase().split("/"); |
+
| 1105 | 1535 | int start = 0; |
+
| 1106 | 1535 | int end = 3; |
+
| 1107 | 1535 | if ("com".equals(tmp[0]) || "org".equals(tmp[0])) { |
+
| 1108 | 1535 | start = 1; |
+
| 1109 | 1535 | end = 4; |
+
| 1110 | |
+ } |
+
| 1111 | 1535 | if (tmp.length <= end) { |
+
| 1112 | 345 | end = tmp.length - 1; |
| 1113 | |
} |
-
| 1114 | 1535 | if (tmp.length <= end) { |
-
| 1115 | 345 | end = tmp.length - 1; |
+
| 1114 | 7330 | for (int i = start; i <= end; i++) { |
+
| 1115 | 5795 | packageStructure.add(tmp[i]); |
| 1116 | |
} |
-
| 1117 | 7330 | for (int i = start; i <= end; i++) { |
-
| 1118 | 5795 | packageStructure.add(tmp[i]); |
+
| 1117 | 1535 | } else { |
+
| 1118 | 0 | packageStructure.add(name); |
| 1119 | |
- } |
-
| 1120 | 1535 | } else { |
-
| 1121 | 0 | packageStructure.add(name); |
-
| 1122 | |
} |
-
| 1123 | 1535 | } |
-
| 1124 | |
+
| 1120 | 1535 | } |
+
| 1121 | |
|
-
| 1125 | |
+
| 1122 | |
|
-
| 1126 | |
+
| 1123 | |
|
-
| 1127 | |
+
| 1124 | |
private String name; |
-
| 1128 | |
+
| 1125 | |
|
-
| 1129 | |
+
| 1126 | |
|
-
| 1130 | |
+
| 1127 | |
|
-
| 1131 | |
+
| 1128 | |
|
-
| 1132 | |
+
| 1129 | |
|
-
| 1133 | |
+
| 1130 | |
|
-
| 1134 | |
+
| 1131 | |
public String getName() { |
-
| 1135 | 0 | return name; |
+
| 1132 | 0 | return name; |
+
| 1133 | |
+ } |
+
| 1134 | |
+ |
+
| 1135 | |
+ |
| 1136 | |
- } |
-
| 1137 | |
- |
-
| 1138 | |
- |
-
| 1139 | |
|
-
| 1140 | |
+
| 1137 | |
|
-
| 1141 | |
+
| 1138 | |
|
-
| 1142 | |
+
| 1139 | |
|
-
| 1143 | |
+
| 1140 | |
public void setName(String name) { |
-
| 1144 | 0 | this.name = name; |
-
| 1145 | 0 | } |
-
| 1146 | |
+
| 1141 | 0 | this.name = name; |
+
| 1142 | 0 | } |
+
| 1143 | |
|
-
| 1147 | |
+
| 1144 | |
|
+
| 1145 | |
+ |
+
| 1146 | 1535 | private final ArrayList<String> packageStructure = new ArrayList<String>(); |
+
| 1147 | |
+ |
| 1148 | |
- |
-
| 1149 | 1535 | private final ArrayList<String> packageStructure = new ArrayList<String>(); |
-
| 1150 | |
- |
-
| 1151 | |
|
-
| 1152 | |
+
| 1149 | |
|
-
| 1153 | |
+
| 1150 | |
|
-
| 1154 | |
+
| 1151 | |
|
-
| 1155 | |
+
| 1152 | |
|
-
| 1156 | |
+
| 1153 | |
public ArrayList<String> getPackageStructure() { |
-
| 1157 | 16797 | return packageStructure; |
-
| 1158 | |
+
| 1154 | 16797 | return packageStructure; |
+
| 1155 | |
} |
-
| 1159 | |
+
| 1156 | |
} |
-
| 1160 | |
+
| 1157 | |
|
-
| 1161 | |
+
| 1158 | |
|
-
| 1162 | |
+
| 1159 | |
|
-
| 1163 | |
+
| 1160 | |
|
-
| 1164 | |
+
| 1161 | |
|
-
| 1165 | |
+
| 1162 | |
|
-
| 1166 | |
+
| 1163 | |
|
-
| 1167 | |
+
| 1164 | |
private File getNextTempDirectory() throws AnalysisException { |
-
| 1168 | 0 | dirCount += 1; |
-
| 1169 | 0 | final File directory = new File(tempFileLocation, String.valueOf(dirCount)); |
-
| 1170 | |
+
| 1165 | 0 | dirCount += 1; |
+
| 1166 | 0 | final File directory = new File(tempFileLocation, String.valueOf(dirCount)); |
+
| 1167 | |
|
-
| 1171 | 0 | if (directory.exists()) { |
-
| 1172 | 0 | return getNextTempDirectory(); |
-
| 1173 | |
+
| 1168 | 0 | if (directory.exists()) { |
+
| 1169 | 0 | return getNextTempDirectory(); |
+
| 1170 | |
} |
-
| 1174 | 0 | if (!directory.mkdirs()) { |
-
| 1175 | 0 | final String msg = String.format("Unable to create temp directory '%s'.", directory.getAbsolutePath()); |
-
| 1176 | 0 | throw new AnalysisException(msg); |
-
| 1177 | |
+
| 1171 | 0 | if (!directory.mkdirs()) { |
+
| 1172 | 0 | final String msg = String.format("Unable to create temp directory '%s'.", directory.getAbsolutePath()); |
+
| 1173 | 0 | throw new AnalysisException(msg); |
+
| 1174 | |
} |
-
| 1178 | 0 | return directory; |
-
| 1179 | |
+
| 1175 | 0 | return directory; |
+
| 1176 | |
} |
-
| 1180 | |
+
| 1177 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NexusAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NexusAnalyzer.html
index a2927addc..fce1f9070 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NexusAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NexusAnalyzer.html
@@ -472,6 +472,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NodePackageAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NodePackageAnalyzer.html
index b51ac9b3b..4a942b740 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NodePackageAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NodePackageAnalyzer.html
@@ -343,6 +343,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NuspecAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NuspecAnalyzer.html
index 9c855307a..0cf30f3fc 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NuspecAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NuspecAnalyzer.html
@@ -312,6 +312,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html
index 97779c529..35c320cbd 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html
@@ -292,6 +292,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.OpenSSLAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.OpenSSLAnalyzer.html
index a4b4cdeac..14f5f8e56 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.OpenSSLAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.OpenSSLAnalyzer.html
@@ -333,6 +333,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.PythonDistributionAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.PythonDistributionAnalyzer.html
index d654d58b7..9a901aa44 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.PythonDistributionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.PythonDistributionAnalyzer.html
@@ -675,6 +675,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.PythonPackageAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.PythonPackageAnalyzer.html
index 20a46b5d8..ea1be2bb7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.PythonPackageAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.PythonPackageAnalyzer.html
@@ -583,6 +583,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.RubyBundleAuditAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.RubyBundleAuditAnalyzer.html
index 4d781eff9..d12ac7027 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.RubyBundleAuditAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.RubyBundleAuditAnalyzer.html
@@ -12,7 +12,7 @@
@@ -120,9 +120,9 @@
| 52 | 1 | private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.PRE_INFORMATION_COLLECTION; |
| 53 | |
|
-
| 54 | 1 | private static final FileFilter FILTER = |
+
| 54 | 1 | private static final FileFilter FILTER |
| 55 | |
- FileFilterBuilder.newInstance().addFilenames("Gemfile.lock").build(); |
+
= FileFilterBuilder.newInstance().addFilenames("Gemfile.lock").build(); |
| 56 | |
public static final String NAME = "Name: "; |
| 57 | |
@@ -217,7 +217,7 @@
| 114 | |
} else { |
| 115 | 0 | final String line = reader.readLine(); |
-
| 116 | 0 | if (!line.contains("Errno::ENOENT")) { |
+
| 116 | 0 | if (line == null || !line.contains("Errno::ENOENT")) { |
| 117 | 0 | LOGGER.warn("Unexpected bundle-audit output. Disabling {}: {}", ANALYZER_NAME, line); |
| 118 | 0 | setEnabled(false); |
| 119 | 0 | throw new AnalysisException("Unexpected bundle-audit output."); |
@@ -236,9 +236,9 @@
| 127 | |
} |
| 128 | 0 | if (isEnabled()) { |
-
| 129 | 0 | LOGGER.info(ANALYZER_NAME + " is enabled. It is necessary to manually run \"bundle-audit update\" " + |
+
| 129 | 0 | LOGGER.info(ANALYZER_NAME + " is enabled. It is necessary to manually run \"bundle-audit update\" " |
| 130 | |
- "occasionally to keep its database up to date."); |
+
+ "occasionally to keep its database up to date."); |
| 131 | |
} |
| 132 | 0 | } |
@@ -304,9 +304,9 @@
| 164 | |
|
| 165 | |
- |
+
|
| 166 | |
- |
+
|
| 167 | |
|
| 168 | 7 | private boolean needToDisableGemspecAnalyzer = true; |
@@ -516,6 +516,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.RubyGemspecAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.RubyGemspecAnalyzer.html
index afd3d3ba3..69af20fb6 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.RubyGemspecAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.RubyGemspecAnalyzer.html
@@ -299,6 +299,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.VulnerabilitySuppressionAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.VulnerabilitySuppressionAnalyzer.html
index f27685d0f..22e742c74 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.VulnerabilitySuppressionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.VulnerabilitySuppressionAnalyzer.html
@@ -152,13 +152,13 @@
| 70 | |
|
| 71 | 2 | for (final SuppressionRule rule : getRules()) { |
-
| 72 | 48 | rule.process(dependency); |
-
| 73 | 48 | } |
+
| 72 | 60 | rule.process(dependency); |
+
| 73 | 60 | } |
| 74 | 2 | } |
| 75 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.AnalysisException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.AnalysisException.html
index 7944737c9..b2862bc20 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.AnalysisException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.AnalysisException.html
@@ -143,6 +143,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.ArchiveExtractionException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.ArchiveExtractionException.html
index c5e004b3d..5fcba32a9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.ArchiveExtractionException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.ArchiveExtractionException.html
@@ -143,6 +143,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.central.CentralSearch.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.central.CentralSearch.html
index 340e7fe46..09404f2b0 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.central.CentralSearch.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.central.CentralSearch.html
@@ -301,6 +301,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.composer.ComposerDependency.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.composer.ComposerDependency.html
index b9ef2d530..eb9f6bc87 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.composer.ComposerDependency.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.composer.ComposerDependency.html
@@ -217,6 +217,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.composer.ComposerException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.composer.ComposerException.html
index d3c416d05..29db8ca28 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.composer.ComposerException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.composer.ComposerException.html
@@ -127,6 +127,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.composer.ComposerLockParser.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.composer.ComposerLockParser.html
index 8ae1ab2b5..d12d5b095 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.composer.ComposerLockParser.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.composer.ComposerLockParser.html
@@ -228,6 +228,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeMemoryIndex.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeMemoryIndex.html
index e60274a3c..637d4179d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeMemoryIndex.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeMemoryIndex.html
@@ -404,10 +404,10 @@
|
| 222 | 1 | final Set<Pair<String, String>> data = cve.getVendorProductList(); |
| 223 | 1 | for (Pair<String, String> pair : data) { |
-
| 224 | 25470 | v.setStringValue(pair.getLeft()); |
-
| 225 | 25470 | p.setStringValue(pair.getRight()); |
-
| 226 | 25470 | indexWriter.addDocument(doc); |
-
| 227 | 25470 | } |
+
| 224 | 25579 | v.setStringValue(pair.getLeft()); |
+
| 225 | 25579 | p.setStringValue(pair.getRight()); |
+
| 226 | 25579 | indexWriter.addDocument(doc); |
+
| 227 | 25579 | } |
| 228 | 0 | } catch (DatabaseException ex) { |
| 229 | 0 | LOGGER.debug("", ex); |
| 230 | 0 | throw new IndexException("Error reading CPE data", ex); |
@@ -564,6 +564,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.Fields.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.Fields.html
index 0cddafe9a..d5988d04a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.Fields.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.Fields.html
@@ -107,6 +107,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexEntry.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexEntry.html
index 2b943c6d4..d1e929176 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexEntry.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexEntry.html
@@ -363,6 +363,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexException.html
index 320a90fe3..7cc2fbbef 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexException.html
@@ -143,6 +143,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweDB.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweDB.html
index 53af9731b..bd4e809a8 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweDB.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweDB.html
@@ -186,6 +186,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweHandler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweHandler.html
index 357133a81..56f1f36d7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweHandler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweHandler.html
@@ -121,6 +121,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AbstractTokenizingFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AbstractTokenizingFilter.html
index e37703b7c..748b994cb 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AbstractTokenizingFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AbstractTokenizingFilter.html
@@ -100,7 +100,7 @@
|
| 42 | |
protected CharTermAttribute getTermAtt() { |
-
| 43 | 26346 | return termAtt; |
+
| 43 | 26209 | return termAtt; |
| 44 | |
} |
| 45 | |
@@ -125,7 +125,7 @@
|
| 55 | |
protected LinkedList<String> getTokens() { |
-
| 56 | 26274 | return tokens; |
+
| 56 | 26197 | return tokens; |
| 57 | |
} |
| 58 | |
@@ -159,20 +159,20 @@
|
| 74 | |
protected boolean addTerm() { |
-
| 75 | 26245 | final boolean termAdded = !tokens.isEmpty(); |
-
| 76 | 26228 | if (termAdded) { |
-
| 77 | 17660 | final String term = tokens.pop(); |
-
| 78 | 17650 | clearAttributes(); |
-
| 79 | 17636 | termAtt.append(term); |
+
| 75 | 26146 | final boolean termAdded = !tokens.isEmpty(); |
+
| 76 | 26136 | if (termAdded) { |
+
| 77 | 17601 | final String term = tokens.pop(); |
+
| 78 | 17560 | clearAttributes(); |
+
| 79 | 17590 | termAtt.append(term); |
| 80 | |
} |
-
| 81 | 26205 | return termAdded; |
+
| 81 | 26152 | return termAdded; |
| 82 | |
} |
| 83 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AlphaNumericTokenizer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AlphaNumericTokenizer.html
index a58af1767..5ae166c8e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AlphaNumericTokenizer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AlphaNumericTokenizer.html
@@ -131,13 +131,13 @@
@Override |
| 59 | |
protected boolean isTokenChar(int c) { |
-
| 60 | 610584 | return Character.isLetter(c) || Character.isDigit(c); |
+
| 60 | 613745 | return Character.isLetter(c) || Character.isDigit(c); |
| 61 | |
} |
| 62 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.DependencySimilarity.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.DependencySimilarity.html
index 1d87c4196..840e0bc1a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.DependencySimilarity.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.DependencySimilarity.html
@@ -111,6 +111,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.FieldAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.FieldAnalyzer.html
index 3f598dc9f..8007b342b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.FieldAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.FieldAnalyzer.html
@@ -170,6 +170,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.LuceneUtils.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.LuceneUtils.html
index 95cc175a2..8ab4db69b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.LuceneUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.LuceneUtils.html
@@ -212,6 +212,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchFieldAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchFieldAnalyzer.html
index d37157f59..616ee357a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchFieldAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchFieldAnalyzer.html
@@ -196,6 +196,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.TokenPairConcatenatingFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.TokenPairConcatenatingFilter.html
index a82ae4cec..43641cd37 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.TokenPairConcatenatingFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.TokenPairConcatenatingFilter.html
@@ -306,6 +306,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.UrlTokenizingFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.UrlTokenizingFilter.html
index 574cb491e..08da06ddd 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.UrlTokenizingFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.UrlTokenizingFilter.html
@@ -134,11 +134,11 @@
@Override |
| 60 | |
public boolean incrementToken() throws IOException { |
-
| 61 | 26185 | final LinkedList<String> tokens = getTokens(); |
-
| 62 | 26252 | final CharTermAttribute termAtt = getTermAtt(); |
-
| 63 | 26283 | if (tokens.isEmpty() && input.incrementToken()) { |
-
| 64 | 17710 | final String text = new String(termAtt.buffer(), 0, termAtt.length()); |
-
| 65 | 17682 | if (UrlStringUtils.containsUrl(text)) { |
+
| 61 | 26105 | final LinkedList<String> tokens = getTokens(); |
+
| 62 | 26141 | final CharTermAttribute termAtt = getTermAtt(); |
+
| 63 | 26152 | if (tokens.isEmpty() && input.incrementToken()) { |
+
| 64 | 17623 | final String text = new String(termAtt.buffer(), 0, termAtt.length()); |
+
| 65 | 17610 | if (UrlStringUtils.containsUrl(text)) { |
| 66 | 6 | final String[] parts = text.split("\\s"); |
| 67 | 12 | for (String part : parts) { |
| 68 | 6 | if (UrlStringUtils.isUrl(part)) { |
@@ -158,18 +158,18 @@
| 79 | |
} |
| 80 | 6 | } else { |
-
| 81 | 17705 | tokens.add(text); |
+
| 81 | 17602 | tokens.add(text); |
| 82 | |
} |
| 83 | |
} |
-
| 84 | 26234 | return addTerm(); |
+
| 84 | 26121 | return addTerm(); |
| 85 | |
} |
| 86 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.MavenArtifact.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.MavenArtifact.html
index 1f28c6388..85d70018f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.MavenArtifact.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.MavenArtifact.html
@@ -426,6 +426,6 @@
|
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.NexusSearch.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.NexusSearch.html
index 0fc8bad4c..081937a36 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.NexusSearch.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.NexusSearch.html
@@ -334,6 +334,6 @@
|
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NugetPackage.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NugetPackage.html
index 5729be85a..c840541f9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NugetPackage.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NugetPackage.html
@@ -357,6 +357,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParseException.html
index 9379e670c..b8e214364 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParseException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParseException.html
@@ -147,6 +147,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParser.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParser.html
index 75874a611..c588e02a3 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParser.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParser.html
@@ -93,6 +93,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.XPathNuspecParser.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.XPathNuspecParser.html
index 8f68484de..ca512f8c0 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.XPathNuspecParser.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.XPathNuspecParser.html
@@ -163,6 +163,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.html
index 1de8277be..7a11db960 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.html
@@ -557,8 +557,8 @@
| 345 | 2 | final DependencyVersion current = DependencyVersionUtil.parseVersion(DB_SCHEMA_VERSION); |
| 346 | 2 | final DependencyVersion db = DependencyVersionUtil.parseVersion(rs.getString(1)); |
| 347 | 2 | if (current.compareTo(db) > 0) { |
-
| 348 | 0 | LOGGER.debug("Current Schema: " + DB_SCHEMA_VERSION); |
-
| 349 | 0 | LOGGER.debug("DB Schema: " + rs.getString(1)); |
+
| 348 | 0 | LOGGER.debug("Current Schema: {}", DB_SCHEMA_VERSION); |
+
| 349 | 0 | LOGGER.debug("DB Schema: {}", rs.getString(1)); |
| 350 | 0 | updateSchema(conn, rs.getString(1)); |
| 351 | 0 | if (++callDepth < 10) { |
| 352 | 0 | ensureSchemaVersion(conn); |
@@ -583,6 +583,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CorruptDatabaseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CorruptDatabaseException.html
index df62d3a0b..e3a0257f4 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CorruptDatabaseException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CorruptDatabaseException.html
@@ -115,6 +115,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CveDB.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CveDB.html
index 273d67641..7c866e8f9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CveDB.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CveDB.html
@@ -406,8 +406,8 @@
try { |
| 225 | 1 | ps = getConnection().prepareStatement(statementBundle.getString("SELECT_VENDOR_PRODUCT_LIST")); |
| 226 | 1 | rs = ps.executeQuery(); |
-
| 227 | 25471 | while (rs.next()) { |
-
| 228 | 25470 | data.add(new Pair<String, String>(rs.getString(1), rs.getString(2))); |
+
| 227 | 25580 | while (rs.next()) { |
+
| 228 | 25579 | data.add(new Pair<String, String>(rs.getString(1), rs.getString(2))); |
| 229 | |
} |
| 230 | 0 | } catch (SQLException ex) { |
@@ -1192,6 +1192,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseException.html
index 9c69f59ef..b26b94e01 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseException.html
@@ -131,6 +131,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseProperties.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseProperties.html
index ee0c49565..b58296057 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseProperties.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseProperties.html
@@ -12,7 +12,7 @@
@@ -161,7 +161,7 @@
| 72 | |
|
| 73 | |
- private Properties properties; |
+
private final Properties properties; |
| 74 | |
|
| 75 | |
@@ -169,7 +169,7 @@
| 76 | |
|
| 77 | |
- private CveDB cveDB; |
+
private final CveDB cveDB; |
| 78 | |
|
| 79 | |
@@ -184,186 +184,174 @@
|
| 84 | 6 | DatabaseProperties(CveDB cveDB) { |
| 85 | 6 | this.cveDB = cveDB; |
-
| 86 | 6 | loadProperties(); |
+
| 86 | 6 | this.properties = cveDB.getProperties(); |
| 87 | 6 | } |
| 88 | |
|
| 89 | |
|
| 90 | |
- |
-
| 91 | |
- |
-
| 92 | |
- private void loadProperties() { |
-
| 93 | 6 | this.properties = cveDB.getProperties(); |
-
| 94 | 6 | } |
-
| 95 | |
- |
-
| 96 | |
- |
-
| 97 | |
|
-
| 98 | |
+
| 91 | |
|
-
| 99 | |
+
| 92 | |
|
-
| 100 | |
+
| 93 | |
|
-
| 101 | |
+
| 94 | |
public boolean isEmpty() { |
-
| 102 | 0 | return properties == null || properties.isEmpty(); |
-
| 103 | |
+
| 95 | 0 | return properties == null || properties.isEmpty(); |
+
| 96 | |
} |
-
| 104 | |
+
| 97 | |
|
-
| 105 | |
+
| 98 | |
|
-
| 106 | |
+
| 99 | |
|
-
| 107 | |
+
| 100 | |
|
-
| 108 | |
+
| 101 | |
|
-
| 109 | |
+
| 102 | |
|
-
| 110 | |
+
| 103 | |
|
-
| 111 | |
+
| 104 | |
public void save(NvdCveInfo updatedValue) throws UpdateException { |
-
| 112 | 0 | if (updatedValue == null) { |
-
| 113 | 0 | return; |
-
| 114 | |
+
| 105 | 0 | if (updatedValue == null) { |
+
| 106 | 0 | return; |
+
| 107 | |
} |
-
| 115 | 0 | save(LAST_UPDATED_BASE + updatedValue.getId(), String.valueOf(updatedValue.getTimestamp())); |
-
| 116 | 0 | } |
-
| 117 | |
+
| 108 | 0 | save(LAST_UPDATED_BASE + updatedValue.getId(), String.valueOf(updatedValue.getTimestamp())); |
+
| 109 | 0 | } |
+
| 110 | |
|
-
| 118 | |
+
| 111 | |
|
-
| 119 | |
+
| 112 | |
|
-
| 120 | |
+
| 113 | |
|
-
| 121 | |
+
| 114 | |
|
-
| 122 | |
+
| 115 | |
|
-
| 123 | |
+
| 116 | |
|
-
| 124 | |
+
| 117 | |
|
-
| 125 | |
+
| 118 | |
public void save(String key, String value) throws UpdateException { |
-
| 126 | 0 | properties.put(key, value); |
-
| 127 | 0 | cveDB.saveProperty(key, value); |
-
| 128 | 0 | } |
-
| 129 | |
+
| 119 | 0 | properties.put(key, value); |
+
| 120 | 0 | cveDB.saveProperty(key, value); |
+
| 121 | 0 | } |
+
| 122 | |
|
-
| 130 | |
+
| 123 | |
|
-
| 131 | |
+
| 124 | |
|
-
| 132 | |
+
| 125 | |
|
-
| 133 | |
+
| 126 | |
|
-
| 134 | |
+
| 127 | |
|
-
| 135 | |
+
| 128 | |
|
-
| 136 | |
+
| 129 | |
public String getProperty(String key) { |
-
| 137 | 0 | return properties.getProperty(key); |
-
| 138 | |
+
| 130 | 0 | return properties.getProperty(key); |
+
| 131 | |
} |
-
| 139 | |
+
| 132 | |
|
-
| 140 | |
+
| 133 | |
|
-
| 141 | |
+
| 134 | |
|
-
| 142 | |
+
| 135 | |
|
-
| 143 | |
+
| 136 | |
|
-
| 144 | |
+
| 137 | |
|
-
| 145 | |
+
| 138 | |
|
-
| 146 | |
+
| 139 | |
|
-
| 147 | |
+
| 140 | |
|
-
| 148 | |
+
| 141 | |
public String getProperty(String key, String defaultValue) { |
-
| 149 | 0 | return properties.getProperty(key, defaultValue); |
-
| 150 | |
+
| 142 | 0 | return properties.getProperty(key, defaultValue); |
+
| 143 | |
} |
-
| 151 | |
+
| 144 | |
|
-
| 152 | |
+
| 145 | |
|
-
| 153 | |
+
| 146 | |
|
-
| 154 | |
+
| 147 | |
|
-
| 155 | |
+
| 148 | |
|
-
| 156 | |
+
| 149 | |
|
-
| 157 | |
+
| 150 | |
public Properties getProperties() { |
-
| 158 | 1 | return properties; |
-
| 159 | |
+
| 151 | 1 | return properties; |
+
| 152 | |
} |
-
| 160 | |
+
| 153 | |
|
-
| 161 | |
+
| 154 | |
|
-
| 162 | |
+
| 155 | |
|
-
| 163 | |
+
| 156 | |
|
-
| 164 | |
+
| 157 | |
|
-
| 165 | |
+
| 158 | |
|
-
| 166 | |
+
| 159 | |
|
-
| 167 | |
+
| 160 | |
public Map<String, String> getMetaData() { |
-
| 168 | 0 | final Map<String, String> map = new TreeMap<String, String>(); |
-
| 169 | 0 | for (Entry<Object, Object> entry : properties.entrySet()) { |
-
| 170 | 0 | final String key = (String) entry.getKey(); |
-
| 171 | 0 | if (!"version".equals(key)) { |
-
| 172 | 0 | if (key.startsWith("NVD CVE ")) { |
-
| 173 | |
+
| 161 | 0 | final Map<String, String> map = new TreeMap<String, String>(); |
+
| 162 | 0 | for (Entry<Object, Object> entry : properties.entrySet()) { |
+
| 163 | 0 | final String key = (String) entry.getKey(); |
+
| 164 | 0 | if (!"version".equals(key)) { |
+
| 165 | 0 | if (key.startsWith("NVD CVE ")) { |
+
| 166 | |
try { |
-
| 174 | 0 | final long epoch = Long.parseLong((String) entry.getValue()); |
-
| 175 | 0 | final Date date = new Date(epoch); |
-
| 176 | 0 | final DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); |
-
| 177 | 0 | final String formatted = format.format(date); |
-
| 178 | 0 | map.put(key, formatted); |
-
| 179 | 0 | } catch (Throwable ex) { |
-
| 180 | 0 | LOGGER.debug("Unable to parse timestamp from DB", ex); |
-
| 181 | 0 | map.put(key, (String) entry.getValue()); |
-
| 182 | 0 | } |
-
| 183 | |
+
| 167 | 0 | final long epoch = Long.parseLong((String) entry.getValue()); |
+
| 168 | 0 | final Date date = new Date(epoch); |
+
| 169 | 0 | final DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); |
+
| 170 | 0 | final String formatted = format.format(date); |
+
| 171 | 0 | map.put(key, formatted); |
+
| 172 | 0 | } catch (Throwable ex) { |
+
| 173 | 0 | LOGGER.debug("Unable to parse timestamp from DB", ex); |
+
| 174 | 0 | map.put(key, (String) entry.getValue()); |
+
| 175 | 0 | } |
+
| 176 | |
} else { |
-
| 184 | 0 | map.put(key, (String) entry.getValue()); |
-
| 185 | |
+
| 177 | 0 | map.put(key, (String) entry.getValue()); |
+
| 178 | |
} |
-
| 186 | |
+
| 179 | |
} |
-
| 187 | 0 | } |
-
| 188 | 0 | return map; |
-
| 189 | |
+
| 180 | 0 | } |
+
| 181 | 0 | return map; |
+
| 182 | |
} |
-
| 190 | |
+
| 183 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoadException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoadException.html
index f6e82a8d6..77fc06243 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoadException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoadException.html
@@ -131,6 +131,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoader.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoader.html
index 5d0311f50..0adfb87fc 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoader.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoader.html
@@ -271,6 +271,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverShim.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverShim.html
index 1cef03a9b..1d5a3268f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverShim.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverShim.html
@@ -394,6 +394,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.BaseUpdater.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.BaseUpdater.html
index c4bdaba86..34580ba2e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.BaseUpdater.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.BaseUpdater.html
@@ -171,6 +171,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CachedWebDataSource.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CachedWebDataSource.html
index a72100986..dc77db3be 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CachedWebDataSource.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CachedWebDataSource.html
@@ -93,6 +93,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CpeUpdater.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CpeUpdater.html
index a13b0f0d5..fa622ef2a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CpeUpdater.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CpeUpdater.html
@@ -344,6 +344,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.EngineVersionCheck.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.EngineVersionCheck.html
index 7f96da260..f14d9b9c8 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.EngineVersionCheck.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.EngineVersionCheck.html
@@ -12,7 +12,7 @@
@@ -78,295 +78,304 @@
| 30 | |
import org.owasp.dependencycheck.utils.DependencyVersion; |
| 31 | |
- import org.owasp.dependencycheck.utils.Settings; |
+
import org.owasp.dependencycheck.utils.InvalidSettingException; |
| 32 | |
- import org.owasp.dependencycheck.utils.URLConnectionFactory; |
+
import org.owasp.dependencycheck.utils.Settings; |
| 33 | |
- import org.owasp.dependencycheck.utils.URLConnectionFailureException; |
+
import org.owasp.dependencycheck.utils.URLConnectionFactory; |
| 34 | |
- import org.slf4j.Logger; |
+
import org.owasp.dependencycheck.utils.URLConnectionFailureException; |
| 35 | |
- import org.slf4j.LoggerFactory; |
+
import org.slf4j.Logger; |
| 36 | |
- |
+
import org.slf4j.LoggerFactory; |
| 37 | |
- |
+
|
| 38 | |
- |
+
|
| 39 | |
- |
+
|
| 40 | |
+ |
+
| 41 | |
|
-
| 41 | 2 | public class EngineVersionCheck implements CachedWebDataSource { |
-
| 42 | |
- |
+
| 42 | 2 | public class EngineVersionCheck implements CachedWebDataSource { |
| 43 | |
- |
+
|
| 44 | |
- |
+
|
| 45 | |
+ |
+
| 46 | |
|
-
| 46 | 1 | private static final Logger LOGGER = LoggerFactory.getLogger(EngineVersionCheck.class); |
-
| 47 | |
- |
+
| 47 | 1 | private static final Logger LOGGER = LoggerFactory.getLogger(EngineVersionCheck.class); |
| 48 | |
- |
+
|
| 49 | |
- |
-
| 50 | |
- public static final String ENGINE_VERSION_CHECKED_ON = "VersionCheckOn"; |
-
| 51 | |
- |
-
| 52 | |
|
+
| 50 | |
+ |
+
| 51 | |
+ public static final String ENGINE_VERSION_CHECKED_ON = "VersionCheckOn"; |
+
| 52 | |
+ |
| 53 | |
- |
+
|
| 54 | |
- public static final String CURRENT_ENGINE_RELEASE = "CurrentEngineRelease"; |
+
|
| 55 | |
- |
+
public static final String CURRENT_ENGINE_RELEASE = "CurrentEngineRelease"; |
| 56 | |
- |
+
|
| 57 | |
+ |
+
| 58 | |
|
-
| 58 | 2 | private CveDB cveDB = null; |
-
| 59 | |
- |
+
| 59 | 2 | private CveDB cveDB = null; |
| 60 | |
- |
+
|
| 61 | |
- |
+
|
| 62 | |
- |
+
|
| 63 | |
- private String updateToVersion; |
+
|
| 64 | |
- |
+
private String updateToVersion; |
| 65 | |
- |
+
|
| 66 | |
- |
+
|
| 67 | |
- |
+
|
| 68 | |
- |
+
|
| 69 | |
- |
+
|
| 70 | |
+ |
+
| 71 | |
protected String getUpdateToVersion() { |
-
| 71 | 0 | return updateToVersion; |
-
| 72 | |
- } |
+
| 72 | 0 | return updateToVersion; |
| 73 | |
- |
+
} |
| 74 | |
- |
+
|
| 75 | |
- |
-
| 76 | |
- |
-
| 77 | |
- |
-
| 78 | |
- |
-
| 79 | |
- protected void setUpdateToVersion(String version) { |
-
| 80 | 7 | updateToVersion = version; |
-
| 81 | 7 | } |
-
| 82 | |
- |
-
| 83 | |
- @Override |
-
| 84 | |
- public void update() throws UpdateException { |
-
| 85 | |
- try { |
-
| 86 | 0 | openDatabase(); |
-
| 87 | 0 | LOGGER.debug("Begin Engine Version Check"); |
-
| 88 | 0 | final DatabaseProperties properties = cveDB.getDatabaseProperties(); |
-
| 89 | 0 | final long lastChecked = Long.parseLong(properties.getProperty(ENGINE_VERSION_CHECKED_ON, "0")); |
-
| 90 | 0 | final long now = System.currentTimeMillis(); |
-
| 91 | 0 | updateToVersion = properties.getProperty(CURRENT_ENGINE_RELEASE, ""); |
-
| 92 | 0 | final String currentVersion = Settings.getString(Settings.KEYS.APPLICATION_VERSION, "0.0.0"); |
-
| 93 | 0 | LOGGER.debug("Last checked: {}", lastChecked); |
-
| 94 | 0 | LOGGER.debug("Now: {}", now); |
-
| 95 | 0 | LOGGER.debug("Current version: {}", currentVersion); |
-
| 96 | 0 | final boolean updateNeeded = shouldUpdate(lastChecked, now, properties, currentVersion); |
-
| 97 | 0 | if (updateNeeded) { |
-
| 98 | 0 | LOGGER.warn("A new version of dependency-check is available. Consider updating to version {}.", |
-
| 99 | |
- updateToVersion); |
-
| 100 | |
- } |
-
| 101 | 0 | } catch (DatabaseException ex) { |
-
| 102 | 0 | LOGGER.debug("Database Exception opening databases to retrieve properties", ex); |
-
| 103 | 0 | throw new UpdateException("Error occured updating database properties."); |
-
| 104 | |
- } finally { |
-
| 105 | 0 | closeDatabase(); |
-
| 106 | 0 | } |
-
| 107 | 0 | } |
-
| 108 | |
- |
-
| 109 | |
|
-
| 110 | |
- |
-
| 111 | |
+
| 76 | |
+ |
+
| 77 | |
|
-
| 112 | |
- |
-
| 113 | |
- |
-
| 114 | |
- |
-
| 115 | |
- |
-
| 116 | |
- |
-
| 117 | |
- |
-
| 118 | |
- |
-
| 119 | |
+
| 78 | |
+ |
+
| 79 | |
|
-
| 120 | |
- protected boolean shouldUpdate(final long lastChecked, final long now, final DatabaseProperties properties, |
-
| 121 | |
- String currentVersion) throws UpdateException { |
-
| 122 | |
- |
-
| 123 | 7 | int checkRange = 30; |
-
| 124 | 7 | if (updateToVersion.isEmpty()) { |
-
| 125 | 2 | checkRange = 7; |
-
| 126 | |
- } |
-
| 127 | 7 | if (!DateUtil.withinDateRange(lastChecked, now, checkRange)) { |
-
| 128 | 2 | LOGGER.debug("Checking web for new version."); |
-
| 129 | 2 | final String currentRelease = getCurrentReleaseVersion(); |
-
| 130 | 2 | if (currentRelease != null) { |
-
| 131 | 2 | final DependencyVersion v = new DependencyVersion(currentRelease); |
-
| 132 | 2 | if (v.getVersionParts() != null && v.getVersionParts().size() >= 3) { |
-
| 133 | 2 | updateToVersion = v.toString(); |
-
| 134 | 2 | if (!currentRelease.equals(updateToVersion)) { |
-
| 135 | 0 | properties.save(CURRENT_ENGINE_RELEASE, updateToVersion); |
-
| 136 | |
- } else { |
-
| 137 | 2 | properties.save(CURRENT_ENGINE_RELEASE, ""); |
-
| 138 | |
- } |
-
| 139 | 2 | properties.save(ENGINE_VERSION_CHECKED_ON, Long.toString(now)); |
-
| 140 | |
+
| 80 | |
+ protected void setUpdateToVersion(String version) { |
+
| 81 | 7 | updateToVersion = version; |
+
| 82 | 7 | } |
+
| 83 | |
+ |
+
| 84 | |
+ @Override |
+
| 85 | |
+ public void update() throws UpdateException { |
+
| 86 | |
+ |
+
| 87 | |
+ try { |
+
| 88 | 0 | if (Settings.getBoolean(Settings.KEYS.AUTO_UPDATE)) { |
+
| 89 | 0 | openDatabase(); |
+
| 90 | 0 | LOGGER.debug("Begin Engine Version Check"); |
+
| 91 | 0 | final DatabaseProperties properties = cveDB.getDatabaseProperties(); |
+
| 92 | 0 | final long lastChecked = Long.parseLong(properties.getProperty(ENGINE_VERSION_CHECKED_ON, "0")); |
+
| 93 | 0 | final long now = System.currentTimeMillis(); |
+
| 94 | 0 | updateToVersion = properties.getProperty(CURRENT_ENGINE_RELEASE, ""); |
+
| 95 | 0 | final String currentVersion = Settings.getString(Settings.KEYS.APPLICATION_VERSION, "0.0.0"); |
+
| 96 | 0 | LOGGER.debug("Last checked: {}", lastChecked); |
+
| 97 | 0 | LOGGER.debug("Now: {}", now); |
+
| 98 | 0 | LOGGER.debug("Current version: {}", currentVersion); |
+
| 99 | 0 | final boolean updateNeeded = shouldUpdate(lastChecked, now, properties, currentVersion); |
+
| 100 | 0 | if (updateNeeded) { |
+
| 101 | 0 | LOGGER.warn("A new version of dependency-check is available. Consider updating to version {}.", |
+
| 102 | |
+ updateToVersion); |
+
| 103 | |
} |
-
| 141 | |
+
| 104 | |
} |
-
| 142 | 2 | LOGGER.debug("Current Release: {}", updateToVersion); |
+
| 105 | 0 | } catch (DatabaseException ex) { |
+
| 106 | 0 | LOGGER.debug("Database Exception opening databases to retrieve properties", ex); |
+
| 107 | 0 | throw new UpdateException("Error occured updating database properties."); |
+
| 108 | 0 | } catch (InvalidSettingException ex) { |
+
| 109 | 0 | LOGGER.debug("Unable to determine if autoupdate is enabled", ex); |
+
| 110 | |
+ } finally { |
+
| 111 | 0 | closeDatabase(); |
+
| 112 | |
+ |
+
| 113 | 0 | } |
+
| 114 | 0 | } |
+
| 115 | |
+ |
+
| 116 | |
+ |
+
| 117 | |
+ |
+
| 118 | |
+ |
+
| 119 | |
+ |
+
| 120 | |
+ |
+
| 121 | |
+ |
+
| 122 | |
+ |
+
| 123 | |
+ |
+
| 124 | |
+ |
+
| 125 | |
+ |
+
| 126 | |
+ |
+
| 127 | |
+ protected boolean shouldUpdate(final long lastChecked, final long now, final DatabaseProperties properties, |
+
| 128 | |
+ String currentVersion) throws UpdateException { |
+
| 129 | |
+ |
+
| 130 | 7 | final int checkRange = 30; |
+
| 131 | 7 | if (!DateUtil.withinDateRange(lastChecked, now, checkRange)) { |
+
| 132 | 2 | LOGGER.debug("Checking web for new version."); |
+
| 133 | 2 | final String currentRelease = getCurrentReleaseVersion(); |
+
| 134 | 2 | if (currentRelease != null) { |
+
| 135 | 2 | final DependencyVersion v = new DependencyVersion(currentRelease); |
+
| 136 | 2 | if (v.getVersionParts() != null && v.getVersionParts().size() >= 3) { |
+
| 137 | 2 | updateToVersion = v.toString(); |
+
| 138 | 2 | if (!currentRelease.equals(updateToVersion)) { |
+
| 139 | 0 | properties.save(CURRENT_ENGINE_RELEASE, updateToVersion); |
+
| 140 | |
+ } |
+
| 141 | 2 | properties.save(ENGINE_VERSION_CHECKED_ON, Long.toString(now)); |
+
| 142 | |
+ } |
| 143 | |
+ } |
+
| 144 | 2 | LOGGER.debug("Current Release: {}", updateToVersion); |
+
| 145 | |
} |
-
| 144 | 7 | final DependencyVersion running = new DependencyVersion(currentVersion); |
-
| 145 | 7 | final DependencyVersion released = new DependencyVersion(updateToVersion); |
-
| 146 | 7 | if (running.compareTo(released) < 0) { |
-
| 147 | 3 | LOGGER.debug("Upgrade recommended"); |
-
| 148 | 3 | return true; |
+
| 146 | 7 | if (updateToVersion == null) { |
+
| 147 | 0 | LOGGER.debug("Unable to obtain current release"); |
+
| 148 | 0 | return false; |
| 149 | |
} |
-
| 150 | 4 | LOGGER.debug("Upgrade not needed"); |
-
| 151 | 4 | return false; |
-
| 152 | |
- } |
-
| 153 | |
- |
-
| 154 | |
- |
+
| 150 | 7 | final DependencyVersion running = new DependencyVersion(currentVersion); |
+
| 151 | 7 | final DependencyVersion released = new DependencyVersion(updateToVersion); |
+
| 152 | 7 | if (running.compareTo(released) < 0) { |
+
| 153 | 3 | LOGGER.debug("Upgrade recommended"); |
+
| 154 | 3 | return true; |
| 155 | |
- |
-
| 156 | |
- |
-
| 157 | |
- |
+
} |
+
| 156 | 4 | LOGGER.debug("Upgrade not needed"); |
+
| 157 | 4 | return false; |
| 158 | |
- |
-
| 159 | |
- protected final void openDatabase() throws DatabaseException { |
-
| 160 | 0 | if (cveDB != null) { |
-
| 161 | 0 | return; |
-
| 162 | |
- } |
-
| 163 | 0 | cveDB = new CveDB(); |
-
| 164 | 0 | cveDB.open(); |
-
| 165 | 0 | } |
-
| 166 | |
- |
-
| 167 | |
- |
-
| 168 | |
- |
-
| 169 | |
- |
-
| 170 | |
- protected void closeDatabase() { |
-
| 171 | 0 | if (cveDB != null) { |
-
| 172 | |
- try { |
-
| 173 | 0 | cveDB.close(); |
-
| 174 | 0 | cveDB = null; |
-
| 175 | 0 | } catch (Throwable ignore) { |
-
| 176 | 0 | LOGGER.trace("Error closing the cveDB", ignore); |
-
| 177 | 0 | } |
-
| 178 | |
- } |
-
| 179 | 0 | } |
-
| 180 | |
- |
-
| 181 | |
- |
-
| 182 | |
- |
-
| 183 | |
- |
-
| 184 | |
- |
-
| 185 | |
- |
-
| 186 | |
- protected String getCurrentReleaseVersion() { |
-
| 187 | 3 | HttpURLConnection conn = null; |
-
| 188 | |
- try { |
-
| 189 | 3 | final String str = Settings.getString(Settings.KEYS.ENGINE_VERSION_CHECK_URL, "http://jeremylong.github.io/DependencyCheck/current.txt"); |
-
| 190 | 3 | final URL url = new URL(str); |
-
| 191 | 3 | conn = URLConnectionFactory.createHttpURLConnection(url); |
-
| 192 | 3 | conn.connect(); |
-
| 193 | 3 | if (conn.getResponseCode() != 200) { |
-
| 194 | 0 | return null; |
-
| 195 | |
- } |
-
| 196 | 3 | final String releaseVersion = IOUtils.toString(conn.getInputStream(), "UTF-8"); |
-
| 197 | 3 | if (releaseVersion != null) { |
-
| 198 | 3 | return releaseVersion.trim(); |
-
| 199 | |
- } |
-
| 200 | 0 | } catch (MalformedURLException ex) { |
-
| 201 | 0 | LOGGER.debug("unable to retrieve current release version of dependency-check", ex); |
-
| 202 | 0 | } catch (URLConnectionFailureException ex) { |
-
| 203 | 0 | LOGGER.debug("unable to retrieve current release version of dependency-check", ex); |
-
| 204 | 0 | } catch (IOException ex) { |
-
| 205 | 0 | LOGGER.debug("unable to retrieve current release version of dependency-check", ex); |
-
| 206 | |
- } finally { |
-
| 207 | 3 | if (conn != null) { |
-
| 208 | 3 | conn.disconnect(); |
-
| 209 | |
- } |
-
| 210 | |
- } |
-
| 211 | 0 | return null; |
-
| 212 | |
} |
-
| 213 | |
+
| 159 | |
+ |
+
| 160 | |
+ |
+
| 161 | |
+ |
+
| 162 | |
+ |
+
| 163 | |
+ |
+
| 164 | |
+ |
+
| 165 | |
+ protected final void openDatabase() throws DatabaseException { |
+
| 166 | 0 | if (cveDB != null) { |
+
| 167 | 0 | return; |
+
| 168 | |
+ } |
+
| 169 | 0 | cveDB = new CveDB(); |
+
| 170 | 0 | cveDB.open(); |
+
| 171 | 0 | } |
+
| 172 | |
+ |
+
| 173 | |
+ |
+
| 174 | |
+ |
+
| 175 | |
+ |
+
| 176 | |
+ protected void closeDatabase() { |
+
| 177 | 0 | if (cveDB != null) { |
+
| 178 | |
+ try { |
+
| 179 | 0 | cveDB.close(); |
+
| 180 | 0 | cveDB = null; |
+
| 181 | 0 | } catch (Throwable ignore) { |
+
| 182 | 0 | LOGGER.trace("Error closing the cveDB", ignore); |
+
| 183 | 0 | } |
+
| 184 | |
+ } |
+
| 185 | 0 | } |
+
| 186 | |
+ |
+
| 187 | |
+ |
+
| 188 | |
+ |
+
| 189 | |
+ |
+
| 190 | |
+ |
+
| 191 | |
+ |
+
| 192 | |
+ protected String getCurrentReleaseVersion() { |
+
| 193 | 3 | HttpURLConnection conn = null; |
+
| 194 | |
+ try { |
+
| 195 | 3 | final String str = Settings.getString(Settings.KEYS.ENGINE_VERSION_CHECK_URL, "http://jeremylong.github.io/DependencyCheck/current.txt"); |
+
| 196 | 3 | final URL url = new URL(str); |
+
| 197 | 3 | conn = URLConnectionFactory.createHttpURLConnection(url); |
+
| 198 | 3 | conn.connect(); |
+
| 199 | 3 | if (conn.getResponseCode() != 200) { |
+
| 200 | 0 | return null; |
+
| 201 | |
+ } |
+
| 202 | 3 | final String releaseVersion = IOUtils.toString(conn.getInputStream(), "UTF-8"); |
+
| 203 | 3 | if (releaseVersion != null) { |
+
| 204 | 3 | return releaseVersion.trim(); |
+
| 205 | |
+ } |
+
| 206 | 0 | } catch (MalformedURLException ex) { |
+
| 207 | 0 | LOGGER.debug("unable to retrieve current release version of dependency-check", ex); |
+
| 208 | 0 | } catch (URLConnectionFailureException ex) { |
+
| 209 | 0 | LOGGER.debug("unable to retrieve current release version of dependency-check", ex); |
+
| 210 | 0 | } catch (IOException ex) { |
+
| 211 | 0 | LOGGER.debug("unable to retrieve current release version of dependency-check", ex); |
+
| 212 | |
+ } finally { |
+
| 213 | 3 | if (conn != null) { |
+
| 214 | 3 | conn.disconnect(); |
+
| 215 | |
+ } |
+
| 216 | |
+ } |
+
| 217 | 0 | return null; |
+
| 218 | |
+ } |
+
| 219 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveUpdater.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveUpdater.html
index a7693f11d..fe0a852c1 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveUpdater.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveUpdater.html
@@ -12,7 +12,7 @@
@@ -72,438 +72,472 @@
| 27 | |
import java.util.concurrent.Future; |
| 28 | |
- import org.owasp.dependencycheck.data.nvdcve.DatabaseProperties; |
+
import org.owasp.dependencycheck.data.nvdcve.CveDB; |
| 29 | |
- import static org.owasp.dependencycheck.data.nvdcve.DatabaseProperties.MODIFIED; |
+
import org.owasp.dependencycheck.data.nvdcve.DatabaseException; |
| 30 | |
- import org.owasp.dependencycheck.data.update.exception.InvalidDataException; |
+
import org.owasp.dependencycheck.data.nvdcve.DatabaseProperties; |
| 31 | |
- import org.owasp.dependencycheck.data.update.exception.UpdateException; |
+
import static org.owasp.dependencycheck.data.nvdcve.DatabaseProperties.MODIFIED; |
| 32 | |
- import org.owasp.dependencycheck.data.update.nvd.DownloadTask; |
+
import org.owasp.dependencycheck.data.update.exception.InvalidDataException; |
| 33 | |
- import org.owasp.dependencycheck.data.update.nvd.NvdCveInfo; |
+
import org.owasp.dependencycheck.data.update.exception.UpdateException; |
| 34 | |
- import org.owasp.dependencycheck.data.update.nvd.ProcessTask; |
+
import org.owasp.dependencycheck.data.update.nvd.DownloadTask; |
| 35 | |
- import org.owasp.dependencycheck.data.update.nvd.UpdateableNvdCve; |
+
import org.owasp.dependencycheck.data.update.nvd.NvdCveInfo; |
| 36 | |
- import org.owasp.dependencycheck.utils.DateUtil; |
+
import org.owasp.dependencycheck.data.update.nvd.ProcessTask; |
| 37 | |
- import org.owasp.dependencycheck.utils.DownloadFailedException; |
+
import org.owasp.dependencycheck.data.update.nvd.UpdateableNvdCve; |
| 38 | |
- import org.owasp.dependencycheck.utils.InvalidSettingException; |
+
import org.owasp.dependencycheck.exception.NoDataException; |
| 39 | |
- import org.owasp.dependencycheck.utils.Settings; |
+
import org.owasp.dependencycheck.utils.DateUtil; |
| 40 | |
- import org.slf4j.Logger; |
+
import org.owasp.dependencycheck.utils.DownloadFailedException; |
| 41 | |
- import org.slf4j.LoggerFactory; |
+
import org.owasp.dependencycheck.utils.InvalidSettingException; |
| 42 | |
- |
+
import org.owasp.dependencycheck.utils.Settings; |
| 43 | |
- |
+
import org.slf4j.Logger; |
| 44 | |
- |
+
import org.slf4j.LoggerFactory; |
| 45 | |
- |
+
|
| 46 | |
- |
+
|
| 47 | |
- |
-
| 48 | 0 | public class NvdCveUpdater extends BaseUpdater implements CachedWebDataSource { |
+
|
+
| 48 | |
+ |
| 49 | |
- |
+
|
| 50 | |
- |
-
| 51 | |
- |
+
|
+
| 51 | 0 | public class NvdCveUpdater extends BaseUpdater implements CachedWebDataSource { |
| 52 | |
- |
-
| 53 | 0 | private static final Logger LOGGER = LoggerFactory.getLogger(NvdCveUpdater.class); |
+
|
+
| 53 | |
+ |
| 54 | |
- |
+
|
| 55 | |
- |
-
| 56 | |
|
-
| 57 | 0 | public static final int MAX_THREAD_POOL_SIZE = Settings.getInt(Settings.KEYS.MAX_DOWNLOAD_THREAD_POOL_SIZE, 3); |
+
| 56 | 0 | private static final Logger LOGGER = LoggerFactory.getLogger(NvdCveUpdater.class); |
+
| 57 | |
+ |
| 58 | |
- |
+
|
| 59 | |
- |
-
| 60 | |
- |
+
|
+
| 60 | 0 | public static final int MAX_THREAD_POOL_SIZE = Settings.getInt(Settings.KEYS.MAX_DOWNLOAD_THREAD_POOL_SIZE, 3); |
| 61 | |
- |
+
|
| 62 | |
- |
+
|
| 63 | |
- |
+
|
| 64 | |
- |
+
|
| 65 | |
- @Override |
+
|
| 66 | |
- public void update() throws UpdateException { |
-
| 67 | |
- try { |
-
| 68 | 0 | openDataStores(); |
-
| 69 | 0 | if (checkUpdate()) { |
-
| 70 | 0 | final UpdateableNvdCve updateable = getUpdatesNeeded(); |
-
| 71 | 0 | if (updateable.isUpdateNeeded()) { |
-
| 72 | 0 | performUpdate(updateable); |
-
| 73 | |
- } |
-
| 74 | |
- } |
-
| 75 | 0 | } catch (MalformedURLException ex) { |
-
| 76 | 0 | LOGGER.warn( |
-
| 77 | |
- "NVD CVE properties files contain an invalid URL, unable to update the data to use the most current data."); |
-
| 78 | 0 | LOGGER.debug("", ex); |
-
| 79 | 0 | } catch (DownloadFailedException ex) { |
-
| 80 | 0 | LOGGER.warn( |
-
| 81 | |
- "Unable to download the NVD CVE data; the results may not include the most recent CPE/CVEs from the NVD."); |
-
| 82 | 0 | if (Settings.getString(Settings.KEYS.PROXY_SERVER) == null) { |
-
| 83 | 0 | LOGGER.info( |
-
| 84 | |
- "If you are behind a proxy you may need to configure dependency-check to use the proxy."); |
-
| 85 | |
- } |
-
| 86 | 0 | LOGGER.debug("", ex); |
-
| 87 | |
- } finally { |
-
| 88 | 0 | closeDataStores(); |
-
| 89 | 0 | } |
-
| 90 | 0 | } |
-
| 91 | |
- |
-
| 92 | |
- |
-
| 93 | |
- |
-
| 94 | |
- |
-
| 95 | |
- |
-
| 96 | |
- |
-
| 97 | |
- |
-
| 98 | |
- |
-
| 99 | |
- |
-
| 100 | |
- private boolean checkUpdate() throws UpdateException { |
-
| 101 | 0 | boolean proceed = true; |
-
| 102 | |
- |
-
| 103 | 0 | final int validForHours = Settings.getInt(Settings.KEYS.CVE_CHECK_VALID_FOR_HOURS, 0); |
-
| 104 | 0 | if (0 < validForHours) { |
-
| 105 | |
- |
-
| 106 | 0 | final long msValid = validForHours * 60L * 60L * 1000L; |
-
| 107 | 0 | final long lastChecked = Long.parseLong(getProperties().getProperty(DatabaseProperties.LAST_CHECKED, "0")); |
-
| 108 | 0 | final long now = System.currentTimeMillis(); |
-
| 109 | 0 | proceed = (now - lastChecked) > msValid; |
-
| 110 | 0 | if (proceed) { |
-
| 111 | 0 | getProperties().save(DatabaseProperties.LAST_CHECKED, Long.toString(now)); |
-
| 112 | |
- } else { |
-
| 113 | 0 | LOGGER.info("Skipping NVD check since last check was within {} hours.", validForHours); |
-
| 114 | 0 | LOGGER.debug("Last NVD was at {}, and now {} is within {} ms.", |
-
| 115 | |
- lastChecked, now, msValid); |
-
| 116 | |
- } |
-
| 117 | |
- } |
-
| 118 | 0 | return proceed; |
-
| 119 | |
- } |
-
| 120 | |
- |
-
| 121 | |
- |
-
| 122 | |
- |
-
| 123 | |
- |
-
| 124 | |
- |
-
| 125 | |
- |
-
| 126 | |
|
-
| 127 | |
+
| 67 | |
|
-
| 128 | |
- public void performUpdate(UpdateableNvdCve updateable) throws UpdateException { |
-
| 129 | 0 | int maxUpdates = 0; |
-
| 130 | |
+
| 68 | |
+ @Override |
+
| 69 | |
+ public void update() throws UpdateException { |
+
| 70 | |
try { |
-
| 131 | 0 | for (NvdCveInfo cve : updateable) { |
-
| 132 | 0 | if (cve.getNeedsUpdate()) { |
-
| 133 | 0 | maxUpdates += 1; |
-
| 134 | |
+
| 71 | 0 | openDataStores(); |
+
| 72 | 0 | if (checkUpdate()) { |
+
| 73 | 0 | final UpdateableNvdCve updateable = getUpdatesNeeded(); |
+
| 74 | 0 | if (updateable.isUpdateNeeded()) { |
+
| 75 | 0 | performUpdate(updateable); |
+
| 76 | |
} |
-
| 135 | 0 | } |
-
| 136 | 0 | if (maxUpdates <= 0) { |
-
| 137 | |
- return; |
+
| 77 | |
+ } |
+
| 78 | 0 | } catch (MalformedURLException ex) { |
+
| 79 | 0 | LOGGER.warn( |
+
| 80 | |
+ "NVD CVE properties files contain an invalid URL, unable to update the data to use the most current data."); |
+
| 81 | 0 | LOGGER.debug("", ex); |
+
| 82 | 0 | } catch (DownloadFailedException ex) { |
+
| 83 | 0 | LOGGER.warn( |
+
| 84 | |
+ "Unable to download the NVD CVE data; the results may not include the most recent CPE/CVEs from the NVD."); |
+
| 85 | 0 | if (Settings.getString(Settings.KEYS.PROXY_SERVER) == null) { |
+
| 86 | 0 | LOGGER.info( |
+
| 87 | |
+ "If you are behind a proxy you may need to configure dependency-check to use the proxy."); |
+
| 88 | |
+ } |
+
| 89 | 0 | LOGGER.debug("", ex); |
+
| 90 | |
+ } finally { |
+
| 91 | 0 | closeDataStores(); |
+
| 92 | 0 | } |
+
| 93 | 0 | } |
+
| 94 | |
+ |
+
| 95 | |
+ |
+
| 96 | |
+ |
+
| 97 | |
+ |
+
| 98 | |
+ |
+
| 99 | |
+ |
+
| 100 | |
+ |
+
| 101 | |
+ |
+
| 102 | |
+ |
+
| 103 | |
+ private boolean checkUpdate() throws UpdateException { |
+
| 104 | 0 | boolean proceed = true; |
+
| 105 | |
+ |
+
| 106 | 0 | final int validForHours = Settings.getInt(Settings.KEYS.CVE_CHECK_VALID_FOR_HOURS, 0); |
+
| 107 | 0 | if (dataExists() && 0 < validForHours) { |
+
| 108 | |
+ |
+
| 109 | 0 | final long msValid = validForHours * 60L * 60L * 1000L; |
+
| 110 | 0 | final long lastChecked = Long.parseLong(getProperties().getProperty(DatabaseProperties.LAST_CHECKED, "0")); |
+
| 111 | 0 | final long now = System.currentTimeMillis(); |
+
| 112 | 0 | proceed = (now - lastChecked) > msValid; |
+
| 113 | 0 | if (proceed) { |
+
| 114 | 0 | getProperties().save(DatabaseProperties.LAST_CHECKED, Long.toString(now)); |
+
| 115 | |
+ } else { |
+
| 116 | 0 | LOGGER.info("Skipping NVD check since last check was within {} hours.", validForHours); |
+
| 117 | 0 | LOGGER.debug("Last NVD was at {}, and now {} is within {} ms.", |
+
| 118 | |
+ lastChecked, now, msValid); |
+
| 119 | |
+ } |
+
| 120 | |
+ } |
+
| 121 | 0 | return proceed; |
+
| 122 | |
+ } |
+
| 123 | |
+ |
+
| 124 | |
+ |
+
| 125 | |
+ |
+
| 126 | |
+ |
+
| 127 | |
+ private boolean dataExists() { |
+
| 128 | 0 | CveDB cve = null; |
+
| 129 | |
+ try { |
+
| 130 | 0 | cve = new CveDB(); |
+
| 131 | 0 | cve.open(); |
+
| 132 | 0 | return cve.dataExists(); |
+
| 133 | 0 | } catch (DatabaseException ex) { |
+
| 134 | 0 | return false; |
+
| 135 | |
+ } finally { |
+
| 136 | 0 | if (cve != null) { |
+
| 137 | 0 | cve.close(); |
| 138 | |
} |
-
| 139 | 0 | if (maxUpdates > 3) { |
-
| 140 | 0 | LOGGER.info( |
+
| 139 | |
+ } |
+
| 140 | |
+ } |
| 141 | |
- "NVD CVE requires several updates; this could take a couple of minutes."); |
+
|
| 142 | |
- } |
-
| 143 | 0 | if (maxUpdates > 0) { |
-
| 144 | 0 | openDataStores(); |
+
|
+
| 143 | |
+ |
+
| 144 | |
+ |
| 145 | |
- } |
+
|
| 146 | |
- |
-
| 147 | 0 | final int poolSize = (MAX_THREAD_POOL_SIZE < maxUpdates) ? MAX_THREAD_POOL_SIZE : maxUpdates; |
+
|
+
| 147 | |
+ |
| 148 | |
- |
-
| 149 | 0 | final ExecutorService downloadExecutors = Executors.newFixedThreadPool(poolSize); |
-
| 150 | 0 | final ExecutorService processExecutor = Executors.newSingleThreadExecutor(); |
-
| 151 | 0 | final Set<Future<Future<ProcessTask>>> downloadFutures = new HashSet<Future<Future<ProcessTask>>>(maxUpdates); |
+
|
+
| 149 | |
+ public void performUpdate(UpdateableNvdCve updateable) throws UpdateException { |
+
| 150 | 0 | int maxUpdates = 0; |
+
| 151 | |
+ try { |
| 152 | 0 | for (NvdCveInfo cve : updateable) { |
| 153 | 0 | if (cve.getNeedsUpdate()) { |
-
| 154 | 0 | final DownloadTask call = new DownloadTask(cve, processExecutor, getCveDB(), Settings.getInstance()); |
-
| 155 | 0 | downloadFutures.add(downloadExecutors.submit(call)); |
-
| 156 | |
+
| 154 | 0 | maxUpdates += 1; |
+
| 155 | |
} |
-
| 157 | 0 | } |
-
| 158 | 0 | downloadExecutors.shutdown(); |
+
| 156 | 0 | } |
+
| 157 | 0 | if (maxUpdates <= 0) { |
+
| 158 | |
+ return; |
| 159 | |
+ } |
+
| 160 | 0 | if (maxUpdates > 3) { |
+
| 161 | 0 | LOGGER.info( |
+
| 162 | |
+ "NVD CVE requires several updates; this could take a couple of minutes."); |
+
| 163 | |
+ } |
+
| 164 | 0 | if (maxUpdates > 0) { |
+
| 165 | 0 | openDataStores(); |
+
| 166 | |
+ } |
+
| 167 | |
|
-
| 160 | |
- |
-
| 161 | 0 | final Set<Future<ProcessTask>> processFutures = new HashSet<Future<ProcessTask>>(maxUpdates); |
-
| 162 | 0 | for (Future<Future<ProcessTask>> future : downloadFutures) { |
-
| 163 | 0 | Future<ProcessTask> task = null; |
-
| 164 | |
- try { |
-
| 165 | 0 | task = future.get(); |
-
| 166 | 0 | } catch (InterruptedException ex) { |
-
| 167 | 0 | downloadExecutors.shutdownNow(); |
-
| 168 | 0 | processExecutor.shutdownNow(); |
+
| 168 | 0 | final int poolSize = (MAX_THREAD_POOL_SIZE < maxUpdates) ? MAX_THREAD_POOL_SIZE : maxUpdates; |
| 169 | |
|
-
| 170 | 0 | LOGGER.debug("Thread was interrupted during download", ex); |
-
| 171 | 0 | throw new UpdateException("The download was interrupted", ex); |
-
| 172 | 0 | } catch (ExecutionException ex) { |
-
| 173 | 0 | downloadExecutors.shutdownNow(); |
-
| 174 | 0 | processExecutor.shutdownNow(); |
-
| 175 | |
- |
-
| 176 | 0 | LOGGER.debug("Thread was interrupted during download execution", ex); |
-
| 177 | 0 | throw new UpdateException("The execution of the download was interrupted", ex); |
-
| 178 | 0 | } |
-
| 179 | 0 | if (task == null) { |
-
| 180 | 0 | downloadExecutors.shutdownNow(); |
-
| 181 | 0 | processExecutor.shutdownNow(); |
-
| 182 | 0 | LOGGER.debug("Thread was interrupted during download"); |
-
| 183 | 0 | throw new UpdateException("The download was interrupted; unable to complete the update"); |
-
| 184 | |
- } else { |
-
| 185 | 0 | processFutures.add(task); |
-
| 186 | |
+
| 170 | 0 | final ExecutorService downloadExecutors = Executors.newFixedThreadPool(poolSize); |
+
| 171 | 0 | final ExecutorService processExecutor = Executors.newSingleThreadExecutor(); |
+
| 172 | 0 | final Set<Future<Future<ProcessTask>>> downloadFutures = new HashSet<Future<Future<ProcessTask>>>(maxUpdates); |
+
| 173 | 0 | for (NvdCveInfo cve : updateable) { |
+
| 174 | 0 | if (cve.getNeedsUpdate()) { |
+
| 175 | 0 | final DownloadTask call = new DownloadTask(cve, processExecutor, getCveDB(), Settings.getInstance()); |
+
| 176 | 0 | downloadFutures.add(downloadExecutors.submit(call)); |
+
| 177 | |
} |
-
| 187 | 0 | } |
-
| 188 | |
+
| 178 | 0 | } |
+
| 179 | 0 | downloadExecutors.shutdown(); |
+
| 180 | |
|
-
| 189 | 0 | for (Future<ProcessTask> future : processFutures) { |
-
| 190 | |
+
| 181 | |
+ |
+
| 182 | 0 | final Set<Future<ProcessTask>> processFutures = new HashSet<Future<ProcessTask>>(maxUpdates); |
+
| 183 | 0 | for (Future<Future<ProcessTask>> future : downloadFutures) { |
+
| 184 | 0 | Future<ProcessTask> task = null; |
+
| 185 | |
try { |
-
| 191 | 0 | final ProcessTask task = future.get(); |
-
| 192 | 0 | if (task.getException() != null) { |
-
| 193 | 0 | throw task.getException(); |
-
| 194 | |
- } |
-
| 195 | 0 | } catch (InterruptedException ex) { |
-
| 196 | 0 | processExecutor.shutdownNow(); |
-
| 197 | 0 | LOGGER.debug("Thread was interrupted during processing", ex); |
-
| 198 | 0 | throw new UpdateException(ex); |
-
| 199 | 0 | } catch (ExecutionException ex) { |
-
| 200 | 0 | processExecutor.shutdownNow(); |
-
| 201 | 0 | LOGGER.debug("Execution Exception during process", ex); |
-
| 202 | 0 | throw new UpdateException(ex); |
-
| 203 | |
- } finally { |
-
| 204 | 0 | processExecutor.shutdown(); |
-
| 205 | 0 | } |
-
| 206 | 0 | } |
+
| 186 | 0 | task = future.get(); |
+
| 187 | 0 | } catch (InterruptedException ex) { |
+
| 188 | 0 | downloadExecutors.shutdownNow(); |
+
| 189 | 0 | processExecutor.shutdownNow(); |
+
| 190 | |
+ |
+
| 191 | 0 | LOGGER.debug("Thread was interrupted during download", ex); |
+
| 192 | 0 | throw new UpdateException("The download was interrupted", ex); |
+
| 193 | 0 | } catch (ExecutionException ex) { |
+
| 194 | 0 | downloadExecutors.shutdownNow(); |
+
| 195 | 0 | processExecutor.shutdownNow(); |
+
| 196 | |
+ |
+
| 197 | 0 | LOGGER.debug("Thread was interrupted during download execution", ex); |
+
| 198 | 0 | throw new UpdateException("The execution of the download was interrupted", ex); |
+
| 199 | 0 | } |
+
| 200 | 0 | if (task == null) { |
+
| 201 | 0 | downloadExecutors.shutdownNow(); |
+
| 202 | 0 | processExecutor.shutdownNow(); |
+
| 203 | 0 | LOGGER.debug("Thread was interrupted during download"); |
+
| 204 | 0 | throw new UpdateException("The download was interrupted; unable to complete the update"); |
+
| 205 | |
+ } else { |
+
| 206 | 0 | processFutures.add(task); |
| 207 | |
- |
-
| 208 | 0 | if (maxUpdates >= 1) { |
-
| 209 | 0 | getProperties().save(updateable.get(MODIFIED)); |
-
| 210 | 0 | LOGGER.info("Begin database maintenance."); |
-
| 211 | 0 | getCveDB().cleanupDatabase(); |
-
| 212 | 0 | LOGGER.info("End database maintenance."); |
-
| 213 | |
- } |
-
| 214 | |
- } finally { |
-
| 215 | 0 | closeDataStores(); |
-
| 216 | 0 | } |
-
| 217 | 0 | } |
-
| 218 | |
- |
-
| 219 | |
- |
-
| 220 | |
- |
-
| 221 | |
- |
-
| 222 | |
- |
-
| 223 | |
- |
-
| 224 | |
- |
-
| 225 | |
- |
-
| 226 | |
- |
-
| 227 | |
- |
-
| 228 | |
- protected final UpdateableNvdCve getUpdatesNeeded() throws MalformedURLException, DownloadFailedException, UpdateException { |
-
| 229 | 0 | UpdateableNvdCve updates = null; |
-
| 230 | |
- try { |
-
| 231 | 0 | updates = retrieveCurrentTimestampsFromWeb(); |
-
| 232 | 0 | } catch (InvalidDataException ex) { |
-
| 233 | 0 | final String msg = "Unable to retrieve valid timestamp from nvd cve downloads page"; |
-
| 234 | 0 | LOGGER.debug(msg, ex); |
-
| 235 | 0 | throw new DownloadFailedException(msg, ex); |
-
| 236 | 0 | } catch (InvalidSettingException ex) { |
-
| 237 | 0 | LOGGER.debug("Invalid setting found when retrieving timestamps", ex); |
-
| 238 | 0 | throw new DownloadFailedException("Invalid settings", ex); |
-
| 239 | 0 | } |
-
| 240 | |
- |
-
| 241 | 0 | if (updates == null) { |
-
| 242 | 0 | throw new DownloadFailedException("Unable to retrieve the timestamps of the currently published NVD CVE data"); |
-
| 243 | |
- } |
-
| 244 | 0 | if (!getProperties().isEmpty()) { |
-
| 245 | |
- try { |
-
| 246 | 0 | final long lastUpdated = Long.parseLong(getProperties().getProperty(DatabaseProperties.LAST_UPDATED, "0")); |
-
| 247 | 0 | final long now = System.currentTimeMillis(); |
-
| 248 | 0 | final int days = Settings.getInt(Settings.KEYS.CVE_MODIFIED_VALID_FOR_DAYS, 7); |
-
| 249 | 0 | if (lastUpdated == updates.getTimeStamp(MODIFIED)) { |
-
| 250 | 0 | updates.clear(); |
-
| 251 | 0 | } else if (DateUtil.withinDateRange(lastUpdated, now, days)) { |
-
| 252 | 0 | for (NvdCveInfo entry : updates) { |
-
| 253 | 0 | if (MODIFIED.equals(entry.getId())) { |
-
| 254 | 0 | entry.setNeedsUpdate(true); |
-
| 255 | |
- } else { |
-
| 256 | 0 | entry.setNeedsUpdate(false); |
-
| 257 | |
- } |
-
| 258 | 0 | } |
-
| 259 | |
- } else { |
-
| 260 | 0 | for (NvdCveInfo entry : updates) { |
-
| 261 | 0 | if (MODIFIED.equals(entry.getId())) { |
-
| 262 | 0 | entry.setNeedsUpdate(true); |
-
| 263 | |
- } else { |
-
| 264 | 0 | long currentTimestamp = 0; |
-
| 265 | |
- try { |
-
| 266 | 0 | currentTimestamp = Long.parseLong(getProperties().getProperty(DatabaseProperties.LAST_UPDATED_BASE |
-
| 267 | |
- + entry.getId(), "0")); |
-
| 268 | 0 | } catch (NumberFormatException ex) { |
-
| 269 | 0 | LOGGER.debug("Error parsing '{}' '{}' from nvdcve.lastupdated", |
-
| 270 | |
- DatabaseProperties.LAST_UPDATED_BASE, entry.getId(), ex); |
-
| 271 | 0 | } |
-
| 272 | 0 | if (currentTimestamp == entry.getTimestamp()) { |
-
| 273 | 0 | entry.setNeedsUpdate(false); |
-
| 274 | |
- } |
-
| 275 | |
- } |
-
| 276 | 0 | } |
-
| 277 | |
} |
-
| 278 | 0 | } catch (NumberFormatException ex) { |
-
| 279 | 0 | LOGGER.warn("An invalid schema version or timestamp exists in the data.properties file."); |
-
| 280 | 0 | LOGGER.debug("", ex); |
-
| 281 | 0 | } |
-
| 282 | |
- } |
-
| 283 | 0 | return updates; |
-
| 284 | |
- } |
-
| 285 | |
+
| 208 | 0 | } |
+
| 209 | |
|
-
| 286 | |
+
| 210 | 0 | for (Future<ProcessTask> future : processFutures) { |
+
| 211 | |
+ try { |
+
| 212 | 0 | final ProcessTask task = future.get(); |
+
| 213 | 0 | if (task.getException() != null) { |
+
| 214 | 0 | throw task.getException(); |
+
| 215 | |
+ } |
+
| 216 | 0 | } catch (InterruptedException ex) { |
+
| 217 | 0 | processExecutor.shutdownNow(); |
+
| 218 | 0 | LOGGER.debug("Thread was interrupted during processing", ex); |
+
| 219 | 0 | throw new UpdateException(ex); |
+
| 220 | 0 | } catch (ExecutionException ex) { |
+
| 221 | 0 | processExecutor.shutdownNow(); |
+
| 222 | 0 | LOGGER.debug("Execution Exception during process", ex); |
+
| 223 | 0 | throw new UpdateException(ex); |
+
| 224 | |
+ } finally { |
+
| 225 | 0 | processExecutor.shutdown(); |
+
| 226 | 0 | } |
+
| 227 | 0 | } |
+
| 228 | |
+ |
+
| 229 | 0 | if (maxUpdates >= 1) { |
+
| 230 | 0 | getProperties().save(updateable.get(MODIFIED)); |
+
| 231 | 0 | LOGGER.info("Begin database maintenance."); |
+
| 232 | 0 | getCveDB().cleanupDatabase(); |
+
| 233 | 0 | LOGGER.info("End database maintenance."); |
+
| 234 | |
+ } |
+
| 235 | |
+ } finally { |
+
| 236 | 0 | closeDataStores(); |
+
| 237 | 0 | } |
+
| 238 | 0 | } |
+
| 239 | |
+ |
+
| 240 | |
|
-
| 287 | |
- |
-
| 288 | |
+
| 241 | |
+ |
+
| 242 | |
+ |
+
| 243 | |
|
-
| 289 | |
- |
-
| 290 | |
- |
-
| 291 | |
- |
-
| 292 | |
- |
-
| 293 | |
- |
-
| 294 | |
+
| 244 | |
+ |
+
| 245 | |
+ |
+
| 246 | |
+ |
+
| 247 | |
+ |
+
| 248 | |
|
-
| 295 | |
- private UpdateableNvdCve retrieveCurrentTimestampsFromWeb() |
-
| 296 | |
- throws MalformedURLException, DownloadFailedException, InvalidDataException, InvalidSettingException { |
-
| 297 | |
+
| 249 | |
+ protected final UpdateableNvdCve getUpdatesNeeded() throws MalformedURLException, DownloadFailedException, UpdateException { |
+
| 250 | 0 | UpdateableNvdCve updates = null; |
+
| 251 | |
+ try { |
+
| 252 | 0 | updates = retrieveCurrentTimestampsFromWeb(); |
+
| 253 | 0 | } catch (InvalidDataException ex) { |
+
| 254 | 0 | final String msg = "Unable to retrieve valid timestamp from nvd cve downloads page"; |
+
| 255 | 0 | LOGGER.debug(msg, ex); |
+
| 256 | 0 | throw new DownloadFailedException(msg, ex); |
+
| 257 | 0 | } catch (InvalidSettingException ex) { |
+
| 258 | 0 | LOGGER.debug("Invalid setting found when retrieving timestamps", ex); |
+
| 259 | 0 | throw new DownloadFailedException("Invalid settings", ex); |
+
| 260 | 0 | } |
+
| 261 | |
|
-
| 298 | 0 | final UpdateableNvdCve updates = new UpdateableNvdCve(); |
-
| 299 | 0 | updates.add(MODIFIED, Settings.getString(Settings.KEYS.CVE_MODIFIED_20_URL), |
-
| 300 | |
- Settings.getString(Settings.KEYS.CVE_MODIFIED_12_URL), |
-
| 301 | |
- false); |
-
| 302 | |
- |
-
| 303 | 0 | final int start = Settings.getInt(Settings.KEYS.CVE_START_YEAR); |
-
| 304 | 0 | final int end = Calendar.getInstance().get(Calendar.YEAR); |
-
| 305 | 0 | final String baseUrl20 = Settings.getString(Settings.KEYS.CVE_SCHEMA_2_0); |
-
| 306 | 0 | final String baseUrl12 = Settings.getString(Settings.KEYS.CVE_SCHEMA_1_2); |
-
| 307 | 0 | for (int i = start; i <= end; i++) { |
-
| 308 | 0 | updates.add(Integer.toString(i), String.format(baseUrl20, i), |
-
| 309 | |
- String.format(baseUrl12, i), |
-
| 310 | |
- true); |
-
| 311 | |
+
| 262 | 0 | if (updates == null) { |
+
| 263 | 0 | throw new DownloadFailedException("Unable to retrieve the timestamps of the currently published NVD CVE data"); |
+
| 264 | |
} |
-
| 312 | 0 | return updates; |
-
| 313 | |
+
| 265 | 0 | if (!getProperties().isEmpty()) { |
+
| 266 | |
+ try { |
+
| 267 | 0 | final long lastUpdated = Long.parseLong(getProperties().getProperty(DatabaseProperties.LAST_UPDATED, "0")); |
+
| 268 | 0 | final long now = System.currentTimeMillis(); |
+
| 269 | 0 | final int days = Settings.getInt(Settings.KEYS.CVE_MODIFIED_VALID_FOR_DAYS, 7); |
+
| 270 | 0 | if (lastUpdated == updates.getTimeStamp(MODIFIED)) { |
+
| 271 | 0 | updates.clear(); |
+
| 272 | 0 | } else if (DateUtil.withinDateRange(lastUpdated, now, days)) { |
+
| 273 | 0 | for (NvdCveInfo entry : updates) { |
+
| 274 | 0 | if (MODIFIED.equals(entry.getId())) { |
+
| 275 | 0 | entry.setNeedsUpdate(true); |
+
| 276 | |
+ } else { |
+
| 277 | 0 | entry.setNeedsUpdate(false); |
+
| 278 | |
+ } |
+
| 279 | 0 | } |
+
| 280 | |
+ } else { |
+
| 281 | 0 | for (NvdCveInfo entry : updates) { |
+
| 282 | 0 | if (MODIFIED.equals(entry.getId())) { |
+
| 283 | 0 | entry.setNeedsUpdate(true); |
+
| 284 | |
+ } else { |
+
| 285 | 0 | long currentTimestamp = 0; |
+
| 286 | |
+ try { |
+
| 287 | 0 | currentTimestamp = Long.parseLong(getProperties().getProperty(DatabaseProperties.LAST_UPDATED_BASE |
+
| 288 | |
+ + entry.getId(), "0")); |
+
| 289 | 0 | } catch (NumberFormatException ex) { |
+
| 290 | 0 | LOGGER.debug("Error parsing '{}' '{}' from nvdcve.lastupdated", |
+
| 291 | |
+ DatabaseProperties.LAST_UPDATED_BASE, entry.getId(), ex); |
+
| 292 | 0 | } |
+
| 293 | 0 | if (currentTimestamp == entry.getTimestamp()) { |
+
| 294 | 0 | entry.setNeedsUpdate(false); |
+
| 295 | |
+ } |
+
| 296 | |
+ } |
+
| 297 | 0 | } |
+
| 298 | |
+ } |
+
| 299 | 0 | } catch (NumberFormatException ex) { |
+
| 300 | 0 | LOGGER.warn("An invalid schema version or timestamp exists in the data.properties file."); |
+
| 301 | 0 | LOGGER.debug("", ex); |
+
| 302 | 0 | } |
+
| 303 | |
+ } |
+
| 304 | 0 | return updates; |
+
| 305 | |
} |
-
| 314 | |
+
| 306 | |
|
+
| 307 | |
+ |
+
| 308 | |
+ |
+
| 309 | |
+ |
+
| 310 | |
+ |
+
| 311 | |
+ |
+
| 312 | |
+ |
+
| 313 | |
+ |
+
| 314 | |
+ |
| 315 | |
+ |
+
| 316 | |
+ private UpdateableNvdCve retrieveCurrentTimestampsFromWeb() |
+
| 317 | |
+ throws MalformedURLException, DownloadFailedException, InvalidDataException, InvalidSettingException { |
+
| 318 | |
+ |
+
| 319 | 0 | final UpdateableNvdCve updates = new UpdateableNvdCve(); |
+
| 320 | 0 | updates.add(MODIFIED, Settings.getString(Settings.KEYS.CVE_MODIFIED_20_URL), |
+
| 321 | |
+ Settings.getString(Settings.KEYS.CVE_MODIFIED_12_URL), |
+
| 322 | |
+ false); |
+
| 323 | |
+ |
+
| 324 | 0 | final int start = Settings.getInt(Settings.KEYS.CVE_START_YEAR); |
+
| 325 | 0 | final int end = Calendar.getInstance().get(Calendar.YEAR); |
+
| 326 | 0 | final String baseUrl20 = Settings.getString(Settings.KEYS.CVE_SCHEMA_2_0); |
+
| 327 | 0 | final String baseUrl12 = Settings.getString(Settings.KEYS.CVE_SCHEMA_1_2); |
+
| 328 | 0 | for (int i = start; i <= end; i++) { |
+
| 329 | 0 | updates.add(Integer.toString(i), String.format(baseUrl20, i), |
+
| 330 | |
+ String.format(baseUrl12, i), |
+
| 331 | |
+ true); |
+
| 332 | |
+ } |
+
| 333 | 0 | return updates; |
+
| 334 | |
+ } |
+
| 335 | |
+ |
+
| 336 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateService.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateService.html
index d7a1f6d1c..d6854c140 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateService.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateService.html
@@ -121,6 +121,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.cpe.CPEHandler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.cpe.CPEHandler.html
index 59bea0638..9ae2d23bd 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.cpe.CPEHandler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.cpe.CPEHandler.html
@@ -112,7 +112,7 @@
|
| 48 | |
|
-
| 49 | 0 | private Element current = new Element(); |
+
| 49 | 0 | private final Element current = new Element(); |
| 50 | |
|
| 51 | |
@@ -126,7 +126,7 @@
|
| 56 | |
|
-
| 57 | 0 | private List<Cpe> data = new ArrayList<Cpe>(); |
+
| 57 | 0 | private final List<Cpe> data = new ArrayList<Cpe>(); |
| 58 | |
|
| 59 | |
@@ -701,6 +701,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.cpe.Cpe.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.cpe.Cpe.html
index b38943025..b60fcb18c 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.cpe.Cpe.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.cpe.Cpe.html
@@ -251,6 +251,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.InvalidDataException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.InvalidDataException.html
index b6740c39c..affa5740a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.InvalidDataException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.InvalidDataException.html
@@ -115,6 +115,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.UpdateException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.UpdateException.html
index 25b56af00..1d890bfee 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.UpdateException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.UpdateException.html
@@ -147,6 +147,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.DownloadTask.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.DownloadTask.html
index 9a826a725..6c927b7cf 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.DownloadTask.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.DownloadTask.html
@@ -12,7 +12,7 @@
@@ -167,7 +167,7 @@
| 82 | |
|
| 83 | |
- private CveDB cveDB; |
+
private final CveDB cveDB; |
| 84 | |
|
| 85 | |
@@ -175,7 +175,7 @@
| 86 | |
|
| 87 | |
- private ExecutorService processorService; |
+
private final ExecutorService processorService; |
| 88 | |
|
| 89 | |
@@ -191,7 +191,7 @@
| 94 | |
|
| 95 | |
- private Settings settings; |
+
private final Settings settings; |
| 96 | |
|
| 97 | |
@@ -308,225 +308,184 @@
| 156 | 0 | this.second = second; |
| 157 | 0 | } |
| 158 | |
- |
+
|
| 159 | |
- |
-
| 160 | |
- |
-
| 161 | 1 | private Exception exception = null; |
-
| 162 | |
- |
-
| 163 | |
- |
-
| 164 | |
- |
-
| 165 | |
- |
-
| 166 | |
- |
-
| 167 | |
- |
-
| 168 | |
- public Exception getException() { |
-
| 169 | 0 | return exception; |
-
| 170 | |
- } |
-
| 171 | |
- |
-
| 172 | |
- |
-
| 173 | |
- |
-
| 174 | |
- |
-
| 175 | |
- |
-
| 176 | |
- |
-
| 177 | |
- public boolean hasException() { |
-
| 178 | 0 | return exception != null; |
-
| 179 | |
- } |
-
| 180 | |
- |
-
| 181 | |
@Override |
-
| 182 | |
+
| 160 | |
public Future<ProcessTask> call() throws Exception { |
-
| 183 | |
+
| 161 | |
try { |
-
| 184 | 1 | Settings.setInstance(settings); |
-
| 185 | 1 | final URL url1 = new URL(nvdCveInfo.getUrl()); |
-
| 186 | 1 | final URL url2 = new URL(nvdCveInfo.getOldSchemaVersionUrl()); |
-
| 187 | 1 | LOGGER.info("Download Started for NVD CVE - {}", nvdCveInfo.getId()); |
-
| 188 | 1 | final long startDownload = System.currentTimeMillis(); |
-
| 189 | |
+
| 162 | 1 | Settings.setInstance(settings); |
+
| 163 | 1 | final URL url1 = new URL(nvdCveInfo.getUrl()); |
+
| 164 | 1 | final URL url2 = new URL(nvdCveInfo.getOldSchemaVersionUrl()); |
+
| 165 | 1 | LOGGER.info("Download Started for NVD CVE - {}", nvdCveInfo.getId()); |
+
| 166 | 1 | final long startDownload = System.currentTimeMillis(); |
+
| 167 | |
try { |
-
| 190 | 1 | Downloader.fetchFile(url1, first); |
-
| 191 | 1 | Downloader.fetchFile(url2, second); |
-
| 192 | 0 | } catch (DownloadFailedException ex) { |
-
| 193 | 0 | LOGGER.warn("Download Failed for NVD CVE - {}\nSome CVEs may not be reported.", nvdCveInfo.getId()); |
-
| 194 | 0 | if (Settings.getString(Settings.KEYS.PROXY_SERVER) == null) { |
-
| 195 | 0 | LOGGER.info( |
-
| 196 | |
+
| 168 | 1 | Downloader.fetchFile(url1, first); |
+
| 169 | 1 | Downloader.fetchFile(url2, second); |
+
| 170 | 0 | } catch (DownloadFailedException ex) { |
+
| 171 | 0 | LOGGER.warn("Download Failed for NVD CVE - {}\nSome CVEs may not be reported.", nvdCveInfo.getId()); |
+
| 172 | 0 | if (Settings.getString(Settings.KEYS.PROXY_SERVER) == null) { |
+
| 173 | 0 | LOGGER.info( |
+
| 174 | |
"If you are behind a proxy you may need to configure dependency-check to use the proxy."); |
-
| 197 | |
+
| 175 | |
} |
-
| 198 | 0 | LOGGER.debug("", ex); |
-
| 199 | 0 | return null; |
-
| 200 | 1 | } |
-
| 201 | 1 | if (url1.toExternalForm().endsWith(".xml.gz")) { |
-
| 202 | 1 | extractGzip(first); |
-
| 203 | |
+
| 176 | 0 | LOGGER.debug("", ex); |
+
| 177 | 0 | return null; |
+
| 178 | 1 | } |
+
| 179 | 1 | if (url1.toExternalForm().endsWith(".xml.gz")) { |
+
| 180 | 1 | extractGzip(first); |
+
| 181 | |
} |
-
| 204 | 1 | if (url2.toExternalForm().endsWith(".xml.gz")) { |
-
| 205 | 1 | extractGzip(second); |
-
| 206 | |
+
| 182 | 1 | if (url2.toExternalForm().endsWith(".xml.gz")) { |
+
| 183 | 1 | extractGzip(second); |
+
| 184 | |
} |
-
| 207 | |
+
| 185 | |
|
-
| 208 | 1 | LOGGER.info("Download Complete for NVD CVE - {} ({} ms)", nvdCveInfo.getId(), |
-
| 209 | |
+
| 186 | 1 | LOGGER.info("Download Complete for NVD CVE - {} ({} ms)", nvdCveInfo.getId(), |
+
| 187 | |
System.currentTimeMillis() - startDownload); |
-
| 210 | 1 | if (this.processorService == null) { |
-
| 211 | 1 | return null; |
-
| 212 | |
+
| 188 | 1 | if (this.processorService == null) { |
+
| 189 | 1 | return null; |
+
| 190 | |
} |
-
| 213 | 0 | final ProcessTask task = new ProcessTask(cveDB, this, settings); |
-
| 214 | 0 | return this.processorService.submit(task); |
-
| 215 | |
+
| 191 | 0 | final ProcessTask task = new ProcessTask(cveDB, this, settings); |
+
| 192 | 0 | return this.processorService.submit(task); |
+
| 193 | |
|
-
| 216 | 0 | } catch (Throwable ex) { |
-
| 217 | 0 | LOGGER.warn("An exception occurred downloading NVD CVE - {}\nSome CVEs may not be reported.", nvdCveInfo.getId()); |
-
| 218 | 0 | LOGGER.debug("Download Task Failed", ex); |
-
| 219 | |
+
| 194 | 0 | } catch (Throwable ex) { |
+
| 195 | 0 | LOGGER.warn("An exception occurred downloading NVD CVE - {}\nSome CVEs may not be reported.", nvdCveInfo.getId()); |
+
| 196 | 0 | LOGGER.debug("Download Task Failed", ex); |
+
| 197 | |
} finally { |
-
| 220 | 1 | Settings.cleanup(false); |
-
| 221 | 0 | } |
-
| 222 | 0 | return null; |
-
| 223 | |
+
| 198 | 1 | Settings.cleanup(false); |
+
| 199 | 0 | } |
+
| 200 | 0 | return null; |
+
| 201 | |
} |
-
| 224 | |
+
| 202 | |
|
-
| 225 | |
+
| 203 | |
|
-
| 226 | |
+
| 204 | |
|
-
| 227 | |
+
| 205 | |
|
-
| 228 | |
+
| 206 | |
public void cleanup() { |
-
| 229 | 0 | boolean deleted = false; |
-
| 230 | |
+
| 207 | 0 | boolean deleted = false; |
+
| 208 | |
try { |
-
| 231 | 0 | if (first != null && first.exists()) { |
-
| 232 | 0 | deleted = first.delete(); |
-
| 233 | |
+
| 209 | 0 | if (first != null && first.exists()) { |
+
| 210 | 0 | deleted = first.delete(); |
+
| 211 | |
} |
-
| 234 | |
+
| 212 | |
} finally { |
-
| 235 | 0 | if (first != null && (first.exists() || !deleted)) { |
-
| 236 | 0 | first.deleteOnExit(); |
-
| 237 | |
+
| 213 | 0 | if (first != null && (first.exists() || !deleted)) { |
+
| 214 | 0 | first.deleteOnExit(); |
+
| 215 | |
} |
-
| 238 | |
+
| 216 | |
} |
-
| 239 | |
+
| 217 | |
try { |
-
| 240 | 0 | deleted = false; |
-
| 241 | 0 | if (second != null && second.exists()) { |
-
| 242 | 0 | deleted = second.delete(); |
-
| 243 | |
+
| 218 | 0 | deleted = false; |
+
| 219 | 0 | if (second != null && second.exists()) { |
+
| 220 | 0 | deleted = second.delete(); |
+
| 221 | |
} |
-
| 244 | |
+
| 222 | |
} finally { |
-
| 245 | 0 | if (second != null && (second.exists() || !deleted)) { |
-
| 246 | 0 | second.deleteOnExit(); |
-
| 247 | |
+
| 223 | 0 | if (second != null && (second.exists() || !deleted)) { |
+
| 224 | 0 | second.deleteOnExit(); |
+
| 225 | |
} |
-
| 248 | |
+
| 226 | |
} |
-
| 249 | 0 | } |
-
| 250 | |
+
| 227 | 0 | } |
+
| 228 | |
|
-
| 251 | |
+
| 229 | |
|
-
| 252 | |
+
| 230 | |
|
-
| 253 | |
+
| 231 | |
|
-
| 254 | |
+
| 232 | |
|
-
| 255 | |
+
| 233 | |
|
-
| 256 | |
+
| 234 | |
|
-
| 257 | |
+
| 235 | |
|
-
| 258 | |
+
| 236 | |
private void extractGzip(File file) throws FileNotFoundException, IOException { |
-
| 259 | 2 | final String originalPath = file.getPath(); |
-
| 260 | 2 | final File gzip = new File(originalPath + ".gz"); |
-
| 261 | 2 | if (gzip.isFile() && !gzip.delete()) { |
-
| 262 | 0 | gzip.deleteOnExit(); |
-
| 263 | |
+
| 237 | 2 | final String originalPath = file.getPath(); |
+
| 238 | 2 | final File gzip = new File(originalPath + ".gz"); |
+
| 239 | 2 | if (gzip.isFile() && !gzip.delete()) { |
+
| 240 | 0 | gzip.deleteOnExit(); |
+
| 241 | |
} |
-
| 264 | 2 | if (!file.renameTo(gzip)) { |
-
| 265 | 0 | throw new IOException("Unable to rename '" + file.getPath() + "'"); |
-
| 266 | |
+
| 242 | 2 | if (!file.renameTo(gzip)) { |
+
| 243 | 0 | throw new IOException("Unable to rename '" + file.getPath() + "'"); |
+
| 244 | |
} |
-
| 267 | 2 | final File newfile = new File(originalPath); |
-
| 268 | |
+
| 245 | 2 | final File newfile = new File(originalPath); |
+
| 246 | |
|
-
| 269 | 2 | final byte[] buffer = new byte[4096]; |
-
| 270 | |
+
| 247 | 2 | final byte[] buffer = new byte[4096]; |
+
| 248 | |
|
-
| 271 | 2 | GZIPInputStream cin = null; |
-
| 272 | 2 | FileOutputStream out = null; |
-
| 273 | |
+
| 249 | 2 | GZIPInputStream cin = null; |
+
| 250 | 2 | FileOutputStream out = null; |
+
| 251 | |
try { |
-
| 274 | 2 | cin = new GZIPInputStream(new FileInputStream(gzip)); |
-
| 275 | 2 | out = new FileOutputStream(newfile); |
-
| 276 | |
+
| 252 | 2 | cin = new GZIPInputStream(new FileInputStream(gzip)); |
+
| 253 | 2 | out = new FileOutputStream(newfile); |
+
| 254 | |
|
-
| 277 | |
+
| 255 | |
int len; |
-
| 278 | 733 | while ((len = cin.read(buffer)) > 0) { |
-
| 279 | 731 | out.write(buffer, 0, len); |
-
| 280 | |
+
| 256 | 167 | while ((len = cin.read(buffer)) > 0) { |
+
| 257 | 165 | out.write(buffer, 0, len); |
+
| 258 | |
} |
-
| 281 | |
+
| 259 | |
} finally { |
-
| 282 | 2 | if (cin != null) { |
-
| 283 | |
+
| 260 | 2 | if (cin != null) { |
+
| 261 | |
try { |
-
| 284 | 2 | cin.close(); |
-
| 285 | 0 | } catch (IOException ex) { |
-
| 286 | 0 | LOGGER.trace("ignore", ex); |
-
| 287 | 2 | } |
-
| 288 | |
+
| 262 | 2 | cin.close(); |
+
| 263 | 0 | } catch (IOException ex) { |
+
| 264 | 0 | LOGGER.trace("ignore", ex); |
+
| 265 | 2 | } |
+
| 266 | |
} |
-
| 289 | 2 | if (out != null) { |
-
| 290 | |
+
| 267 | 2 | if (out != null) { |
+
| 268 | |
try { |
-
| 291 | 2 | out.close(); |
-
| 292 | 0 | } catch (IOException ex) { |
-
| 293 | 0 | LOGGER.trace("ignore", ex); |
-
| 294 | 2 | } |
-
| 295 | |
+
| 269 | 2 | out.close(); |
+
| 270 | 0 | } catch (IOException ex) { |
+
| 271 | 0 | LOGGER.trace("ignore", ex); |
+
| 272 | 2 | } |
+
| 273 | |
} |
-
| 296 | 2 | if (gzip.isFile()) { |
-
| 297 | 2 | FileUtils.deleteQuietly(gzip); |
-
| 298 | |
+
| 274 | 2 | if (gzip.isFile()) { |
+
| 275 | 2 | FileUtils.deleteQuietly(gzip); |
+
| 276 | |
} |
-
| 299 | |
+
| 277 | |
} |
-
| 300 | 2 | } |
-
| 301 | |
+
| 278 | 2 | } |
+
| 279 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.NvdCve12Handler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.NvdCve12Handler.html
index fec4bfa75..c66993706 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.NvdCve12Handler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.NvdCve12Handler.html
@@ -12,8 +12,8 @@
@@ -202,253 +202,257 @@
| 100 | |
} |
| 101 | 27 | } else if (!skip && current.isProdNode()) { |
-
| 102 | |
+
| 102 | 52 | vendor = attributes.getValue("vendor"); |
+
| 103 | 52 | product = attributes.getValue("name"); |
+
| 104 | 1143 | } else if (!skip && current.isVersNode()) { |
+
| 105 | 761 | final String prev = attributes.getValue("prev"); |
+
| 106 | 761 | if (prev != null && "1".equals(prev)) { |
+
| 107 | 1 | hasPreviousVersion = true; |
+
| 108 | 1 | final String edition = attributes.getValue("edition"); |
+
| 109 | 1 | final String num = attributes.getValue("num"); |
+
| 110 | |
|
-
| 103 | 52 | vendor = attributes.getValue("vendor"); |
-
| 104 | 52 | product = attributes.getValue("name"); |
-
| 105 | 1143 | } else if (!skip && current.isVersNode()) { |
-
| 106 | 761 | final String prev = attributes.getValue("prev"); |
-
| 107 | 761 | if (prev != null && "1".equals(prev)) { |
-
| 108 | 1 | hasPreviousVersion = true; |
-
| 109 | 1 | final String edition = attributes.getValue("edition"); |
-
| 110 | 1 | final String num = attributes.getValue("num"); |
| 111 | |
- |
-
| 112 | |
|
-
| 113 | |
+
| 112 | |
|
-
| 114 | |
+
| 113 | |
|
-
| 115 | 1 | String cpe = "cpe:/a:" + vendor + ":" + product; |
-
| 116 | 1 | if (num != null) { |
-
| 117 | 1 | cpe += ':' + num; |
-
| 118 | |
- } |
-
| 119 | 1 | if (edition != null) { |
-
| 120 | 0 | cpe += ':' + edition; |
+
| 114 | 1 | final int cpeLen = 8 + vendor.length() + product.length() |
+
| 115 | |
+ + (null != num ? (1 + num.length()) : 0) |
+
| 116 | |
+ + (null != edition ? (1 + edition.length()) : 0); |
+
| 117 | 1 | final StringBuilder cpe = new StringBuilder(cpeLen); |
+
| 118 | 1 | cpe.append("cpe:/a:").append(vendor).append(':').append(product); |
+
| 119 | 1 | if (num != null) { |
+
| 120 | 1 | cpe.append(':').append(num); |
| 121 | |
} |
-
| 122 | 1 | final VulnerableSoftware vs = new VulnerableSoftware(); |
-
| 123 | 1 | vs.setCpe(cpe); |
-
| 124 | 1 | vs.setPreviousVersion(prev); |
-
| 125 | 1 | software.add(vs); |
-
| 126 | |
+
| 122 | 1 | if (edition != null) { |
+
| 123 | 0 | cpe.append(':').append(edition); |
+
| 124 | |
+ } |
+
| 125 | 1 | final VulnerableSoftware vs = new VulnerableSoftware(); |
+
| 126 | 1 | vs.setCpe(cpe.toString()); |
+
| 127 | 1 | vs.setPreviousVersion(prev); |
+
| 128 | 1 | software.add(vs); |
+
| 129 | |
} |
-
| 127 | 761 | } else if (current.isNVDNode()) { |
-
| 128 | 1 | final String nvdVer = attributes.getValue("nvd_xml_version"); |
-
| 129 | 1 | if (!CURRENT_SCHEMA_VERSION.equals(nvdVer)) { |
-
| 130 | 0 | throw new SAXNotSupportedException("Schema version " + nvdVer + " is not supported"); |
-
| 131 | |
+
| 130 | 761 | } else if (current.isNVDNode()) { |
+
| 131 | 1 | final String nvdVer = attributes.getValue("nvd_xml_version"); |
+
| 132 | 1 | if (!CURRENT_SCHEMA_VERSION.equals(nvdVer)) { |
+
| 133 | 0 | throw new SAXNotSupportedException("Schema version " + nvdVer + " is not supported"); |
+
| 134 | |
} |
-
| 132 | 1 | vulnerabilities = new HashMap<String, List<VulnerableSoftware>>(); |
-
| 133 | |
- } |
-
| 134 | 1222 | } |
-
| 135 | |
- |
+
| 135 | 1 | vulnerabilities = new HashMap<String, List<VulnerableSoftware>>(); |
| 136 | |
+ } |
+
| 137 | 1222 | } |
+
| 138 | |
+ |
+
| 139 | |
@Override |
-
| 137 | |
+
| 140 | |
public void endElement(String uri, String localName, String qName) throws SAXException { |
-
| 138 | 1222 | current.setNode(qName); |
-
| 139 | 1222 | if (current.isEntryNode()) { |
-
| 140 | 27 | if (!skip && hasPreviousVersion) { |
-
| 141 | 1 | vulnerabilities.put(vulnerability, software); |
-
| 142 | |
- } |
-
| 143 | 27 | vulnerability = null; |
-
| 144 | 27 | software = null; |
+
| 141 | 1222 | current.setNode(qName); |
+
| 142 | 1222 | if (current.isEntryNode()) { |
+
| 143 | 27 | if (!skip && hasPreviousVersion) { |
+
| 144 | 1 | vulnerabilities.put(vulnerability, software); |
| 145 | |
- } |
-
| 146 | 1222 | } |
-
| 147 | |
- |
+
} |
+
| 146 | 27 | vulnerability = null; |
+
| 147 | 27 | software = null; |
| 148 | |
- |
-
| 149 | |
- |
+
} |
+
| 149 | 1222 | } |
| 150 | |
- |
+
|
| 151 | |
- |
-
| 152 | 1 | protected static class Element { |
+
|
+
| 152 | |
+ |
| 153 | |
- |
+
|
| 154 | |
- |
-
| 155 | |
- |
+
|
+
| 155 | 1 | protected static class Element { |
| 156 | |
- |
+
|
| 157 | |
- public static final String NVD = "nvd"; |
+
|
| 158 | |
- |
+
|
| 159 | |
- |
+
|
| 160 | |
- |
+
public static final String NVD = "nvd"; |
| 161 | |
- public static final String ENTRY = "entry"; |
+
|
| 162 | |
- |
+
|
| 163 | |
- |
+
|
| 164 | |
- |
+
public static final String ENTRY = "entry"; |
| 165 | |
- public static final String VULN_SOFTWARE = "vuln_soft"; |
+
|
| 166 | |
- |
+
|
| 167 | |
- |
+
|
| 168 | |
- |
+
public static final String VULN_SOFTWARE = "vuln_soft"; |
| 169 | |
- public static final String PROD = "prod"; |
+
|
| 170 | |
- |
-
| 171 | |
|
+
| 171 | |
+ |
| 172 | |
- |
+
public static final String PROD = "prod"; |
| 173 | |
- public static final String VERS = "vers"; |
+
|
| 174 | |
- |
+
|
| 175 | |
- |
+
|
| 176 | |
- |
+
public static final String VERS = "vers"; |
| 177 | |
- private String node; |
+
|
| 178 | |
- |
+
|
| 179 | |
- |
+
|
| 180 | |
- |
+
private String node; |
| 181 | |
- |
+
|
| 182 | |
- |
+
|
| 183 | |
- |
+
|
| 184 | |
- public String getNode() { |
-
| 185 | 0 | return this.node; |
+
|
+
| 185 | |
+ |
| 186 | |
- } |
+
|
| 187 | |
- |
-
| 188 | |
- |
+
public String getNode() { |
+
| 188 | 0 | return this.node; |
| 189 | |
- |
+
} |
| 190 | |
- |
+
|
| 191 | |
- |
+
|
| 192 | |
- |
+
|
| 193 | |
- public void setNode(String node) { |
-
| 194 | 2444 | this.node = node; |
-
| 195 | 2444 | } |
+
|
+
| 194 | |
+ |
+
| 195 | |
+ |
| 196 | |
- |
-
| 197 | |
- |
-
| 198 | |
- |
+
public void setNode(String node) { |
+
| 197 | 2444 | this.node = node; |
+
| 198 | 2444 | } |
| 199 | |
- |
+
|
| 200 | |
- |
+
|
| 201 | |
- |
+
|
| 202 | |
- public boolean isNVDNode() { |
-
| 203 | 382 | return NVD.equals(node); |
+
|
+
| 203 | |
+ |
| 204 | |
- } |
+
|
| 205 | |
- |
-
| 206 | |
- |
+
public boolean isNVDNode() { |
+
| 206 | 382 | return NVD.equals(node); |
| 207 | |
- |
+
} |
| 208 | |
- |
+
|
| 209 | |
- |
+
|
| 210 | |
- |
+
|
| 211 | |
- public boolean isEntryNode() { |
-
| 212 | 2444 | return ENTRY.equals(node); |
+
|
+
| 212 | |
+ |
| 213 | |
- } |
+
|
| 214 | |
- |
-
| 215 | |
- |
+
public boolean isEntryNode() { |
+
| 215 | 2444 | return ENTRY.equals(node); |
| 216 | |
- |
+
} |
| 217 | |
- |
+
|
| 218 | |
- |
+
|
| 219 | |
- |
+
|
| 220 | |
- public boolean isVulnSoftwareNode() { |
-
| 221 | 0 | return VULN_SOFTWARE.equals(node); |
+
|
+
| 221 | |
+ |
| 222 | |
- } |
+
|
| 223 | |
- |
-
| 224 | |
- |
+
public boolean isVulnSoftwareNode() { |
+
| 224 | 0 | return VULN_SOFTWARE.equals(node); |
| 225 | |
- |
+
} |
| 226 | |
- |
-
| 227 | |
- |
-
| 228 | |
- |
-
| 229 | |
- public boolean isProdNode() { |
-
| 230 | 1192 | return PROD.equals(node); |
-
| 231 | |
- } |
-
| 232 | |
|
-
| 233 | |
+
| 227 | |
|
-
| 234 | |
- |
-
| 235 | |
+
| 228 | |
+ |
+
| 229 | |
|
-
| 236 | |
+
| 230 | |
|
-
| 237 | |
+
| 231 | |
|
-
| 238 | |
- public boolean isVersNode() { |
-
| 239 | 1140 | return VERS.equals(node); |
-
| 240 | |
+
| 232 | |
+ public boolean isProdNode() { |
+
| 233 | 1192 | return PROD.equals(node); |
+
| 234 | |
} |
+
| 235 | |
+ |
+
| 236 | |
+ |
+
| 237 | |
+ |
+
| 238 | |
+ |
+
| 239 | |
+ |
+
| 240 | |
+ |
| 241 | |
- } |
-
| 242 | |
- |
+
public boolean isVersNode() { |
+
| 242 | 1140 | return VERS.equals(node); |
| 243 | |
+ } |
+
| 244 | |
+ } |
+
| 245 | |
+ |
+
| 246 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.NvdCve20Handler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.NvdCve20Handler.html
index 1124ed9ec..ae50c3eed 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.NvdCve20Handler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.NvdCve20Handler.html
@@ -867,6 +867,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.NvdCveInfo.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.NvdCveInfo.html
index bafd9a70e..8d351e096 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.NvdCveInfo.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.NvdCveInfo.html
@@ -276,6 +276,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.ProcessTask.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.ProcessTask.html
index 3d693126f..9c8b5817e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.ProcessTask.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.ProcessTask.html
@@ -186,7 +186,7 @@
| 87 | |
|
| 88 | |
- private Settings settings; |
+
private final Settings settings; |
| 89 | |
|
| 90 | |
@@ -337,6 +337,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.UpdateableNvdCve.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.UpdateableNvdCve.html
index a39738804..557abe91e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.UpdateableNvdCve.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.nvd.UpdateableNvdCve.html
@@ -85,7 +85,7 @@
|
| 34 | |
|
-
| 35 | 12 | public class UpdateableNvdCve implements java.lang.Iterable<NvdCveInfo>, Iterator<NvdCveInfo> { |
+
| 35 | 12 | public class UpdateableNvdCve implements Iterable<NvdCveInfo>, Iterator<NvdCveInfo> { |
| 36 | |
|
| 37 | |
@@ -94,7 +94,7 @@
|
| 39 | |
|
-
| 40 | 5 | private Map<String, NvdCveInfo> collection = new TreeMap<String, NvdCveInfo>(); |
+
| 40 | 5 | private final Map<String, NvdCveInfo> collection = new TreeMap<String, NvdCveInfo>(); |
| 41 | |
|
| 42 | |
@@ -357,6 +357,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Confidence.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Confidence.html
index 3127ae374..c7ba3d9b2 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Confidence.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Confidence.html
@@ -100,6 +100,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html
index 5eb8af675..e1879f64b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html
@@ -522,7 +522,7 @@
|
| 274 | |
public Set<Identifier> getIdentifiers() { |
-
| 275 | 130 | return this.identifiers; |
+
| 275 | 154 | return this.identifiers; |
| 276 | |
} |
| 277 | |
@@ -1412,6 +1412,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html
index 6ac0f8464..99a42865c 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html
@@ -546,6 +546,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html
index a409202f5..58f910333 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html
@@ -728,6 +728,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html
index d7754bd83..7867f4f98 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html
@@ -287,7 +287,7 @@
|
| 145 | |
public String getType() { |
-
| 146 | 186 | return type; |
+
| 146 | 222 | return type; |
| 147 | |
} |
| 148 | |
@@ -437,6 +437,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html
index 7abf992ea..07dc1a3a7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html
@@ -289,6 +289,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html
index 3cae43229..9f1823478 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html
@@ -835,6 +835,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html
index 8c3c4a62a..fb60e19cb 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html
@@ -109,6 +109,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html
index 057df9f6e..206173363 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html
@@ -668,6 +668,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.NoDataException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.NoDataException.html
index 3c7aa2a8b..6743bae24 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.NoDataException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.NoDataException.html
@@ -147,6 +147,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.ScanAgentException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.ScanAgentException.html
index 8dbdc48ae..5952ebe22 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.ScanAgentException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.ScanAgentException.html
@@ -147,6 +147,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.EscapeTool.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.EscapeTool.html
index a9645a8b9..fbfff19b3 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.EscapeTool.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.EscapeTool.html
@@ -170,6 +170,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html
index b5ff33150..23d10be95 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html
@@ -543,6 +543,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html
index fd6f43b79..99c417a76 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html
@@ -239,6 +239,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.PropertyType.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.PropertyType.html
index cdf179c17..a60456a3a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.PropertyType.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.PropertyType.html
@@ -71,7 +71,7 @@
|
| 27 | |
|
-
| 28 | 376 | public class PropertyType { |
+
| 28 | 451 | public class PropertyType { |
| 29 | |
|
| 30 | |
@@ -117,15 +117,15 @@
|
| 51 | |
public void setValue(String value) { |
-
| 52 | 385 | this.value = value; |
-
| 53 | 385 | } |
+
| 52 | 460 | this.value = value; |
+
| 53 | 460 | } |
| 54 | |
|
| 55 | |
|
| 56 | |
|
-
| 57 | 376 | private boolean regex = false; |
+
| 57 | 451 | private boolean regex = false; |
| 58 | |
|
| 59 | |
@@ -161,15 +161,15 @@
|
| 75 | |
public void setRegex(boolean value) { |
-
| 76 | 369 | this.regex = value; |
-
| 77 | 369 | } |
+
| 76 | 444 | this.regex = value; |
+
| 77 | 444 | } |
| 78 | |
|
| 79 | |
|
| 80 | |
|
-
| 81 | 376 | private boolean caseSensitive = false; |
+
| 81 | 451 | private boolean caseSensitive = false; |
| 82 | |
|
| 83 | |
@@ -205,8 +205,8 @@
|
| 99 | |
public void setCaseSensitive(boolean value) { |
-
| 100 | 370 | this.caseSensitive = value; |
-
| 101 | 370 | } |
+
| 100 | 445 | this.caseSensitive = value; |
+
| 101 | 445 | } |
| 102 | |
|
| 103 | |
@@ -345,6 +345,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionErrorHandler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionErrorHandler.html
index 771b7dc5c..f770ecb36 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionErrorHandler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionErrorHandler.html
@@ -196,6 +196,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionHandler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionHandler.html
index eaf076bf7..f880447b9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionHandler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionHandler.html
@@ -150,7 +150,7 @@
|
| 67 | |
|
-
| 68 | 9 | private List<SuppressionRule> suppressionRules = new ArrayList<SuppressionRule>(); |
+
| 68 | 9 | private final List<SuppressionRule> suppressionRules = new ArrayList<SuppressionRule>(); |
| 69 | |
|
| 70 | |
@@ -216,13 +216,13 @@
@Override |
| 101 | |
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { |
-
| 102 | 665 | currentAttributes = attributes; |
-
| 103 | 665 | currentText = new StringBuilder(); |
-
| 104 | 665 | if (SUPPRESS.equals(qName)) { |
-
| 105 | 140 | rule = new SuppressionRule(); |
-
| 106 | 140 | final String base = currentAttributes.getValue("base"); |
-
| 107 | 140 | if (base != null) { |
-
| 108 | 140 | rule.setBase(Boolean.parseBoolean(base)); |
+
| 102 | 800 | currentAttributes = attributes; |
+
| 103 | 800 | currentText = new StringBuilder(); |
+
| 104 | 800 | if (SUPPRESS.equals(qName)) { |
+
| 105 | 170 | rule = new SuppressionRule(); |
+
| 106 | 170 | final String base = currentAttributes.getValue("base"); |
+
| 107 | 170 | if (base != null) { |
+
| 108 | 170 | rule.setBase(Boolean.parseBoolean(base)); |
| 109 | |
} else { |
| 110 | 0 | rule.setBase(false); |
@@ -230,7 +230,7 @@
} |
| 112 | |
} |
-
| 113 | 665 | } |
+
| 113 | 800 | } |
| 114 | |
|
| 115 | |
@@ -253,30 +253,30 @@
@Override |
| 124 | |
public void endElement(String uri, String localName, String qName) throws SAXException { |
-
| 125 | 665 | if (SUPPRESS.equals(qName)) { |
-
| 126 | 140 | suppressionRules.add(rule); |
-
| 127 | 140 | rule = null; |
-
| 128 | 525 | } else if (FILE_PATH.equals(qName)) { |
+
| 125 | 800 | if (SUPPRESS.equals(qName)) { |
+
| 126 | 170 | suppressionRules.add(rule); |
+
| 127 | 170 | rule = null; |
+
| 128 | 630 | } else if (FILE_PATH.equals(qName)) { |
| 129 | 32 | final PropertyType pt = processPropertyType(); |
| 130 | 32 | rule.setFilePath(pt); |
| 131 | 32 | } else if (SHA1.equals(qName)) { |
| 132 | 4 | rule.setSha1(currentText.toString()); |
-
| 133 | 489 | } else if (GAV.equals(qName)) { |
-
| 134 | 100 | final PropertyType pt = processPropertyType(); |
-
| 135 | 100 | rule.setGav(pt); |
-
| 136 | 100 | } else if (CPE.equals(qName)) { |
-
| 137 | 228 | final PropertyType pt = processPropertyType(); |
-
| 138 | 228 | rule.addCpe(pt); |
-
| 139 | 228 | } else if (CWE.equals(qName)) { |
+
| 133 | 594 | } else if (GAV.equals(qName)) { |
+
| 134 | 130 | final PropertyType pt = processPropertyType(); |
+
| 135 | 130 | rule.setGav(pt); |
+
| 136 | 130 | } else if (CPE.equals(qName)) { |
+
| 137 | 273 | final PropertyType pt = processPropertyType(); |
+
| 138 | 273 | rule.addCpe(pt); |
+
| 139 | 273 | } else if (CWE.equals(qName)) { |
| 140 | 0 | rule.addCwe(currentText.toString()); |
-
| 141 | 161 | } else if (CVE.equals(qName)) { |
+
| 141 | 191 | } else if (CVE.equals(qName)) { |
| 142 | 8 | rule.addCve(currentText.toString()); |
-
| 143 | 153 | } else if (CVSS_BELOW.equals(qName)) { |
+
| 143 | 183 | } else if (CVSS_BELOW.equals(qName)) { |
| 144 | 4 | final float cvss = Float.parseFloat(currentText.toString()); |
| 145 | 4 | rule.addCvssBelow(cvss); |
| 146 | |
} |
-
| 147 | 665 | } |
+
| 147 | 800 | } |
| 148 | |
|
| 149 | |
@@ -299,8 +299,8 @@
@Override |
| 158 | |
public void characters(char[] ch, int start, int length) throws SAXException { |
-
| 159 | 1486 | currentText.append(ch, start, length); |
-
| 160 | 1486 | } |
+
| 159 | 1791 | currentText.append(ch, start, length); |
+
| 160 | 1791 | } |
| 161 | |
|
| 162 | |
@@ -317,28 +317,28 @@
|
| 168 | |
private PropertyType processPropertyType() { |
-
| 169 | 360 | final PropertyType pt = new PropertyType(); |
-
| 170 | 360 | pt.setValue(currentText.toString()); |
-
| 171 | 360 | if (currentAttributes != null && currentAttributes.getLength() > 0) { |
-
| 172 | 360 | final String regex = currentAttributes.getValue("regex"); |
-
| 173 | 360 | if (regex != null) { |
-
| 174 | 360 | pt.setRegex(Boolean.parseBoolean(regex)); |
+
| 169 | 435 | final PropertyType pt = new PropertyType(); |
+
| 170 | 435 | pt.setValue(currentText.toString()); |
+
| 171 | 435 | if (currentAttributes != null && currentAttributes.getLength() > 0) { |
+
| 172 | 435 | final String regex = currentAttributes.getValue("regex"); |
+
| 173 | 435 | if (regex != null) { |
+
| 174 | 435 | pt.setRegex(Boolean.parseBoolean(regex)); |
| 175 | |
} |
-
| 176 | 360 | final String caseSensitive = currentAttributes.getValue("caseSensitive"); |
-
| 177 | 360 | if (caseSensitive != null) { |
-
| 178 | 360 | pt.setCaseSensitive(Boolean.parseBoolean(caseSensitive)); |
+
| 176 | 435 | final String caseSensitive = currentAttributes.getValue("caseSensitive"); |
+
| 177 | 435 | if (caseSensitive != null) { |
+
| 178 | 435 | pt.setCaseSensitive(Boolean.parseBoolean(caseSensitive)); |
| 179 | |
} |
| 180 | |
} |
-
| 181 | 360 | return pt; |
+
| 181 | 435 | return pt; |
| 182 | |
} |
| 183 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParseException.html
index 75597cecd..c839f6bda 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParseException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParseException.html
@@ -147,6 +147,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParser.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParser.html
index 09bc12904..39f4e781d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParser.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParser.html
@@ -239,6 +239,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionRule.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionRule.html
index c45c554b8..95830307e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionRule.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionRule.html
@@ -12,7 +12,7 @@
@@ -62,741 +62,767 @@
| 22 | |
import java.util.List; |
| 23 | |
- import org.apache.commons.lang3.StringUtils; |
-
| 24 | |
import org.owasp.dependencycheck.dependency.Dependency; |
-
| 25 | |
+
| 24 | |
import org.owasp.dependencycheck.dependency.Identifier; |
-
| 26 | |
+
| 25 | |
import org.owasp.dependencycheck.dependency.Vulnerability; |
+
| 26 | |
+ |
| 27 | |
- |
-
| 28 | |
|
-
| 29 | |
+
| 28 | |
|
-
| 30 | |
+
| 29 | |
|
-
| 31 | |
+
| 30 | |
|
-
| 32 | 155 | public class SuppressionRule { |
+
| 31 | 185 | public class SuppressionRule { |
+
| 32 | |
+ |
| 33 | |
- |
+
|
| 34 | |
- |
-
| 35 | |
|
+
| 35 | |
+ |
| 36 | |
- |
-
| 37 | |
private PropertyType filePath; |
+
| 37 | |
+ |
| 38 | |
- |
+
|
| 39 | |
- |
-
| 40 | |
|
+
| 40 | |
+ |
| 41 | |
- |
-
| 42 | |
|
+
| 42 | |
+ |
| 43 | |
- |
-
| 44 | |
public PropertyType getFilePath() { |
-
| 45 | 1 | return filePath; |
+
| 44 | 1 | return filePath; |
+
| 45 | |
+ } |
| 46 | |
- } |
+
|
| 47 | |
- |
+
|
| 48 | |
- |
-
| 49 | |
|
+
| 49 | |
+ |
| 50 | |
- |
-
| 51 | |
|
+
| 51 | |
+ |
| 52 | |
- |
-
| 53 | |
public void setFilePath(PropertyType filePath) { |
-
| 54 | 34 | this.filePath = filePath; |
-
| 55 | 34 | } |
+
| 53 | 34 | this.filePath = filePath; |
+
| 54 | 34 | } |
+
| 55 | |
+ |
| 56 | |
- |
-
| 57 | |
|
+
| 57 | |
+ |
| 58 | |
- |
-
| 59 | |
private String sha1; |
+
| 59 | |
+ |
| 60 | |
- |
+
|
| 61 | |
- |
-
| 62 | |
|
+
| 62 | |
+ |
| 63 | |
- |
-
| 64 | |
|
+
| 64 | |
+ |
| 65 | |
- |
-
| 66 | |
public String getSha1() { |
-
| 67 | 1 | return sha1; |
+
| 66 | 1 | return sha1; |
+
| 67 | |
+ } |
| 68 | |
- } |
+
|
| 69 | |
- |
+
|
| 70 | |
- |
-
| 71 | |
|
+
| 71 | |
+ |
| 72 | |
- |
-
| 73 | |
|
+
| 73 | |
+ |
| 74 | |
- |
-
| 75 | |
public void setSha1(String sha1) { |
-
| 76 | 6 | this.sha1 = sha1; |
-
| 77 | 6 | } |
+
| 75 | 6 | this.sha1 = sha1; |
+
| 76 | 6 | } |
+
| 77 | |
+ |
| 78 | |
- |
-
| 79 | |
|
-
| 80 | |
+
| 79 | |
|
-
| 81 | 155 | private List<PropertyType> cpe = new ArrayList<PropertyType>(); |
+
| 80 | 185 | private List<PropertyType> cpe = new ArrayList<PropertyType>(); |
+
| 81 | |
+ |
| 82 | |
- |
+
|
| 83 | |
- |
-
| 84 | |
|
+
| 84 | |
+ |
| 85 | |
- |
-
| 86 | |
|
+
| 86 | |
+ |
| 87 | |
- |
-
| 88 | |
public List<PropertyType> getCpe() { |
-
| 89 | 1 | return cpe; |
+
| 88 | 1 | return cpe; |
+
| 89 | |
+ } |
| 90 | |
- } |
+
|
| 91 | |
- |
+
|
| 92 | |
- |
-
| 93 | |
|
+
| 93 | |
+ |
| 94 | |
- |
-
| 95 | |
|
+
| 95 | |
+ |
| 96 | |
- |
-
| 97 | |
public void setCpe(List<PropertyType> cpe) { |
-
| 98 | 1 | this.cpe = cpe; |
-
| 99 | 1 | } |
+
| 97 | 1 | this.cpe = cpe; |
+
| 98 | 1 | } |
+
| 99 | |
+ |
| 100 | |
- |
+
|
| 101 | |
- |
-
| 102 | |
|
+
| 102 | |
+ |
| 103 | |
- |
-
| 104 | |
|
+
| 104 | |
+ |
| 105 | |
- |
-
| 106 | |
public void addCpe(PropertyType cpe) { |
-
| 107 | 235 | this.cpe.add(cpe); |
-
| 108 | 235 | } |
+
| 106 | 280 | this.cpe.add(cpe); |
+
| 107 | 280 | } |
+
| 108 | |
+ |
| 109 | |
- |
+
|
| 110 | |
- |
-
| 111 | |
|
+
| 111 | |
+ |
| 112 | |
- |
-
| 113 | |
|
+
| 113 | |
+ |
| 114 | |
- |
-
| 115 | |
public boolean hasCpe() { |
-
| 116 | 19 | return !cpe.isEmpty(); |
+
| 115 | 19 | return !cpe.isEmpty(); |
+
| 116 | |
+ } |
| 117 | |
- } |
+
|
| 118 | |
- |
-
| 119 | |
|
-
| 120 | |
+
| 119 | |
|
-
| 121 | 155 | private List<Float> cvssBelow = new ArrayList<Float>(); |
+
| 120 | 185 | private List<Float> cvssBelow = new ArrayList<Float>(); |
+
| 121 | |
+ |
| 122 | |
- |
+
|
| 123 | |
- |
-
| 124 | |
|
+
| 124 | |
+ |
| 125 | |
- |
-
| 126 | |
|
+
| 126 | |
+ |
| 127 | |
- |
-
| 128 | |
public List<Float> getCvssBelow() { |
-
| 129 | 1 | return cvssBelow; |
+
| 128 | 1 | return cvssBelow; |
+
| 129 | |
+ } |
| 130 | |
- } |
+
|
| 131 | |
- |
+
|
| 132 | |
- |
-
| 133 | |
|
+
| 133 | |
+ |
| 134 | |
- |
-
| 135 | |
|
+
| 135 | |
+ |
| 136 | |
- |
-
| 137 | |
public void setCvssBelow(List<Float> cvssBelow) { |
-
| 138 | 1 | this.cvssBelow = cvssBelow; |
-
| 139 | 1 | } |
+
| 137 | 1 | this.cvssBelow = cvssBelow; |
+
| 138 | 1 | } |
+
| 139 | |
+ |
| 140 | |
- |
+
|
| 141 | |
- |
-
| 142 | |
|
+
| 142 | |
+ |
| 143 | |
- |
-
| 144 | |
|
+
| 144 | |
+ |
| 145 | |
- |
-
| 146 | |
public void addCvssBelow(Float cvss) { |
-
| 147 | 7 | this.cvssBelow.add(cvss); |
-
| 148 | 7 | } |
+
| 146 | 7 | this.cvssBelow.add(cvss); |
+
| 147 | 7 | } |
+
| 148 | |
+ |
| 149 | |
- |
+
|
| 150 | |
- |
-
| 151 | |
|
+
| 151 | |
+ |
| 152 | |
- |
-
| 153 | |
|
+
| 153 | |
+ |
| 154 | |
- |
-
| 155 | |
public boolean hasCvssBelow() { |
-
| 156 | 16 | return !cvssBelow.isEmpty(); |
+
| 155 | 16 | return !cvssBelow.isEmpty(); |
+
| 156 | |
+ } |
| 157 | |
- } |
+
|
| 158 | |
- |
-
| 159 | |
|
-
| 160 | |
+
| 159 | |
|
-
| 161 | 155 | private List<String> cwe = new ArrayList<String>(); |
+
| 160 | 185 | private List<String> cwe = new ArrayList<String>(); |
+
| 161 | |
+ |
| 162 | |
- |
+
|
| 163 | |
- |
-
| 164 | |
|
+
| 164 | |
+ |
| 165 | |
- |
-
| 166 | |
|
+
| 166 | |
+ |
| 167 | |
- |
-
| 168 | |
public List<String> getCwe() { |
-
| 169 | 1 | return cwe; |
+
| 168 | 1 | return cwe; |
+
| 169 | |
+ } |
| 170 | |
- } |
+
|
| 171 | |
- |
+
|
| 172 | |
- |
-
| 173 | |
|
+
| 173 | |
+ |
| 174 | |
- |
-
| 175 | |
|
+
| 175 | |
+ |
| 176 | |
- |
-
| 177 | |
public void setCwe(List<String> cwe) { |
-
| 178 | 1 | this.cwe = cwe; |
-
| 179 | 1 | } |
+
| 177 | 1 | this.cwe = cwe; |
+
| 178 | 1 | } |
+
| 179 | |
+ |
| 180 | |
- |
+
|
| 181 | |
- |
-
| 182 | |
|
+
| 182 | |
+ |
| 183 | |
- |
-
| 184 | |
|
+
| 184 | |
+ |
| 185 | |
- |
-
| 186 | |
public void addCwe(String cwe) { |
-
| 187 | 2 | this.cwe.add(cwe); |
-
| 188 | 2 | } |
+
| 186 | 2 | this.cwe.add(cwe); |
+
| 187 | 2 | } |
+
| 188 | |
+ |
| 189 | |
- |
+
|
| 190 | |
- |
-
| 191 | |
|
+
| 191 | |
+ |
| 192 | |
- |
-
| 193 | |
|
+
| 193 | |
+ |
| 194 | |
- |
-
| 195 | |
public boolean hasCwe() { |
-
| 196 | 17 | return !cwe.isEmpty(); |
+
| 195 | 17 | return !cwe.isEmpty(); |
+
| 196 | |
+ } |
| 197 | |
- } |
+
|
| 198 | |
- |
-
| 199 | |
|
-
| 200 | |
+
| 199 | |
|
-
| 201 | 155 | private List<String> cve = new ArrayList<String>(); |
+
| 200 | 185 | private List<String> cve = new ArrayList<String>(); |
+
| 201 | |
+ |
| 202 | |
- |
+
|
| 203 | |
- |
-
| 204 | |
|
+
| 204 | |
+ |
| 205 | |
- |
-
| 206 | |
|
+
| 206 | |
+ |
| 207 | |
- |
-
| 208 | |
public List<String> getCve() { |
-
| 209 | 1 | return cve; |
+
| 208 | 1 | return cve; |
+
| 209 | |
+ } |
| 210 | |
- } |
+
|
| 211 | |
- |
+
|
| 212 | |
- |
-
| 213 | |
|
+
| 213 | |
+ |
| 214 | |
- |
-
| 215 | |
|
+
| 215 | |
+ |
| 216 | |
- |
-
| 217 | |
public void setCve(List<String> cve) { |
-
| 218 | 1 | this.cve = cve; |
-
| 219 | 1 | } |
+
| 217 | 1 | this.cve = cve; |
+
| 218 | 1 | } |
+
| 219 | |
+ |
| 220 | |
- |
+
|
| 221 | |
- |
-
| 222 | |
|
+
| 222 | |
+ |
| 223 | |
- |
-
| 224 | |
|
+
| 224 | |
+ |
| 225 | |
- |
-
| 226 | |
public void addCve(String cve) { |
-
| 227 | 11 | this.cve.add(cve); |
-
| 228 | 11 | } |
+
| 226 | 11 | this.cve.add(cve); |
+
| 227 | 11 | } |
+
| 228 | |
+ |
| 229 | |
- |
+
|
| 230 | |
- |
-
| 231 | |
|
+
| 231 | |
+ |
| 232 | |
- |
-
| 233 | |
|
+
| 233 | |
+ |
| 234 | |
- |
-
| 235 | |
public boolean hasCve() { |
-
| 236 | 19 | return !cve.isEmpty(); |
+
| 235 | 19 | return !cve.isEmpty(); |
+
| 236 | |
+ } |
| 237 | |
- } |
+
|
| 238 | |
- |
-
| 239 | |
|
-
| 240 | |
+
| 239 | |
|
-
| 241 | 155 | private PropertyType gav = null; |
+
| 240 | 185 | private PropertyType gav = null; |
+
| 241 | |
+ |
| 242 | |
- |
+
|
| 243 | |
- |
-
| 244 | |
|
+
| 244 | |
+ |
| 245 | |
- |
-
| 246 | |
|
+
| 246 | |
+ |
| 247 | |
- |
-
| 248 | |
public PropertyType getGav() { |
-
| 249 | 0 | return gav; |
+
| 248 | 0 | return gav; |
+
| 249 | |
+ } |
| 250 | |
- } |
+
|
| 251 | |
- |
+
|
| 252 | |
- |
-
| 253 | |
|
+
| 253 | |
+ |
| 254 | |
- |
-
| 255 | |
|
+
| 255 | |
+ |
| 256 | |
- |
-
| 257 | |
public void setGav(PropertyType gav) { |
-
| 258 | 101 | this.gav = gav; |
-
| 259 | 101 | } |
+
| 257 | 131 | this.gav = gav; |
+
| 258 | 131 | } |
+
| 259 | |
+ |
| 260 | |
- |
+
|
| 261 | |
- |
-
| 262 | |
|
+
| 262 | |
+ |
| 263 | |
- |
-
| 264 | |
|
+
| 264 | |
+ |
| 265 | |
- |
-
| 266 | |
public boolean hasGav() { |
-
| 267 | 0 | return gav != null; |
+
| 266 | 0 | return gav != null; |
+
| 267 | |
+ } |
| 268 | |
- } |
+
|
| 269 | |
- |
+
|
| 270 | |
- |
+
|
| 271 | |
- |
+
|
| 272 | |
- |
+
|
| 273 | |
- |
-
| 274 | |
private boolean base; |
+
| 274 | |
+ |
| 275 | |
- |
+
|
| 276 | |
- |
-
| 277 | |
|
+
| 277 | |
+ |
| 278 | |
- |
-
| 279 | |
|
+
| 279 | |
+ |
| 280 | |
- |
-
| 281 | |
public boolean isBase() { |
-
| 282 | 17 | return base; |
+
| 281 | 17 | return base; |
+
| 282 | |
+ } |
| 283 | |
- } |
+
|
| 284 | |
- |
+
|
| 285 | |
- |
-
| 286 | |
|
+
| 286 | |
+ |
| 287 | |
- |
-
| 288 | |
|
+
| 288 | |
+ |
| 289 | |
- |
-
| 290 | |
public void setBase(boolean base) { |
-
| 291 | 142 | this.base = base; |
-
| 292 | 142 | } |
+
| 290 | 172 | this.base = base; |
+
| 291 | 172 | } |
+
| 292 | |
+ |
| 293 | |
- |
+
|
| 294 | |
- |
+
|
| 295 | |
- |
+
|
| 296 | |
- |
+
|
| 297 | |
- |
-
| 298 | |
|
+
| 298 | |
+ |
| 299 | |
- |
-
| 300 | |
public void process(Dependency dependency) { |
-
| 301 | 106 | if (filePath != null && !filePath.matches(dependency.getFilePath())) { |
-
| 302 | 8 | return; |
-
| 303 | |
+
| 300 | 130 | if (filePath != null && !filePath.matches(dependency.getFilePath())) { |
+
| 301 | 8 | return; |
+
| 302 | |
} |
-
| 304 | 98 | if (sha1 != null && !sha1.equalsIgnoreCase(dependency.getSha1sum())) { |
-
| 305 | 1 | return; |
-
| 306 | |
+
| 303 | 122 | if (sha1 != null && !sha1.equalsIgnoreCase(dependency.getSha1sum())) { |
+
| 304 | 1 | return; |
+
| 305 | |
} |
-
| 307 | 97 | if (gav != null) { |
-
| 308 | 81 | final Iterator<Identifier> itr = dependency.getIdentifiers().iterator(); |
-
| 309 | 81 | boolean gavFound = false; |
-
| 310 | 205 | while (itr.hasNext()) { |
-
| 311 | 125 | final Identifier i = itr.next(); |
-
| 312 | 125 | if (identifierMatches("maven", this.gav, i)) { |
-
| 313 | 1 | gavFound = true; |
-
| 314 | 1 | break; |
-
| 315 | |
+
| 306 | 121 | if (gav != null) { |
+
| 307 | 105 | final Iterator<Identifier> itr = dependency.getIdentifiers().iterator(); |
+
| 308 | 105 | boolean gavFound = false; |
+
| 309 | 265 | while (itr.hasNext()) { |
+
| 310 | 161 | final Identifier i = itr.next(); |
+
| 311 | 161 | if (identifierMatches("maven", this.gav, i)) { |
+
| 312 | 1 | gavFound = true; |
+
| 313 | 1 | break; |
+
| 314 | |
} |
-
| 316 | 124 | } |
-
| 317 | 81 | if (!gavFound) { |
-
| 318 | 80 | return; |
+
| 315 | 160 | } |
+
| 316 | 105 | if (!gavFound) { |
+
| 317 | 104 | return; |
+
| 318 | |
+ } |
| 319 | |
- } |
+
} |
| 320 | |
- } |
-
| 321 | |
|
-
| 322 | 17 | if (this.hasCpe()) { |
-
| 323 | 12 | final Iterator<Identifier> itr = dependency.getIdentifiers().iterator(); |
-
| 324 | 34 | while (itr.hasNext()) { |
-
| 325 | 22 | final Identifier i = itr.next(); |
-
| 326 | 22 | for (PropertyType c : this.cpe) { |
-
| 327 | 30 | if (identifierMatches("cpe", c, i)) { |
-
| 328 | 7 | if (!isBase()) { |
-
| 329 | 4 | dependency.addSuppressedIdentifier(i); |
-
| 330 | |
+
| 321 | 17 | if (this.hasCpe()) { |
+
| 322 | 12 | final Iterator<Identifier> itr = dependency.getIdentifiers().iterator(); |
+
| 323 | 34 | while (itr.hasNext()) { |
+
| 324 | 22 | final Identifier i = itr.next(); |
+
| 325 | 22 | for (PropertyType c : this.cpe) { |
+
| 326 | 30 | if (identifierMatches("cpe", c, i)) { |
+
| 327 | 7 | if (!isBase()) { |
+
| 328 | 4 | dependency.addSuppressedIdentifier(i); |
+
| 329 | |
} |
-
| 331 | 7 | itr.remove(); |
-
| 332 | 7 | break; |
-
| 333 | |
+
| 330 | 7 | itr.remove(); |
+
| 331 | 7 | break; |
+
| 332 | |
} |
-
| 334 | 23 | } |
-
| 335 | 22 | } |
-
| 336 | |
+
| 333 | 23 | } |
+
| 334 | 22 | } |
+
| 335 | |
} |
-
| 337 | 17 | if (hasCve() || hasCwe() || hasCvssBelow()) { |
-
| 338 | 5 | final Iterator<Vulnerability> itr = dependency.getVulnerabilities().iterator(); |
-
| 339 | 10 | while (itr.hasNext()) { |
-
| 340 | 5 | boolean remove = false; |
-
| 341 | 5 | final Vulnerability v = itr.next(); |
-
| 342 | 5 | for (String entry : this.cve) { |
-
| 343 | 3 | if (entry.equalsIgnoreCase(v.getName())) { |
-
| 344 | 1 | remove = true; |
-
| 345 | 1 | break; |
-
| 346 | |
+
| 336 | 17 | if (hasCve() || hasCwe() || hasCvssBelow()) { |
+
| 337 | 5 | final Iterator<Vulnerability> itr = dependency.getVulnerabilities().iterator(); |
+
| 338 | 10 | while (itr.hasNext()) { |
+
| 339 | 5 | boolean remove = false; |
+
| 340 | 5 | final Vulnerability v = itr.next(); |
+
| 341 | 5 | for (String entry : this.cve) { |
+
| 342 | 3 | if (entry.equalsIgnoreCase(v.getName())) { |
+
| 343 | 1 | remove = true; |
+
| 344 | 1 | break; |
+
| 345 | |
} |
-
| 347 | 2 | } |
-
| 348 | 5 | if (!remove) { |
-
| 349 | 4 | for (String entry : this.cwe) { |
-
| 350 | 1 | if (v.getCwe() != null) { |
-
| 351 | 1 | final String toMatch = String.format("CWE-%s ", entry); |
-
| 352 | 1 | final String toTest = v.getCwe().substring(0, toMatch.length()).toUpperCase(); |
-
| 353 | 1 | if (toTest.equals(toMatch)) { |
-
| 354 | 1 | remove = true; |
-
| 355 | 1 | break; |
-
| 356 | |
+
| 346 | 2 | } |
+
| 347 | 5 | if (!remove) { |
+
| 348 | 4 | for (String entry : this.cwe) { |
+
| 349 | 1 | if (v.getCwe() != null) { |
+
| 350 | 1 | final String toMatch = String.format("CWE-%s ", entry); |
+
| 351 | 1 | final String toTest = v.getCwe().substring(0, toMatch.length()).toUpperCase(); |
+
| 352 | 1 | if (toTest.equals(toMatch)) { |
+
| 353 | 1 | remove = true; |
+
| 354 | 1 | break; |
+
| 355 | |
} |
-
| 357 | |
+
| 356 | |
} |
-
| 358 | 0 | } |
-
| 359 | |
+
| 357 | 0 | } |
+
| 358 | |
} |
-
| 360 | 5 | if (!remove) { |
-
| 361 | 3 | for (float cvss : this.cvssBelow) { |
-
| 362 | 3 | if (v.getCvssScore() < cvss) { |
-
| 363 | 1 | remove = true; |
-
| 364 | 1 | break; |
-
| 365 | |
+
| 359 | 5 | if (!remove) { |
+
| 360 | 3 | for (float cvss : this.cvssBelow) { |
+
| 361 | 3 | if (v.getCvssScore() < cvss) { |
+
| 362 | 1 | remove = true; |
+
| 363 | 1 | break; |
+
| 364 | |
} |
-
| 366 | 2 | } |
-
| 367 | |
+
| 365 | 2 | } |
+
| 366 | |
} |
-
| 368 | 5 | if (remove) { |
-
| 369 | 3 | if (!isBase()) { |
-
| 370 | 3 | dependency.addSuppressedVulnerability(v); |
-
| 371 | |
+
| 367 | 5 | if (remove) { |
+
| 368 | 3 | if (!isBase()) { |
+
| 369 | 3 | dependency.addSuppressedVulnerability(v); |
+
| 370 | |
} |
-
| 372 | 3 | itr.remove(); |
-
| 373 | |
+
| 371 | 3 | itr.remove(); |
+
| 372 | |
} |
-
| 374 | 5 | } |
-
| 375 | |
+
| 373 | 5 | } |
+
| 374 | |
} |
-
| 376 | 17 | } |
+
| 375 | 17 | } |
+
| 376 | |
+ |
| 377 | |
- |
+
|
| 378 | |
- |
-
| 379 | |
|
+
| 379 | |
+ |
| 380 | |
- |
-
| 381 | |
|
-
| 382 | |
+
| 381 | |
|
+
| 382 | |
+ |
| 383 | |
- |
-
| 384 | |
boolean cpeHasNoVersion(PropertyType c) { |
-
| 385 | 34 | return !c.isRegex() && StringUtils.countMatches(c.getValue(), ':') == 3; |
+
| 384 | 34 | return !c.isRegex() && countCharacter(c.getValue(), ':') <= 3; |
+
| 385 | |
+ } |
| 386 | |
- } |
+
|
| 387 | |
- |
+
|
| 388 | |
- |
+
|
| 389 | |
- |
+
|
| 390 | |
- |
+
|
| 391 | |
- |
+
|
| 392 | |
- |
+
|
| 393 | |
- |
+
|
| 394 | |
- |
-
| 395 | |
- |
-
| 396 | |
- boolean identifierMatches(String identifierType, PropertyType suppressionEntry, Identifier identifier) { |
-
| 397 | 164 | if (identifierType.equals(identifier.getType())) { |
-
| 398 | 37 | if (suppressionEntry.matches(identifier.getValue())) { |
-
| 399 | 5 | return true; |
-
| 400 | 32 | } else if ("cpe".equals(identifierType) && cpeHasNoVersion(suppressionEntry)) { |
-
| 401 | 25 | if (suppressionEntry.isCaseSensitive()) { |
-
| 402 | 0 | return identifier.getValue().startsWith(suppressionEntry.getValue()); |
+
int countCharacter(String str, char c) { |
+
| 395 | 32 | int count = 0; |
+
| 396 | 32 | int pos = str.indexOf(c) + 1; |
+
| 397 | 134 | while (pos > 0) { |
+
| 398 | 102 | count += 1; |
+
| 399 | 102 | pos = str.indexOf(c, pos) + 1; |
+
| 400 | |
+ } |
+
| 401 | 32 | return count; |
+
| 402 | |
+ } |
| 403 | |
- } else { |
-
| 404 | 25 | final String id = identifier.getValue().toLowerCase(); |
-
| 405 | 25 | final String check = suppressionEntry.getValue().toLowerCase(); |
-
| 406 | 25 | return id.startsWith(check); |
-
| 407 | |
- } |
-
| 408 | |
- } |
-
| 409 | |
- } |
-
| 410 | 134 | return false; |
-
| 411 | |
- } |
-
| 412 | |
|
-
| 413 | |
+
| 404 | |
|
-
| 414 | |
- |
-
| 415 | |
+
| 405 | |
+ |
+
| 406 | |
|
-
| 416 | |
- |
-
| 417 | |
+
| 407 | |
+ |
+
| 408 | |
+ |
+
| 409 | |
+ |
+
| 410 | |
+ |
+
| 411 | |
|
-
| 418 | |
- @Override |
+
| 412 | |
+ boolean identifierMatches(String identifierType, PropertyType suppressionEntry, Identifier identifier) { |
+
| 413 | 200 | if (identifierType.equals(identifier.getType())) { |
+
| 414 | 37 | if (suppressionEntry.matches(identifier.getValue())) { |
+
| 415 | 5 | return true; |
+
| 416 | 32 | } else if ("cpe".equals(identifierType) && cpeHasNoVersion(suppressionEntry)) { |
+
| 417 | 25 | if (suppressionEntry.isCaseSensitive()) { |
+
| 418 | 0 | return identifier.getValue().startsWith(suppressionEntry.getValue()); |
| 419 | |
- public String toString() { |
-
| 420 | 0 | final StringBuilder sb = new StringBuilder(); |
-
| 421 | 0 | sb.append("SuppressionRule{"); |
-
| 422 | 0 | if (filePath != null) { |
-
| 423 | 0 | sb.append("filePath=").append(filePath).append(','); |
+
} else { |
+
| 420 | 25 | final String id = identifier.getValue().toLowerCase(); |
+
| 421 | 25 | final String check = suppressionEntry.getValue().toLowerCase(); |
+
| 422 | 25 | return id.startsWith(check); |
+
| 423 | |
+ } |
| 424 | |
+ } |
+
| 425 | |
} |
-
| 425 | 0 | if (sha1 != null) { |
-
| 426 | 0 | sb.append("sha1=").append(sha1).append(','); |
+
| 426 | 170 | return false; |
| 427 | |
- } |
-
| 428 | 0 | if (gav != null) { |
-
| 429 | 0 | sb.append("gav=").append(gav).append(','); |
-
| 430 | |
- } |
-
| 431 | 0 | if (cpe != null && !cpe.isEmpty()) { |
-
| 432 | 0 | sb.append("cpe={"); |
-
| 433 | 0 | for (PropertyType pt : cpe) { |
-
| 434 | 0 | sb.append(pt).append(','); |
-
| 435 | 0 | } |
-
| 436 | 0 | sb.append('}'); |
-
| 437 | |
- } |
-
| 438 | 0 | if (cwe != null && !cwe.isEmpty()) { |
-
| 439 | 0 | sb.append("cwe={"); |
-
| 440 | 0 | for (String s : cwe) { |
-
| 441 | 0 | sb.append(s).append(','); |
-
| 442 | 0 | } |
-
| 443 | 0 | sb.append('}'); |
-
| 444 | |
- } |
-
| 445 | 0 | if (cve != null && !cve.isEmpty()) { |
-
| 446 | 0 | sb.append("cve={"); |
-
| 447 | 0 | for (String s : cve) { |
-
| 448 | 0 | sb.append(s).append(','); |
-
| 449 | 0 | } |
-
| 450 | 0 | sb.append('}'); |
-
| 451 | |
- } |
-
| 452 | 0 | if (cvssBelow != null && !cvssBelow.isEmpty()) { |
-
| 453 | 0 | sb.append("cvssBelow={"); |
-
| 454 | 0 | for (Float s : cvssBelow) { |
-
| 455 | 0 | sb.append(s).append(','); |
-
| 456 | 0 | } |
-
| 457 | 0 | sb.append('}'); |
-
| 458 | |
- } |
-
| 459 | 0 | sb.append('}'); |
-
| 460 | 0 | return sb.toString(); |
-
| 461 | |
} |
-
| 462 | |
+
| 428 | |
+ |
+
| 429 | |
+ |
+
| 430 | |
+ |
+
| 431 | |
+ |
+
| 432 | |
+ |
+
| 433 | |
+ |
+
| 434 | |
+ @Override |
+
| 435 | |
+ public String toString() { |
+
| 436 | 0 | final StringBuilder sb = new StringBuilder(64); |
+
| 437 | 0 | sb.append("SuppressionRule{"); |
+
| 438 | 0 | if (filePath != null) { |
+
| 439 | 0 | sb.append("filePath=").append(filePath).append(','); |
+
| 440 | |
+ } |
+
| 441 | 0 | if (sha1 != null) { |
+
| 442 | 0 | sb.append("sha1=").append(sha1).append(','); |
+
| 443 | |
+ } |
+
| 444 | 0 | if (gav != null) { |
+
| 445 | 0 | sb.append("gav=").append(gav).append(','); |
+
| 446 | |
+ } |
+
| 447 | 0 | if (cpe != null && !cpe.isEmpty()) { |
+
| 448 | 0 | sb.append("cpe={"); |
+
| 449 | 0 | for (PropertyType pt : cpe) { |
+
| 450 | 0 | sb.append(pt).append(','); |
+
| 451 | 0 | } |
+
| 452 | 0 | sb.append('}'); |
+
| 453 | |
+ } |
+
| 454 | 0 | if (cwe != null && !cwe.isEmpty()) { |
+
| 455 | 0 | sb.append("cwe={"); |
+
| 456 | 0 | for (String s : cwe) { |
+
| 457 | 0 | sb.append(s).append(','); |
+
| 458 | 0 | } |
+
| 459 | 0 | sb.append('}'); |
+
| 460 | |
+ } |
+
| 461 | 0 | if (cve != null && !cve.isEmpty()) { |
+
| 462 | 0 | sb.append("cve={"); |
+
| 463 | 0 | for (String s : cve) { |
+
| 464 | 0 | sb.append(s).append(','); |
+
| 465 | 0 | } |
+
| 466 | 0 | sb.append('}'); |
+
| 467 | |
+ } |
+
| 468 | 0 | if (cvssBelow != null && !cvssBelow.isEmpty()) { |
+
| 469 | 0 | sb.append("cvssBelow={"); |
+
| 470 | 0 | for (Float s : cvssBelow) { |
+
| 471 | 0 | sb.append(s).append(','); |
+
| 472 | 0 | } |
+
| 473 | 0 | sb.append('}'); |
+
| 474 | |
+ } |
+
| 475 | 0 | sb.append('}'); |
+
| 476 | 0 | return sb.toString(); |
+
| 477 | |
+ } |
+
| 478 | |
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DBUtils.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DBUtils.html
index 07859550a..537b02f21 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DBUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DBUtils.html
@@ -189,6 +189,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DateUtil.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DateUtil.html
index 749be7632..b07e7967e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DateUtil.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DateUtil.html
@@ -109,6 +109,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html
index 3d8a6e2c5..5b90aa0f3 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html
@@ -447,6 +447,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html
index 1465efed6..ee8236427 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html
@@ -185,6 +185,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionUtil.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionUtil.html
index d3a03f4a6..e20a140ec 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionUtil.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionUtil.html
@@ -455,6 +455,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.FileFilterBuilder.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.FileFilterBuilder.html
index e062ab6c6..a29c16f8b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.FileFilterBuilder.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.FileFilterBuilder.html
@@ -270,6 +270,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html
index a8f9ca7e6..a475950ca 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html
@@ -111,7 +111,7 @@
| 51 | 0 | throw new NoSuchElementException(); |
| 52 | |
} |
-
| 53 | 701 | T returnValue = next; |
+
| 53 | 701 | final T returnValue = next; |
| 54 | 701 | toNext(); |
| 55 | 701 | return returnValue; |
| 56 | |
@@ -131,7 +131,7 @@
private void toNext() { |
| 64 | 844 | next = null; |
| 65 | 1355 | while (iterator.hasNext()) { |
-
| 66 | 1260 | T item = iterator.next(); |
+
| 66 | 1260 | final T item = iterator.next(); |
| 67 | 1260 | if (item != null && passes(item)) { |
| 68 | 749 | next = item; |
| 69 | 749 | break; |
@@ -145,6 +145,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Pair.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Pair.html
index 3ba5e19be..70165f2ec 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Pair.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Pair.html
@@ -97,17 +97,17 @@
|
| 41 | |
|
-
| 42 | 25470 | public Pair(L left, R right) { |
-
| 43 | 25470 | this.left = left; |
-
| 44 | 25470 | this.right = right; |
-
| 45 | 25470 | } |
+
| 42 | 25579 | public Pair(L left, R right) { |
+
| 43 | 25579 | this.left = left; |
+
| 44 | 25579 | this.right = right; |
+
| 45 | 25579 | } |
| 46 | |
|
| 47 | |
|
| 48 | |
|
-
| 49 | 25470 | private L left = null; |
+
| 49 | 25579 | private L left = null; |
| 50 | |
|
| 51 | |
@@ -122,7 +122,7 @@
|
| 56 | |
public L getLeft() { |
-
| 57 | 25470 | return left; |
+
| 57 | 25579 | return left; |
| 58 | |
} |
| 59 | |
@@ -147,7 +147,7 @@
|
| 70 | |
|
-
| 71 | 25470 | private R right = null; |
+
| 71 | 25579 | private R right = null; |
| 72 | |
|
| 73 | |
@@ -162,7 +162,7 @@
|
| 78 | |
public R getRight() { |
-
| 79 | 25470 | return right; |
+
| 79 | 25579 | return right; |
| 80 | |
} |
| 81 | |
@@ -197,10 +197,10 @@
@Override |
| 97 | |
public int hashCode() { |
-
| 98 | 25482 | int hash = 3; |
-
| 99 | 25482 | hash = 53 * hash + (this.left != null ? this.left.hashCode() : 0); |
-
| 100 | 25482 | hash = 53 * hash + (this.right != null ? this.right.hashCode() : 0); |
-
| 101 | 25482 | return hash; |
+
| 98 | 25591 | int hash = 3; |
+
| 99 | 25591 | hash = 53 * hash + (this.left != null ? this.left.hashCode() : 0); |
+
| 100 | 25591 | hash = 53 * hash + (this.right != null ? this.right.hashCode() : 0); |
+
| 101 | 25591 | return hash; |
| 102 | |
} |
| 103 | |
@@ -245,6 +245,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html
index 3dad1ae79..646df6068 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html
@@ -125,7 +125,7 @@
|
| 56 | |
public static boolean containsUrl(String text) { |
-
| 57 | 18330 | return CONTAINS_URL_TEST.matcher(text).matches(); |
+
| 57 | 18241 | return CONTAINS_URL_TEST.matcher(text).matches(); |
| 58 | |
} |
| 59 | |
@@ -222,6 +222,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.License.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.License.html
index 654a9a36c..722290a8f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.License.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.License.html
@@ -266,6 +266,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.Model.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.Model.html
index 19023dac0..fce53943f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.Model.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.Model.html
@@ -476,7 +476,7 @@
|
| 243 | |
|
-
| 244 | 23 | private List<License> licenses = new ArrayList<License>(); |
+
| 244 | 23 | private final List<License> licenses = new ArrayList<License>(); |
| 245 | |
|
| 246 | |
@@ -665,6 +665,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomHandler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomHandler.html
index e53cbca9f..ec6070b15 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomHandler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomHandler.html
@@ -176,7 +176,7 @@
|
| 80 | |
|
-
| 81 | 2 | private Model model = new Model(); |
+
| 81 | 2 | private final Model model = new Model(); |
| 82 | |
|
| 83 | |
@@ -354,6 +354,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomParseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomParseException.html
index d43ca6e4a..391983240 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomParseException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomParseException.html
@@ -147,6 +147,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomParser.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomParser.html
index d99e714a2..e89cbf190 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomParser.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomParser.html
@@ -211,6 +211,6 @@
} |
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomUtils.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomUtils.html
index 9c0e7a28a..d042128d3 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomUtils.html
@@ -212,6 +212,6 @@
} |
-
+
diff --git a/dependency-check-core/cpd.html b/dependency-check-core/cpd.html
index e2d5a5dda..8d7a113cc 100644
--- a/dependency-check-core/cpd.html
+++ b/dependency-check-core/cpd.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core – CPD Results
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
-
| Last Published: 2015-12-10
+
| Last Published: 2016-01-31
- Version: 1.3.3
+ Version: 1.3.4
@@ -246,7 +246,7 @@
CPD Results
-
The following document contains the results of PMD's CPD 5.3.2.
+
The following document contains the results of PMD's CPD 5.3.5.