aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-cli
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-cli')
-rw-r--r--packages/taler-wallet-cli/src/harness/denomStructures.ts43
-rw-r--r--packages/taler-wallet-cli/src/harness/harness.ts22
-rw-r--r--packages/taler-wallet-cli/src/integrationtests/test-fee-regression.ts1
-rw-r--r--packages/taler-wallet-cli/src/integrationtests/test-revocation.ts3
-rw-r--r--packages/taler-wallet-cli/src/integrationtests/testrunner.ts6
5 files changed, 51 insertions, 24 deletions
diff --git a/packages/taler-wallet-cli/src/harness/denomStructures.ts b/packages/taler-wallet-cli/src/harness/denomStructures.ts
index 5ab9aca00..2ca777030 100644
--- a/packages/taler-wallet-cli/src/harness/denomStructures.ts
+++ b/packages/taler-wallet-cli/src/harness/denomStructures.ts
@@ -14,7 +14,7 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-export interface CoinConfig {
+export interface CoinCoinfigCommon {
name: string;
value: string;
durationWithdraw: string;
@@ -24,10 +24,24 @@ export interface CoinConfig {
feeDeposit: string;
feeRefresh: string;
feeRefund: string;
+}
+
+export interface CoinConfigRsa extends CoinCoinfigCommon {
+ cipher: "RSA";
rsaKeySize: number;
}
-const coinCommon = {
+/**
+ * Clause Schnorr coin config.
+ */
+export interface CoinConfigCs extends CoinCoinfigCommon {
+ cipher: "CS";
+}
+
+export type CoinConfig = CoinConfigRsa | CoinConfigCs;
+
+const coinRsaCommon = {
+ cipher: "RSA" as const,
durationLegal: "3 years",
durationSpend: "2 years",
durationWithdraw: "7 days",
@@ -35,7 +49,7 @@ const coinCommon = {
};
export const coin_ct1 = (curr: string): CoinConfig => ({
- ...coinCommon,
+ ...coinRsaCommon,
name: `${curr}_ct1`,
value: `${curr}:0.01`,
feeDeposit: `${curr}:0.00`,
@@ -45,7 +59,7 @@ export const coin_ct1 = (curr: string): CoinConfig => ({
});
export const coin_ct10 = (curr: string): CoinConfig => ({
- ...coinCommon,
+ ...coinRsaCommon,
name: `${curr}_ct10`,
value: `${curr}:0.10`,
feeDeposit: `${curr}:0.01`,
@@ -55,7 +69,7 @@ export const coin_ct10 = (curr: string): CoinConfig => ({
});
export const coin_u1 = (curr: string): CoinConfig => ({
- ...coinCommon,
+ ...coinRsaCommon,
name: `${curr}_u1`,
value: `${curr}:1`,
feeDeposit: `${curr}:0.02`,
@@ -65,7 +79,7 @@ export const coin_u1 = (curr: string): CoinConfig => ({
});
export const coin_u2 = (curr: string): CoinConfig => ({
- ...coinCommon,
+ ...coinRsaCommon,
name: `${curr}_u2`,
value: `${curr}:2`,
feeDeposit: `${curr}:0.02`,
@@ -75,7 +89,7 @@ export const coin_u2 = (curr: string): CoinConfig => ({
});
export const coin_u4 = (curr: string): CoinConfig => ({
- ...coinCommon,
+ ...coinRsaCommon,
name: `${curr}_u4`,
value: `${curr}:4`,
feeDeposit: `${curr}:0.02`,
@@ -85,7 +99,7 @@ export const coin_u4 = (curr: string): CoinConfig => ({
});
export const coin_u8 = (curr: string): CoinConfig => ({
- ...coinCommon,
+ ...coinRsaCommon,
name: `${curr}_u8`,
value: `${curr}:8`,
feeDeposit: `${curr}:0.16`,
@@ -95,7 +109,7 @@ export const coin_u8 = (curr: string): CoinConfig => ({
});
const coin_u10 = (curr: string): CoinConfig => ({
- ...coinCommon,
+ ...coinRsaCommon,
name: `${curr}_u10`,
value: `${curr}:10`,
feeDeposit: `${curr}:0.2`,
@@ -114,16 +128,6 @@ export const defaultCoinConfig = [
coin_u10,
];
-const coinCheapCommon = (curr: string) => ({
- durationLegal: "3 years",
- durationSpend: "2 years",
- durationWithdraw: "7 days",
- rsaKeySize: 1024,
- feeRefresh: `${curr}:0.2`,
- feeRefund: `${curr}:0.2`,
- feeWithdraw: `${curr}:0.2`,
-});
-
export function makeNoFeeCoinConfig(curr: string): CoinConfig[] {
const cc: CoinConfig[] = [];
@@ -134,6 +138,7 @@ export function makeNoFeeCoinConfig(curr: string): CoinConfig[] {
const cent = ct % 100;
cc.push({
+ cipher: "RSA",
durationLegal: "3 years",
durationSpend: "2 years",
durationWithdraw: "7 days",
diff --git a/packages/taler-wallet-cli/src/harness/harness.ts b/packages/taler-wallet-cli/src/harness/harness.ts
index fc155ba6a..fc489327f 100644
--- a/packages/taler-wallet-cli/src/harness/harness.ts
+++ b/packages/taler-wallet-cli/src/harness/harness.ts
@@ -430,7 +430,14 @@ function setCoin(config: Configuration, c: CoinConfig) {
config.setString(s, "fee_withdraw", c.feeWithdraw);
config.setString(s, "fee_refresh", c.feeRefresh);
config.setString(s, "fee_refund", c.feeRefund);
- config.setString(s, "rsa_keysize", `${c.rsaKeySize}`);
+ if (c.cipher === "RSA") {
+ config.setString(s, "rsa_keysize", `${c.rsaKeySize}`);
+ config.setString(s, "cipher", "RSA");
+ } else if (c.cipher === "CS") {
+ config.setString(s, "cipher", "CS");
+ } else {
+ throw new Error();
+ }
}
/**
@@ -1328,6 +1335,7 @@ export class ExchangeService implements ExchangeServiceInterface {
helperCryptoRsaProc: ProcessWrapper | undefined;
helperCryptoEddsaProc: ProcessWrapper | undefined;
+ helperCryptoCsProc: ProcessWrapper | undefined;
constructor(
private globalState: GlobalTestState,
@@ -1373,6 +1381,12 @@ export class ExchangeService implements ExchangeServiceInterface {
await cryptoEddsa.wait();
this.helperCryptoRsaProc = undefined;
}
+ const cryptoCs = this.helperCryptoCsProc;
+ if (cryptoCs) {
+ cryptoCs.proc.kill("SIGTERM");
+ await cryptoCs.wait();
+ this.helperCryptoCsProc = undefined;
+ }
}
/**
@@ -1491,6 +1505,12 @@ export class ExchangeService implements ExchangeServiceInterface {
`exchange-crypto-eddsa-${this.name}`,
);
+ this.helperCryptoCsProc = this.globalState.spawnService(
+ "taler-exchange-secmod-cs",
+ ["-c", this.configFilename, "-LDEBUG", ...this.timetravelArgArr],
+ `exchange-crypto-cs-${this.name}`,
+ );
+
this.helperCryptoRsaProc = this.globalState.spawnService(
"taler-exchange-secmod-rsa",
["-c", this.configFilename, "-LDEBUG", ...this.timetravelArgArr],
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-fee-regression.ts b/packages/taler-wallet-cli/src/integrationtests/test-fee-regression.ts
index d3ff89ae4..aee9fffa0 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-fee-regression.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-fee-regression.ts
@@ -76,6 +76,7 @@ export async function createMyTestkudosEnvironment(
await bank.pingUntilAvailable();
const coinCommon = {
+ cipher: "RSA" as const,
durationLegal: "3 years",
durationSpend: "2 years",
durationWithdraw: "7 days",
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-revocation.ts b/packages/taler-wallet-cli/src/integrationtests/test-revocation.ts
index 87c4d958b..bf35b5382 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-revocation.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-revocation.ts
@@ -27,7 +27,7 @@ import {
setupDb,
BankService,
delayMs,
- getPayto
+ getPayto,
} from "../harness/harness.js";
import {
withdrawViaBank,
@@ -97,6 +97,7 @@ async function createTestEnvironment(
await bank.pingUntilAvailable();
const coin_u1: CoinConfig = {
+ cipher: "RSA" as const,
durationLegal: "3 years",
durationSpend: "2 years",
durationWithdraw: "7 days",
diff --git a/packages/taler-wallet-cli/src/integrationtests/testrunner.ts b/packages/taler-wallet-cli/src/integrationtests/testrunner.ts
index 98aab75c4..844904132 100644
--- a/packages/taler-wallet-cli/src/integrationtests/testrunner.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/testrunner.ts
@@ -14,9 +14,7 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-import {
- minimatch
-} from "@gnu-taler/taler-util";
+import { minimatch } from "@gnu-taler/taler-util";
import {
GlobalTestState,
runTestWithState,
@@ -88,6 +86,7 @@ import { runMerchantSpecPublicOrdersTest } from "./test-merchant-spec-public-ord
import { runExchangeTimetravelTest } from "./test-exchange-timetravel.js";
import { runDenomUnofferedTest } from "./test-denom-unoffered.js";
import { runWithdrawalFakebankTest } from "./test-withdrawal-fakebank.js";
+import { runClauseSchnorrTest } from "./test-clause-schnorr.js";
/**
* Test runner.
@@ -106,6 +105,7 @@ interface TestMainFunction {
const allTests: TestMainFunction[] = [
runBankApiTest,
runClaimLoopTest,
+ runClauseSchnorrTest,
runDepositTest,
runDenomUnofferedTest,
runExchangeManagementTest,