[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: misc fixes
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: misc fixes |
Date: |
Sun, 28 Feb 2021 19:52:00 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new 993bafd misc fixes
993bafd is described below
commit 993bafd8c7eb8d59ce61bdf0f61af353abdcf71d
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Feb 28 19:51:58 2021 +0100
misc fixes
---
src/cli/test_anastasis_reducer_enter_secret.sh | 54 ++++++++++++--------------
src/reducer/anastasis_api_backup_redux.c | 23 +++++++++--
src/restclient/anastasis_api_truth_store.c | 10 +++--
3 files changed, 50 insertions(+), 37 deletions(-)
diff --git a/src/cli/test_anastasis_reducer_enter_secret.sh
b/src/cli/test_anastasis_reducer_enter_secret.sh
index cf71bed..084ade1 100755
--- a/src/cli/test_anastasis_reducer_enter_secret.sh
+++ b/src/cli/test_anastasis_reducer_enter_secret.sh
@@ -106,7 +106,7 @@ rm -rf $DATA_DIR
MASTER_PRIV_FILE=`taler-config -f -c $CONF -s EXCHANGE -o MASTER_PRIV_FILE`
MASTER_PRIV_DIR=`dirname $MASTER_PRIV_FILE`
mkdir -p $MASTER_PRIV_DIR
-gnunet-ecc -g1 $MASTER_PRIV_FILE > /dev/null
+gnunet-ecc -g1 $MASTER_PRIV_FILE > /dev/null 2> /dev/null
MASTER_PUB=`gnunet-ecc -p $MASTER_PRIV_FILE`
EXCHANGE_URL=`taler-config -c $CONF -s EXCHANGE -o BASE_URL`
MERCHANT_PORT=`taler-config -c $CONF -s MERCHANT -o PORT`
@@ -117,7 +117,7 @@ AUDITOR_URL=http://localhost:8083/
AUDITOR_PRIV_FILE=`taler-config -f -c $CONF -s AUDITOR -o AUDITOR_PRIV_FILE`
AUDITOR_PRIV_DIR=`dirname $AUDITOR_PRIV_FILE`
mkdir -p $AUDITOR_PRIV_DIR
-gnunet-ecc -g1 $AUDITOR_PRIV_FILE > /dev/null
+gnunet-ecc -g1 $AUDITOR_PRIV_FILE > /dev/null 2> /dev/null
AUDITOR_PUB=`gnunet-ecc -p $AUDITOR_PRIV_FILE`
# patch configuration
@@ -139,6 +139,7 @@ echo -n "Setting up exchange ..."
dropdb $TALER_DB >/dev/null 2>/dev/null || true
createdb $TALER_DB || exit_skip "Could not create database $TALER_DB"
taler-exchange-dbinit -c $CONF
+taler-merchant-dbinit -c $CONF
taler-auditor-dbinit -c $CONF
taler-auditor-exchange -c $CONF -m $MASTER_PUB -u $EXCHANGE_URL
@@ -146,24 +147,17 @@ echo " OK"
# Launch services
echo -n "Launching taler services ..."
-taler-bank-manage-testing $CONF postgres:///$TALER_DB serve &
-TFN=`which taler-exchange-httpd`
-TBINPFX=`dirname $TFN`
-TLIBEXEC=${TBINPFX}/../lib/taler/libexec/
-$TLIBEXEC/taler-helper-crypto-eddsa -c $CONF 2> taler-helper-crypto-eddsa.log &
-SIGNKEY_HELPER_PID=$!
-$TLIBEXEC/taler-helper-crypto-rsa -c $CONF 2> taler-helper-crypto-rsa.log &
-DENOM_HELPER_PID=$!
+taler-bank-manage-testing $CONF postgres:///$TALER_DB serve > taler-bank.log
2> taler-bank.err &
+taler-exchange-secmod-eddsa -c $CONF 2> taler-exchange-secmod-eddsa.log &
+taler-exchange-secmod-rsa -c $CONF 2> taler-exchange-secmod-rsa.log &
taler-exchange-httpd -c $CONF 2> taler-exchange-httpd.log &
-EXCHANGE_PID=$!
taler-merchant-httpd -c $CONF -L INFO 2> taler-merchant-httpd.log &
-MERCHANT_PID=$!
taler-exchange-wirewatch -c $CONF 2> taler-exchange-wirewatch.log &
taler-auditor-httpd -L INFO -c $CONF 2> taler-auditor-httpd.log &
echo " OK"
-echo "Launching anastasis services ..."
+echo -n "Launching anastasis services ..."
PREFIX=valgrind
$PREFIX anastasis-httpd -c $CONF_1 2> anastasis-httpd_1.log &
$PREFIX anastasis-httpd -c $CONF_2 2> anastasis-httpd_2.log &
@@ -177,7 +171,7 @@ do
sleep 0.2
OK=0
# bank
- wget http://localhost:8082/ -o /dev/null -O /dev/null >/dev/null ||
continue
+ wget --tries=1 --timeout=1 http://localhost:8082/ -o /dev/null -O
/dev/null >/dev/null || continue
OK=1
break
done
@@ -194,11 +188,11 @@ do
sleep 0.1
OK=0
# exchange
- wget http://localhost:8081/seed -o /dev/null -O /dev/null >/dev/null ||
continue
+ wget --tries=1 --timeout=1 http://localhost:8081/seed -o /dev/null -O
/dev/null >/dev/null || continue
# merchant
- wget http://localhost:9966/ -o /dev/null -O /dev/null >/dev/null ||
continue
+ wget --tries=1 --timeout=1 http://localhost:9966/ -o /dev/null -O
/dev/null >/dev/null || continue
# auditor
- wget http://localhost:8083/ -o /dev/null -O /dev/null >/dev/null ||
continue
+ wget --tries=1 --timeout=1 http://localhost:8083/ -o /dev/null -O
/dev/null >/dev/null || continue
OK=1
break
done
@@ -210,9 +204,10 @@ fi
echo "OK"
-echo -n "Setting up keys"
+echo -n "Setting up keys ..."
taler-exchange-offline -c $CONF \
- download sign \
+ download \
+ sign \
enable-account payto://x-taler-bank/localhost/Exchange \
enable-auditor $AUDITOR_PUB $AUDITOR_URL "TESTKUDOS Auditor" \
wire-fee now x-taler-bank TESTKUDOS:0.01 TESTKUDOS:0.01 \
@@ -220,11 +215,11 @@ taler-exchange-offline -c $CONF \
echo -n "."
-for n in `seq 1 2`
+for n in `seq 1 3`
do
echo -n "."
OK=0
- wget --timeout=1 http://localhost:8081/keys -o /dev/null -O /dev/null
>/dev/null || continue
+ wget --tries=1 --timeout=1 http://localhost:8081/keys -o /dev/null -O
/dev/null >/dev/null || continue
OK=1
break
done
@@ -234,10 +229,11 @@ then
exit_skip "Failed to setup keys"
fi
-echo "Setting up auditor signatures ..."
+echo " OK"
+
+echo -n "Setting up auditor signatures ..."
taler-auditor-offline -c $CONF \
download sign upload &> taler-auditor-offline.log
-
echo " OK"
echo -n "Waiting for anastasis services ..."
@@ -249,13 +245,13 @@ do
sleep 0.1
OK=0
# anastasis_01
- wget http://localhost:8086/ -o /dev/null -O /dev/null >/dev/null ||
continue
+ wget --tries=1 --timeout=1 http://localhost:8086/ -o /dev/null -O
/dev/null >/dev/null || continue
# anastasis_02
- wget http://localhost:8087/ -o /dev/null -O /dev/null >/dev/null ||
continue
+ wget --tries=1 --timeout=1 http://localhost:8087/ -o /dev/null -O
/dev/null >/dev/null || continue
# anastasis_03
- wget http://localhost:8088/ -o /dev/null -O /dev/null >/dev/null ||
continue
+ wget --tries=1 --timeout=1 http://localhost:8088/ -o /dev/null -O
/dev/null >/dev/null || continue
# anastasis_04
- wget http://localhost:8089/ -o /dev/null -O /dev/null >/dev/null ||
continue
+ wget --tries=1 --timeout=1 http://localhost:8089/ -o /dev/null -O
/dev/null >/dev/null || continue
OK=1
break
done
@@ -264,10 +260,8 @@ if [ 1 != $OK ]
then
exit_skip "Failed to launch anastasis services"
fi
-
echo "OK"
-
echo -n "Configuring merchant instance ..."
# Setup merchant
@@ -283,7 +277,7 @@ echo -e $COLOR$BOLD"Test enter secret in a backup state
..."$NORM$NOCOLOR
PREFIX anastasis-reducer -a \
'{"secret": "veryhardtoguesssecret",
"type": "password"}' \
- enter_secret $SFILE $TFILE
+ enter_secret resources/06-backup.json $TFILE
STATE=`jq -r -e .backup_state < $TFILE`
if test "$STATE" != "POLICIES_PAYING"
diff --git a/src/reducer/anastasis_api_backup_redux.c
b/src/reducer/anastasis_api_backup_redux.c
index dc84b0e..691abd7 100644
--- a/src/reducer/anastasis_api_backup_redux.c
+++ b/src/reducer/anastasis_api_backup_redux.c
@@ -1285,6 +1285,7 @@ upload_cancel_cb (void *cls)
}
GNUNET_free (tue->provider_url);
GNUNET_free (tue->payment_request);
+ GNUNET_free (tue->policies);
GNUNET_free (tue);
}
if (NULL != uc->ss)
@@ -1721,11 +1722,15 @@ truth_upload_cb (void *cls,
tue->tu = NULL;
tue->t = t;
- tue->ec = ud->ec;
- if (ANASTASIS_US_PAYMENT_REQUIRED == ud->us)
+ if (NULL != ud)
{
- tue->payment_request = GNUNET_strdup (ud->details.payment.payment_request);
- tue->ps = ud->details.payment.ps;
+ tue->ec = ud->ec;
+ if (ANASTASIS_US_PAYMENT_REQUIRED == ud->us)
+ {
+ tue->payment_request = GNUNET_strdup (
+ ud->details.payment.payment_request);
+ tue->ps = ud->details.payment.ps;
+ }
}
check_upload_finished (tue->uc);
}
@@ -1896,8 +1901,17 @@ check_truth_upload (struct UploadContext *uc,
NULL, NULL))
{
GNUNET_break (0);
+ GNUNET_free (tue);
return GNUNET_SYSERR;
}
+ GNUNET_CONTAINER_DLL_insert (uc->tues_head,
+ uc->tues_tail,
+ tue);
+ tue->uc = uc;
+ tue->policies = GNUNET_new (struct PolicyMethodReference);
+ *tue->policies = *pmr;
+ tue->provider_url = GNUNET_strdup (provider_url);
+ tue->policies_length = 1;
if (GNUNET_OK !=
lookup_salt (uc->state,
provider_url,
@@ -2157,6 +2171,7 @@ enter_secret (json_t *state,
"core_secret",
GNUNET_JSON_from_data (secret,
secret_size)));
+ GNUNET_JSON_parse_free (spec);
return upload (state,
cb,
cb_cls);
diff --git a/src/restclient/anastasis_api_truth_store.c
b/src/restclient/anastasis_api_truth_store.c
index 84af415..3405555 100644
--- a/src/restclient/anastasis_api_truth_store.c
+++ b/src/restclient/anastasis_api_truth_store.c
@@ -243,7 +243,7 @@ ANASTASIS_truth_store (
struct GNUNET_CURL_Context *ctx,
const char *backend_url,
const struct ANASTASIS_CRYPTO_TruthUUIDP *uuid,
- const char *method,
+ const char *type,
const struct ANASTASIS_CRYPTO_EncryptedKeyShareP *encrypted_keyshare,
const char *truth_mime,
size_t encrypted_truth_size,
@@ -306,14 +306,18 @@ ANASTASIS_truth_store (
"keyshare_data",
GNUNET_JSON_from_data_auto (encrypted_keyshare),
"type",
- method,
+ type,
"encrypted_truth",
GNUNET_JSON_from_data (encrypted_truth,
encrypted_truth_size),
"truth_mime",
- truth_mime);
+ (NULL != truth_mime)
+ ? truth_mime
+ : "");
+ GNUNET_assert (NULL != truth_data);
json_str = json_dumps (truth_data,
JSON_COMPACT);
+ GNUNET_assert (NULL != json_str);
json_decref (truth_data);
}
tso->ctx = ctx;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.