commit 34df06f55f4cc7fc80aec28a28f943c2a58e3f31
parent 0c191015e4dac3e0ccc61a2eee47cacb30d6d970
Author: Florian Dold <florian@dold.me>
Date: Mon, 19 May 2025 13:08:10 +0200
helpers to diagnose #9974
Diffstat:
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts
@@ -26,6 +26,7 @@ import {
assertUnreachable,
codecForList,
codecForString,
+ ContractTermsUtil,
CoreApiResponse,
Duration,
encodeCrock,
@@ -1714,6 +1715,15 @@ advancedCli
});
advancedCli
+ .subcommand("hashContractTerms", "hash-contract-terms")
+ .action(async (args) => {
+ const data = await read(process.stdin);
+ const ct = JSON.parse(data);
+ const ctHash = ContractTermsUtil.hashContractTerms(ct);
+ console.log(ctHash);
+ });
+
+advancedCli
.subcommand("coins", "list-coins", {
help: "List coins.",
})
diff --git a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts
@@ -135,7 +135,16 @@ import {
const logger = new Logger("cryptoImplementation.ts");
-const debugDumpSigs = false;
+let debugDumpSigs = false;
+
+/**
+ * Enable dumping of signature blobs to stderr.
+ *
+ * Global option, must only be used for debugging.
+ */
+export function setDebugDumpSigs(b: boolean) {
+ debugDumpSigs = b;
+}
/**
* Interface for (asynchronous) cryptographic operations that
@@ -1468,6 +1477,13 @@ export const nativeCryptoR: TalerCryptoInterfaceR = {
priv: depositInfo.coinPriv,
});
+ if (debugDumpSigs) {
+ logger.info(
+ `Dumping deposit signature for ct=${depositInfo.contractTermsHash}`,
+ );
+ logger.info(`Deposit signature: ${toHexString(d)}`);
+ }
+
if (depositInfo.denomKeyType === DenomKeyType.Rsa) {
const s: CoinDepositPermission = {
coin_pub: depositInfo.coinPub,