aboutsummaryrefslogtreecommitdiff
path: root/src/credential/test_credential_own.sh
diff options
context:
space:
mode:
authorAndreas Ebner <pansy007@googlemail.com>2019-07-24 16:29:32 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-10-07 12:15:32 +0200
commit40624873cbd2eaf3a94185995b14899ea6ab36bf (patch)
tree0bcc45fc8ba74c7b218ed2b32fc8b7482a42a37c /src/credential/test_credential_own.sh
parent5091edcec16455febee99afec20e0ffe6cc59c21 (diff)
downloadgnunet-40624873cbd2eaf3a94185995b14899ea6ab36bf.tar.gz
gnunet-40624873cbd2eaf3a94185995b14899ea6ab36bf.zip
Run clang format over some files, experimental implementation of forward algorithm
Diffstat (limited to 'src/credential/test_credential_own.sh')
-rwxr-xr-xsrc/credential/test_credential_own.sh74
1 files changed, 60 insertions, 14 deletions
diff --git a/src/credential/test_credential_own.sh b/src/credential/test_credential_own.sh
index b53825d1b..23935c75a 100755
--- a/src/credential/test_credential_own.sh
+++ b/src/credential/test_credential_own.sh
@@ -21,8 +21,20 @@ rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
21# (4) RegistrarB.student <- Alice 21# (4) RegistrarB.student <- Alice
22 22
23 23
24which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30" 24which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
25gnunet-arm -s -c test_credential_lookup.conf 25gnunet-arm -s -c test_credential_lookup.conf
26
27gnunet-identity -C a -c test_credential_lookup.conf
28gnunet-identity -C d -c test_credential_lookup.conf
29gnunet-identity -C e -c test_credential_lookup.conf
30gnunet-identity -C f -c test_credential_lookup.conf
31gnunet-identity -C g -c test_credential_lookup.conf
32AKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep a | awk '{print $3}')
33DKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep d | awk '{print $3}')
34EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print $3}')
35FKEY=$(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}')
37
26gnunet-identity -C epub -c test_credential_lookup.conf 38gnunet-identity -C epub -c test_credential_lookup.conf
27gnunet-identity -C eorg -c test_credential_lookup.conf 39gnunet-identity -C eorg -c test_credential_lookup.conf
28gnunet-identity -C stateu -c test_credential_lookup.conf 40gnunet-identity -C stateu -c test_credential_lookup.conf
@@ -42,29 +54,55 @@ STATE_STUD_ATTR="student"
42REG_STUD_ATTR="student" 54REG_STUD_ATTR="student"
43END_ATTR="end" 55END_ATTR="end"
44 56
57SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="a" --subject="$AKEY b.c" --ttl="2019-12-12 10:00:00"`
58gnunet-credential --createSubjectSide --ego=a --import "$SIGNED"
59gnunet-namestore -D -z a
60
61SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="b" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
62gnunet-credential --createSubjectSide --ego=d --import "$SIGNED"
63gnunet-namestore -D -z d
64
65SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY" --ttl="2019-12-12 10:00:00"`
66gnunet-credential --createSubjectSide --ego=e --import "$SIGNED"
67gnunet-namestore -D -z e
68
69SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="c" --subject="$FKEY c" --ttl="2019-12-12 10:00:00"`
70gnunet-credential --createSubjectSide --ego=f --import "$SIGNED"
71gnunet-namestore -D -z f
72
73SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=f --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"`
74gnunet-credential --createSubjectSide --ego=g --import "$SIGNED"
75gnunet-namestore -D -z g
76
77
78
45TEST_CREDENTIAL="mygnunetcreds" 79TEST_CREDENTIAL="mygnunetcreds"
46# Own issuer side storage: 80# Own issuer side storage:
47gnunet-credential --createIssuerSide --ego=epub --attribute="issside" --subject="$EORG_KEY asd" --ttl=5m 81#gnunet-credential --createIssuerSide --ego=epub --attribute="issside" --subject="$EORG_KEY asd" --ttl=5m
48 82
49gnunet-namestore -D -z epub 83#gnunet-namestore -D -z epub
50 84
51# Own subject side storage: 85# Own subject side storage:
52SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY" --ttl="2019-12-12 10:00:00"` 86#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY" --ttl="2019-12-12 10:00:00"`
53gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED" 87#gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED"
54 88
55SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY efghijklmno" --ttl="2019-12-12 10:00:00"` 89#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY efghijklmno" --ttl="2019-12-12 10:00:00"`
56gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED" 90#gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED"
57 91
58SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY efghijklmno.pqr" --ttl="2019-12-12 10:00:00"` 92#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY efghijklmno.pqr" --ttl="2019-12-12 10:00:00"`
59gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED" 93#gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED"
60 94
61SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd.stu" --subject="$EORG_KEY efghijklmno.pqr" --ttl="2019-12-12 10:00:00"` 95#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd.stu" --subject="$EORG_KEY efghijklmno.pqr" --ttl="2019-12-12 10:00:00"`
62gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED" 96#gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED"
63 97
64gnunet-namestore -D -z eorg 98#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=stateu --attribute="aaa" --subject="$EPUB_KEY bbbb" --ttl="2019-12-12 10:00:00"`
99#gnunet-credential --createSubjectSide --ego=epub --import "$SIGNED"
100
101#gnunet-namestore -D -z eorg
65 102
66# (1) EPub assigns the attribute "discount" to all entities that have been assigned "preferred" by EOrg 103# (1) EPub assigns the attribute "discount" to all entities that have been assigned "preferred" by EOrg
67gnunet-namestore -p -z epub -a -n $DISC_ATTR -t ATTR -V "$EORG_KEY $PREF_ATTR" -e 5m -c test_credential_lookup.conf 104gnunet-namestore -p -z epub -a -n $DISC_ATTR -t ATTR -V "$EORG_KEY $PREF_ATTR" -e 5m -c test_credential_lookup.conf
105gnunet-namestore -p -z epub -a -n "random" -t ATTR -V "$GKEY random" -e 5m -c test_credential_lookup.conf
68 106
69# (2) EOrg assigns the attribute "preferred" to all entities that have been assigned "student" by StateU 107# (2) EOrg assigns the attribute "preferred" to all entities that have been assigned "student" by StateU
70gnunet-namestore -p -z eorg -a -n $PREF_ATTR -t ATTR -V "$STATEU_KEY $STATE_STUD_ATTR" -e 5m -c test_credential_lookup.conf 108gnunet-namestore -p -z eorg -a -n $PREF_ATTR -t ATTR -V "$STATEU_KEY $STATE_STUD_ATTR" -e 5m -c test_credential_lookup.conf
@@ -81,11 +119,13 @@ gnunet-namestore -p -z alice -a -n $TEST_CREDENTIAL -t CRED -V "$CRED" -e 5m -c
81# Starting to resolve 119# Starting to resolve
82echo "+++++Starting Collect" 120echo "+++++Starting Collect"
83 121
84CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice -c test_credential_lookup.conf | paste -d, -s` 122CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute="random" --ego=alice -c test_credential_lookup.conf | paste -d, -s`
123#CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice -c test_credential_lookup.conf | paste -d, -s`
85echo $CREDS 124echo $CREDS
86echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential=\'$CREDS\' -c test_credential_lookup.conf 125echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential=\'$CREDS\' -c test_credential_lookup.conf
87 126
88RES_CRED=`gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential="$CREDS" -c test_credential_lookup.conf` 127RES_CRED=`gnunet-credential --verify --issuer=$EPUB_KEY --attribute="random" --subject=$ALICE_KEY --credential="$CREDS" -c test_credential_lookup.conf`
128#RES_CRED=`gnunet-credential --verify --issuer=$GKEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential="$CREDS" -c test_credential_lookup.conf`
89 129
90 130
91# Cleanup properly 131# Cleanup properly
@@ -93,6 +133,12 @@ gnunet-namestore -z alice -d -n $TEST_CREDENTIAL -t CRED -e never -c test_creden
93gnunet-namestore -z epub -d -n $DISC_ATTR -t ATTR -c test_credential_lookup.conf 133gnunet-namestore -z epub -d -n $DISC_ATTR -t ATTR -c test_credential_lookup.conf
94gnunet-namestore -z eorg -d -n $PREF_ATTR -t ATTR -c test_credential_lookup.conf 134gnunet-namestore -z eorg -d -n $PREF_ATTR -t ATTR -c test_credential_lookup.conf
95gnunet-namestore -z stateu -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf 135gnunet-namestore -z stateu -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf
136#gnunet-namestore -z a -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf
137#gnunet-namestore -z d -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf
138#gnunet-namestore -z e -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf
139#gnunet-namestore -z f -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf
140#gnunet-namestore -z g -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf
141
96gnunet-arm -e -c test_credential_lookup.conf 142gnunet-arm -e -c test_credential_lookup.conf
97 143
98if [ "$RES_CRED" != "Failed." ] 144if [ "$RES_CRED" != "Failed." ]