aboutsummaryrefslogtreecommitdiff
path: root/src/credential/test_credential_own.sh
diff options
context:
space:
mode:
authorAndreas Ebner <a.e.bner@web.de>2019-09-20 10:49:02 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-10-07 12:18:20 +0200
commit3099a7c25cf6b11b0f1909e5a2651d65c0e921c7 (patch)
treec8f10fe3551b35e40d6adcb5e1c68771a12a104e /src/credential/test_credential_own.sh
parent5be14856a356b087ad97b479efd9b06172fdfd2f (diff)
downloadgnunet-3099a7c25cf6b11b0f1909e5a2651d65c0e921c7.tar.gz
gnunet-3099a7c25cf6b11b0f1909e5a2651d65c0e921c7.zip
Cleanup TODOs, bugfix in cleanup and start of bidirectional chain resolution:
- removed and/or implemented all remaining TODOs - fixed a bug in cleanup_handle() which caused to not cleanup correctly when a solution was prematurely found - delegation_chain_bw/fw_resolution_start() not has a return value to indicate whether a solution was prematurely found - cleaned up the test_... files (an additional cleanup commit might follow)
Diffstat (limited to 'src/credential/test_credential_own.sh')
-rwxr-xr-xsrc/credential/test_credential_own.sh27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/credential/test_credential_own.sh b/src/credential/test_credential_own.sh
index fa2580a22..b868cdf67 100755
--- a/src/credential/test_credential_own.sh
+++ b/src/credential/test_credential_own.sh
@@ -15,10 +15,6 @@ fi
15 15
16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f` 16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
17 17
18# (1) EPub.discount <- EOrg.preferred
19# (2) EOrg.preferred <- StateU.student
20# (3) StateU.student <- RegistrarB.student
21# (4) RegistrarB.student <- Alice
22 18
23 19
24which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10" 20which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
@@ -35,6 +31,12 @@ EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print
35FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}') 31FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}')
36GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}') 32GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}')
37 33
34############################################################################################
35# (1) EPub.discount <- EOrg.preferred
36# (2) EOrg.preferred <- StateU.student
37# (3) StateU.student <- RegistrarB.student
38# (4) RegistrarB.student <- Alice
39
38gnunet-identity -C epub -c test_credential_lookup.conf 40gnunet-identity -C epub -c test_credential_lookup.conf
39gnunet-identity -C eorg -c test_credential_lookup.conf 41gnunet-identity -C eorg -c test_credential_lookup.conf
40gnunet-identity -C stateu -c test_credential_lookup.conf 42gnunet-identity -C stateu -c test_credential_lookup.conf
@@ -54,7 +56,7 @@ STATE_STUD_ATTR="student"
54REG_STUD_ATTR="student" 56REG_STUD_ATTR="student"
55END_ATTR="end" 57END_ATTR="end"
56 58
57# FORWARD, subject side stored 59# FORWARD, subject side stored (different constallations)
58SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="a" --subject="$AKEY b.c" --ttl="2019-12-12 10:00:00"` 60SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="a" --subject="$AKEY b.c" --ttl="2019-12-12 10:00:00"`
59gnunet-credential --createSubjectSide --ego=a --import "$SIGNED" 61gnunet-credential --createSubjectSide --ego=a --import "$SIGNED"
60gnunet-namestore -D -z a 62gnunet-namestore -D -z a
@@ -99,11 +101,13 @@ gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED" --private
99# Starting to resolve 101# Starting to resolve
100echo "+++ Starting to Resolve +++" 102echo "+++ Starting to Resolve +++"
101 103
104# FORWARD
102#DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=g --forward -c test_credential_lookup.conf | paste -d, -s` 105#DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=g --forward -c test_credential_lookup.conf | paste -d, -s`
103#echo $DELS 106#echo $DELS
104#echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate=\'$DELS\' --forward -c test_credential_lookup.conf 107#echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate=\'$DELS\' --forward -c test_credential_lookup.conf
105#RES_DELS=`gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate="$DELS" --forward -c test_credential_lookup.conf` 108#RES_DELS=`gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate="$DELS" --forward -c test_credential_lookup.conf`
106 109
110# BACKWARD
107DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s` 111DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s`
108echo $DELS 112echo $DELS
109echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --delegate=\'$DELS\' --backward -c test_credential_lookup.conf 113echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --delegate=\'$DELS\' --backward -c test_credential_lookup.conf
@@ -115,15 +119,16 @@ RES=$?
115gnunet-namestore -z epub -d -n $DISC_ATTR -t ATTR -c test_credential_lookup.conf 119gnunet-namestore -z epub -d -n $DISC_ATTR -t ATTR -c test_credential_lookup.conf
116gnunet-namestore -z eorg -d -n $PREF_ATTR -t ATTR -c test_credential_lookup.conf 120gnunet-namestore -z eorg -d -n $PREF_ATTR -t ATTR -c test_credential_lookup.conf
117gnunet-namestore -z stateu -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf 121gnunet-namestore -z stateu -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf
118#gnunet-namestore -z a -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf 122#gnunet-namestore -z a -d -n "@" -t DEL -c test_credential_lookup.conf
119#gnunet-namestore -z d -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf 123#gnunet-namestore -z d -d -n "@" -t DEL -c test_credential_lookup.conf
120#gnunet-namestore -z e -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf 124#gnunet-namestore -z e -d -n "@" -t DEL -c test_credential_lookup.conf
121#gnunet-namestore -z f -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf 125#gnunet-namestore -z f -d -n "@" -t DEL -c test_credential_lookup.conf
122#gnunet-namestore -z g -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf 126#gnunet-namestore -z g -d -n "@" -t DEL -c test_credential_lookup.conf
127
123 128
124gnunet-arm -e -c test_credential_lookup.conf 129gnunet-arm -e -c test_credential_lookup.conf
125 130
126if [ $RES == 0 ] 131if [ "$RES" == 0 ]
127then 132then
128 exit 0 133 exit 0
129else 134else