Skip to content

Commit

Permalink
Revert "Added false negatives as per issue #215"
Browse files Browse the repository at this point in the history
This reverts commit eeb430b.
  • Loading branch information
rakshitkr committed Feb 7, 2020
1 parent 5b62a4e commit 128c74f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void testBCSymmetricCipherExamples() {
MavenProject mavenProject = createAndCompile(mavenProjectPath);
HeadlessCryptoScanner scanner = createScanner(mavenProject, Ruleset.BouncyCastle);

setErrorsCount(RequiredPredicateError.class, new TruePositives(2), new FalseNegatives(1, "https://github.com/CROSSINGTUD/CryptoAnalysis/issues/216"), "<gcm_aes_example.GCMAESBouncyCastle: byte[] processing(byte[],boolean)>");
setErrorsCount(RequiredPredicateError.class, new TruePositives(2), new FalseNegatives(1, "UNKNOWN"), "<gcm_aes_example.GCMAESBouncyCastle: byte[] processing(byte[],boolean)>");
setErrorsCount("<cbc_aes_example.CBCAESBouncyCastle: void setKey(byte[])>", RequiredPredicateError.class, 1);
setErrorsCount("<cbc_aes_example.CBCAESBouncyCastle: byte[] processing(byte[],boolean)>", RequiredPredicateError.class, 1);

Expand Down Expand Up @@ -111,7 +111,7 @@ public void testBCEllipticCurveExamples() {
HeadlessCryptoScanner scanner = createScanner(mavenProject, Ruleset.BouncyCastle);

setErrorsCount(new ErrorSpecification.Builder("<crypto.ECElGamalEncryptorTest: void testOne()>")
.withFNs(RequiredPredicateError.class, 2, "https://github.com/CROSSINGTUD/CryptoAnalysis/issues/216")
.withTPs(RequiredPredicateError.class, 1)
.build());
setErrorsCount(new ErrorSpecification.Builder("<crypto.ECElGamalEncryptorTest: void testTwo()>")
.withTPs(TypestateError.class, 1)
Expand Down Expand Up @@ -144,11 +144,9 @@ public void testBCEllipticCurveExamples() {
.build());
setErrorsCount(new ErrorSpecification.Builder("<params.ParametersWithRandomTest: void testOne(java.lang.String)>")
.withTPs(RequiredPredicateError.class, 2)
.withFNs(RequiredPredicateError.class, 1, "https://github.com/CROSSINGTUD/CryptoAnalysis/issues/216")
.build());
setErrorsCount(new ErrorSpecification.Builder("<params.ParametersWithRandomTest: void testThree(java.lang.String)>")
.withTPs(RequiredPredicateError.class, 3)
.withFNs(RequiredPredicateError.class, 1, "https://github.com/CROSSINGTUD/CryptoAnalysis/issues/216")
.build());
setErrorsCount(new ErrorSpecification.Builder("<params.ECDomainParametersTest: void testThree(java.lang.String)>")
.withTPs(RequiredPredicateError.class, 1)
Expand Down Expand Up @@ -186,7 +184,6 @@ public void testBCEllipticCurveExamples() {
setErrorsCount(new ErrorSpecification.Builder("<transforms.ECNewPublicKeyTransformTest: void testFour(java.lang.String)>")
.withTPs(IncompleteOperationError.class, 1)
.withTPs(RequiredPredicateError.class, 2)
.withFNs(RequiredPredicateError.class, 1, "https://github.com/CROSSINGTUD/CryptoAnalysis/issues/216")
.build());
setErrorsCount(new ErrorSpecification.Builder("<transforms.ECNewPublicKeyTransformTest: void testFive(java.lang.String)>")
.withTPs(RequiredPredicateError.class, 2)
Expand All @@ -204,18 +201,12 @@ public void testBCEllipticCurveExamples() {
setErrorsCount(new ErrorSpecification.Builder("<transforms.ECNewRandomessTransformTest: void testFour(java.lang.String)>")
.withTPs(IncompleteOperationError.class, 1)
.withTPs(RequiredPredicateError.class, 2)
.withFNs(RequiredPredicateError.class, 1, "https://github.com/CROSSINGTUD/CryptoAnalysis/issues/216")
.build());
setErrorsCount(new ErrorSpecification.Builder("<transforms.ECNewRandomessTransformTest: void testFive(java.lang.String)>")
.withTPs(RequiredPredicateError.class, 2)
.withFNs(RequiredPredicateError.class, 1, "https://github.com/CROSSINGTUD/CryptoAnalysis/issues/216")
.build());
setErrorsCount(new ErrorSpecification.Builder("<transforms.ECNewRandomessTransformTest: void testSix(java.lang.String)>")
.withFNs(RequiredPredicateError.class, 1, "https://github.com/CROSSINGTUD/CryptoAnalysis/issues/216")
.build());
setErrorsCount(new ErrorSpecification.Builder("<transforms.ECNewRandomessTransformTest: void testTwo(java.lang.String)>")
.withTPs(RequiredPredicateError.class, 2)
.withFNs(RequiredPredicateError.class, 1, "https://github.com/CROSSINGTUD/CryptoAnalysis/issues/216")
.build());
setErrorsCount(new ErrorSpecification.Builder("<transforms.ECNewRandomessTransformTest: void testOne(java.lang.String)>")
.withTPs(RequiredPredicateError.class, 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public int getTotalNumberOfFindings() {
int totalFindings = 0;
totalFindings += truePositives == null ? 0 : truePositives.size();
totalFindings += falsePositives == null ? 0 : falsePositives.size();
totalFindings += falseNegatives == null ? 0 : falseNegatives.size();
if (totalFindings == 0)
throw new IllegalArgumentException("Specify atleast one findings type.");
return totalFindings;
Expand Down

0 comments on commit 128c74f

Please sign in to comment.