File tree 5 files changed +24
-10
lines changed
main/java/crypto/analysis
HeadlessJavaScanner/src/main/java/de/fraunhofer/iem/scanner
5 files changed +24
-10
lines changed Original file line number Diff line number Diff line change 120
120
<version >3.17.0</version >
121
121
<scope >test</scope >
122
122
</dependency >
123
+ <dependency >
124
+ <groupId >org.bouncycastle</groupId >
125
+ <artifactId >bcprov-jdk18on</artifactId >
126
+ <version >1.80</version >
127
+ <scope >test</scope >
128
+ </dependency >
123
129
<dependency >
124
130
<groupId >com.google.crypto.tink</groupId >
125
131
<artifactId >tink</artifactId >
Original file line number Diff line number Diff line change 25
25
import crypto .predicates .PredicateAnalysis ;
26
26
import crysl .CrySLParser ;
27
27
import crysl .rule .CrySLRule ;
28
+ import java .io .File ;
28
29
import java .io .IOException ;
30
+ import java .nio .file .Path ;
29
31
import java .util .ArrayList ;
30
32
import java .util .Collection ;
31
33
import java .util .HashMap ;
@@ -55,9 +57,21 @@ public CryptoScanner() {
55
57
}
56
58
57
59
public final Collection <CrySLRule > readRules (String rulesetPath ) {
60
+ return readRules (rulesetPath , "" );
61
+ }
62
+
63
+ public final Collection <CrySLRule > readRules (String rulesetPath , String classPath ) {
58
64
try {
59
- CrySLParser parser = new CrySLParser ();
60
- return parser .parseRulesFromDirectory (rulesetPath );
65
+ if (classPath .isEmpty ()) {
66
+ CrySLParser parser = new CrySLParser ();
67
+ return parser .parseRulesFromPath (rulesetPath );
68
+ } else {
69
+ Collection <String > pathSplits = Set .of (classPath .split (File .pathSeparator ));
70
+ Collection <Path > paths = pathSplits .stream ().map (Path ::of ).toList ();
71
+
72
+ CrySLParser parser = new CrySLParser (paths );
73
+ return parser .parseRulesFromPath (rulesetPath );
74
+ }
61
75
} catch (IOException e ) {
62
76
throw new CryptoAnalysisException ("Could not read rules: " + e .getMessage ());
63
77
}
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ public void beforeTestCaseExecution() {
103
103
scanner .addResultsListener (resultsListener );
104
104
105
105
scanner .scan (frameworkScope , rules );
106
+ scanner .reset ();
106
107
107
108
// Evaluate results
108
109
Collection <Assertion > unsound = new ArrayList <>();
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ public int getTimeout() {
79
79
public void scan () {
80
80
// Read rules
81
81
LOGGER .info ("Reading rules from {}" , settings .getRulesetPath ());
82
- Collection <CrySLRule > rules = super . readRules (settings .getRulesetPath ());
82
+ Collection <CrySLRule > rules = readRules (settings .getRulesetPath (), settings . getSootPath ());
83
83
LOGGER .info ("Found {} rules in {}" , rules .size (), settings .getRulesetPath ());
84
84
85
85
// Initialize the reporters before the analysis to catch errors early
Original file line number Diff line number Diff line change 110
110
<artifactId >slf4j-simple</artifactId >
111
111
<version >2.0.17</version >
112
112
</dependency >
113
- <dependency >
114
- <groupId >org.bouncycastle</groupId >
115
- <artifactId >bcprov-jdk18on</artifactId >
116
- <version >1.80</version >
117
- <scope >test</scope >
118
- </dependency >
119
113
</dependencies >
120
114
121
115
<build >
130
124
<ignoredUnusedDeclaredDependencies >
131
125
<!-- The logger api requires a concrete provider that is not used by this project: https://www.slf4j.org/manual.html -->
132
126
<ignoredUnusedDeclaredDependency >org.slf4j:slf4j-simple</ignoredUnusedDeclaredDependency >
133
- <ignoredUnusedDeclaredDependencies >org.bouncycastle:bcprov-jdk18on</ignoredUnusedDeclaredDependencies >
134
127
</ignoredUnusedDeclaredDependencies >
135
128
</configuration >
136
129
<executions >
You can’t perform that action at this time.
0 commit comments