From f3770761748b454222b1a0d8c3a94ec8b5ecae63 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 30 Jun 2022 03:32:29 -0400 Subject: [PATCH 1/6] refactor slightly (ensure): Don't repeat "$src/$fn" and "$dst/$fn"; instead, compute them once as "$src" and "$dst", respectively. --- contrib/gana-update.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/gana-update.sh b/contrib/gana-update.sh index 121980273..e16c67413 100755 --- a/contrib/gana-update.sh +++ b/contrib/gana-update.sh @@ -17,13 +17,13 @@ ensure () # $2 -- src dir under contrib/ # $3 -- dst dir under ./ fn="$1" - src="contrib/$2" - dst="./$3" + src="contrib/$2/$fn" + dst="./$3/$fn" - if ! diff $src/$fn $dst/$fn > /dev/null + if ! diff $src $dst > /dev/null then - cp $src/$fn $dst/$fn - chmod -w $dst/$fn + cp $src $dst + chmod -w $dst fi } From 4cf70435b27fbe16a539e4d39ae0c745941f4d1c Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 30 Jun 2022 03:34:54 -0400 Subject: [PATCH 2/6] fix portability bug: make sure destination file is writeable Some shells let this go w/o comment, some don't. Better to be sure. (ensure): If "$dst" exists, make sure it is writeable. --- contrib/gana-update.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/gana-update.sh b/contrib/gana-update.sh index e16c67413..b20bbaa1d 100755 --- a/contrib/gana-update.sh +++ b/contrib/gana-update.sh @@ -22,6 +22,7 @@ ensure () if ! diff $src $dst > /dev/null then + test ! -f $dst || chmod +w $dst cp $src $dst chmod -w $dst fi From aba04fe6beed9f53b346843325903194eab57c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Thu, 30 Jun 2022 10:34:18 +0200 Subject: [PATCH 3/6] -added comment with pointer to issue 7267 --- src/exchange/taler-exchange-httpd_db.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/exchange/taler-exchange-httpd_db.c b/src/exchange/taler-exchange-httpd_db.c index f0c551398..6f0fc41c9 100644 --- a/src/exchange/taler-exchange-httpd_db.c +++ b/src/exchange/taler-exchange-httpd_db.c @@ -61,7 +61,8 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, NULL); return GNUNET_DB_STATUS_HARD_ERROR; case TALER_EXCHANGEDB_CKS_DENOM_CONFLICT: - /* FIXME-Oec: insufficient_funds != denom conflict! */ + /* FIXME: insufficient_funds != denom conflict! See issue 0007267, need new + * strategy for evidence gathering */ *mhd_ret = TEH_RESPONSE_reply_coin_insufficient_funds ( connection, TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_DENOMINATION_KEY, @@ -69,7 +70,8 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, &coin->coin_pub); return GNUNET_DB_STATUS_HARD_ERROR; case TALER_EXCHANGEDB_CKS_AGE_CONFLICT: - /* FIXME-Oec: insufficient_funds != Age conflict! */ + /* FIXME: insufficient_funds != Age conflict! See issue 0007267, need new + * strategy for evidence gathering */ *mhd_ret = TEH_RESPONSE_reply_coin_insufficient_funds ( connection, TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_AGE_HASH, From e0e69fd72e804e14b4f2ef497b3b0fb2661ec2ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Thu, 30 Jun 2022 11:14:33 +0200 Subject: [PATCH 4/6] -new error codes for purse deposit failures --- contrib/gana | 2 +- src/exchange/taler-exchange-httpd_common_deposit.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/gana b/contrib/gana index ce57f1bb3..cf9e9f70a 160000 --- a/contrib/gana +++ b/contrib/gana @@ -1 +1 @@ -Subproject commit ce57f1bb32a657c0e479a13401339c9899b1c898 +Subproject commit cf9e9f70ae04da02be8d11fde5668e2ef72adc57 diff --git a/src/exchange/taler-exchange-httpd_common_deposit.c b/src/exchange/taler-exchange-httpd_common_deposit.c index cfa15fccb..7e9774208 100644 --- a/src/exchange/taler-exchange-httpd_common_deposit.c +++ b/src/exchange/taler-exchange-httpd_common_deposit.c @@ -224,13 +224,13 @@ TEH_common_deposit_check_purse_deposit ( GNUNET_break_op (0); return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - /* FIXME: other error code? */ - TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_AGE_HASH, + TALER_EC_EXCHANGE_PURSE_DEPOSIT_COIN_CONFLICTING_ATTEST_VS_AGE_COMMITMENT, "mismatch of attest and age_commitment"); } if (coin->cpi.no_age_commitment) return GNUNET_OK; /* unrestricted coin */ + /* age attestation must be valid */ if (GNUNET_OK != TALER_age_commitment_verify (&coin->age_commitment, @@ -241,7 +241,7 @@ TEH_common_deposit_check_purse_deposit ( return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, /* FIXME: other error code? */ - TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_AGE_HASH, + TALER_EC_EXCHANGE_PURSE_DEPOSIT_COIN_AGE_ATTESTATION_FAILURE, "invalid attest for minimum age"); } return GNUNET_OK; @@ -259,7 +259,7 @@ TEH_common_purse_deposit_free_coin (struct TEH_PurseDepositedCoin *coin) { TALER_denom_sig_free (&coin->cpi.denom_sig); if (! coin->cpi.no_age_commitment) - TALER_age_commitment_free (&coin->age_commitment); + GNUNET_free (coin->age_commitment.keys); /* Only the keys have been allocated */ } From 636691e1092c00174b2809da1c91d952febc72cf Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 30 Jun 2022 09:13:45 -0300 Subject: [PATCH 5/6] fix: /wire was replying double 'Access-Control-Allow-Origin' header and browsers complain --- src/exchange/taler-exchange-httpd_wire.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/exchange/taler-exchange-httpd_wire.c b/src/exchange/taler-exchange-httpd_wire.c index ce8293c9a..fbc3d5e67 100644 --- a/src/exchange/taler-exchange-httpd_wire.c +++ b/src/exchange/taler-exchange-httpd_wire.c @@ -400,8 +400,8 @@ build_wire_state (void) wsh->http_status = MHD_HTTP_INTERNAL_SERVER_ERROR; wsh->wire_reply = TALER_MHD_make_error ( - TALER_EC_EXCHANGE_WIRE_INVALID_PAYTO_CONFIGURED, - payto_uri); + TALER_EC_EXCHANGE_WIRE_INVALID_PAYTO_CONFIGURED, + payto_uri); json_decref (wire_accounts_array); json_decref (wire_fee_object); GNUNET_CRYPTO_hash_context_abort (hc); @@ -482,7 +482,6 @@ build_wire_state (void) MHD_HTTP_HEADER_EXPIRES, wsh->dat)); } - TALER_MHD_add_global_headers (wsh->wire_reply); /* Set cache control headers: our response varies depending on these headers */ GNUNET_break (MHD_YES == MHD_add_response_header (wsh->wire_reply, From 21551bb4c3c887fdcfb3d814c8ab4d1a4ec82945 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 30 Jun 2022 16:06:46 +0200 Subject: [PATCH 6/6] -also add public key for auditor for revoke-basedb.conf --- src/auditor/revoke-basedb.conf | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/auditor/revoke-basedb.conf b/src/auditor/revoke-basedb.conf index e1c55523e..5209cc2ce 100644 --- a/src/auditor/revoke-basedb.conf +++ b/src/auditor/revoke-basedb.conf @@ -1,11 +1,8 @@ [auditor] -DB = postgres +PUBLIC_KEY = CK4P6P5VXR82B1A4C3PY5DCHG8HDZA1HSZR76Z8D6FD57MASFT70 TINY_AMOUNT = TESTKUDOS:0.01 BASE_URL = http://localhost:8083/ -# Where do we store the auditor's private key? -AUDITOR_PRIV_FILE = ${TALER_DATA_HOME}/auditor/offline-keys/auditor.priv - [exchange-account-1] PAYTO_URI = payto://x-taler-bank/localhost/Exchange enable_debit = yes