gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] 01/02: another fix where hardcoded serial number can po


From: gnunet
Subject: [taler-exchange] 01/02: another fix where hardcoded serial number can point to the wrong transaction
Date: Tue, 24 Dec 2019 23:00:17 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

commit 3a9d7afe33cad8bb60e72b8299a75b8275517a6e
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue Dec 24 22:53:13 2019 +0100

    another fix where hardcoded serial number can point to the wrong transaction
---
 src/auditor/test-auditor.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh
index 032f7d0e..325b207c 100755
--- a/src/auditor/test-auditor.sh
+++ b/src/auditor/test-auditor.sh
@@ -437,14 +437,15 @@ echo "UPDATE deposits SET wire='$OLD_WIRE' WHERE 
deposit_serial_id=${SERIAL}" |
 function test_5() {
 echo "===========5: deposit contract hash wrong================="
 # Modify h_wire hash, so it is inconsistent with 'wire'
-OLD_H=`echo 'SELECT h_contract_terms FROM deposits WHERE deposit_serial_id=1;' 
 | psql $DB -Aqt`
-echo "UPDATE deposits SET 
h_contract_terms='\x12bb676444955c98789f219148aa31899d8c354a63330624d3d143222cf3bb8b8e16f69accd5a8773127059b804c1955696bf551dd7be62719870613332aa8d5'
 WHERE deposit_serial_id=1" | psql -Aqt $DB
+SERIAL=`echo "SELECT deposit_serial_id FROM deposits WHERE 
amount_with_fee_val=0 AND amount_with_fee_frac=10000000 ORDER BY 
deposit_serial_id LIMIT 1" | psql $DB -Aqt`
+OLD_H=`echo "SELECT h_contract_terms FROM deposits WHERE 
deposit_serial_id=$SERIAL;" | psql $DB -Aqt`
+echo "UPDATE deposits SET 
h_contract_terms='\x12bb676444955c98789f219148aa31899d8c354a63330624d3d143222cf3bb8b8e16f69accd5a8773127059b804c1955696bf551dd7be62719870613332aa8d5'
 WHERE deposit_serial_id=$SERIAL" | psql -Aqt $DB
 
 run_audit
 
 echo -n "Checking bad signature detection... "
 ROW=`jq -e .bad_sig_losses[0].row < test-audit.json`
-if test $ROW != 1
+if test $ROW != $SERIAL
 then
     exit_fail "Row wrong, got $ROW"
 fi
@@ -469,7 +470,7 @@ fi
 echo PASS
 
 # Undo:
-echo "UPDATE deposits SET h_contract_terms='${OLD_H}' WHERE 
deposit_serial_id=1" | psql -Aqt $DB
+echo "UPDATE deposits SET h_contract_terms='${OLD_H}' WHERE 
deposit_serial_id=$SERIAL" | psql -Aqt $DB
 
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]