diff options
Diffstat (limited to 'src/credential/test_credential_own.sh')
-rwxr-xr-x | src/credential/test_credential_own.sh | 27 |
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 | ||
16 | rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f` | 16 | rm -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 | ||
24 | which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10" | 20 | which 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 | |||
35 | FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}') | 31 | FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}') |
36 | GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}') | 32 | GKEY=$(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 | |||
38 | gnunet-identity -C epub -c test_credential_lookup.conf | 40 | gnunet-identity -C epub -c test_credential_lookup.conf |
39 | gnunet-identity -C eorg -c test_credential_lookup.conf | 41 | gnunet-identity -C eorg -c test_credential_lookup.conf |
40 | gnunet-identity -C stateu -c test_credential_lookup.conf | 42 | gnunet-identity -C stateu -c test_credential_lookup.conf |
@@ -54,7 +56,7 @@ STATE_STUD_ATTR="student" | |||
54 | REG_STUD_ATTR="student" | 56 | REG_STUD_ATTR="student" |
55 | END_ATTR="end" | 57 | END_ATTR="end" |
56 | 58 | ||
57 | # FORWARD, subject side stored | 59 | # FORWARD, subject side stored (different constallations) |
58 | SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="a" --subject="$AKEY b.c" --ttl="2019-12-12 10:00:00"` | 60 | SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="a" --subject="$AKEY b.c" --ttl="2019-12-12 10:00:00"` |
59 | gnunet-credential --createSubjectSide --ego=a --import "$SIGNED" | 61 | gnunet-credential --createSubjectSide --ego=a --import "$SIGNED" |
60 | gnunet-namestore -D -z a | 62 | gnunet-namestore -D -z a |
@@ -99,11 +101,13 @@ gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED" --private | |||
99 | # Starting to resolve | 101 | # Starting to resolve |
100 | echo "+++ Starting to Resolve +++" | 102 | echo "+++ 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 | ||
107 | DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s` | 111 | DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s` |
108 | echo $DELS | 112 | echo $DELS |
109 | echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --delegate=\'$DELS\' --backward -c test_credential_lookup.conf | 113 | echo 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=$? | |||
115 | gnunet-namestore -z epub -d -n $DISC_ATTR -t ATTR -c test_credential_lookup.conf | 119 | gnunet-namestore -z epub -d -n $DISC_ATTR -t ATTR -c test_credential_lookup.conf |
116 | gnunet-namestore -z eorg -d -n $PREF_ATTR -t ATTR -c test_credential_lookup.conf | 120 | gnunet-namestore -z eorg -d -n $PREF_ATTR -t ATTR -c test_credential_lookup.conf |
117 | gnunet-namestore -z stateu -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf | 121 | gnunet-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 | ||
124 | gnunet-arm -e -c test_credential_lookup.conf | 129 | gnunet-arm -e -c test_credential_lookup.conf |
125 | 130 | ||
126 | if [ $RES == 0 ] | 131 | if [ "$RES" == 0 ] |
127 | then | 132 | then |
128 | exit 0 | 133 | exit 0 |
129 | else | 134 | else |