aboutsummaryrefslogtreecommitdiff
path: root/src/cz/crcs/ectester/reader/test/CardCompositeCurvesSuite.java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/cz/crcs/ectester/reader/test/CardCompositeCurvesSuite.java (renamed from src/cz/crcs/ectester/reader/test/CompositeCurvesSuite.java)14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cz/crcs/ectester/reader/test/CompositeCurvesSuite.java b/src/cz/crcs/ectester/reader/test/CardCompositeCurvesSuite.java
index 2e711a2..930a0d0 100644
--- a/src/cz/crcs/ectester/reader/test/CompositeCurvesSuite.java
+++ b/src/cz/crcs/ectester/reader/test/CardCompositeCurvesSuite.java
@@ -17,9 +17,9 @@ import static cz.crcs.ectester.common.test.Result.ExpectedValue;
/**
* @author Jan Jancar johny@neuromancer.sk
*/
-public class CompositeCurvesSuite extends TestSuite {
+public class CardCompositeCurvesSuite extends CardTestSuite {
- public CompositeCurvesSuite(EC_Store dataStore, ECTesterReader.Config cfg) {
+ public CardCompositeCurvesSuite(EC_Store dataStore, ECTesterReader.Config cfg) {
super(dataStore, cfg, "composite", "The composite suite tests ECDH over curves with composite order. This should generally fail, as using such a curve is unsafe.");
}
@@ -41,12 +41,12 @@ public class CompositeCurvesSuite extends TestSuite {
continue;
}
if ((curve.getBits() == cfg.bits || cfg.all)) {
- tests.add(new SimpleTest(new Command.Allocate(cardManager, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS));
- tests.add(new SimpleTest(new Command.Set(cardManager, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.ANY));
- tests.add(new SimpleTest(new Command.Generate(cardManager, ECTesterApplet.KEYPAIR_LOCAL), ExpectedValue.ANY));
+ tests.add(CommandTest.expect(new Command.Allocate(cardManager, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS));
+ tests.add(CommandTest.expect(new Command.Set(cardManager, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.ANY));
+ tests.add(CommandTest.expect(new Command.Generate(cardManager, ECTesterApplet.KEYPAIR_LOCAL), ExpectedValue.ANY));
Command ecdhCommand = new Command.ECDH_direct(cardManager, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.CORRUPTION_NONE, EC_Consts.KA_ECDH, key.flatten());
- tests.add(new SimpleTest(ecdhCommand, ExpectedValue.FAILURE, "Card correctly rejected to do ECDH over a composite order curve.", "Card incorrectly does ECDH over a composite order curve, leaks bits of private key."));
- tests.add(new SimpleTest(new Command.Cleanup(cardManager), ExpectedValue.ANY));
+ tests.add(CommandTest.expect(ecdhCommand, ExpectedValue.FAILURE, "Card correctly rejected to do ECDH over a composite order curve.", "Card incorrectly does ECDH over a composite order curve, leaks bits of private key."));
+ tests.add(CommandTest.expect(new Command.Cleanup(cardManager), ExpectedValue.ANY));
}
}
}