diff options
author | Andreas Ebner <pansy007@googlemail.com> | 2019-08-04 13:52:03 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-10-07 12:16:50 +0200 |
commit | 15b0d71a635f02f5e0291a695d35a65698fdea05 (patch) | |
tree | 5afc234a0ce848019d1098f3852fde06f14dcd98 /src/credential/test_credential_own.sh | |
parent | 93cd93a1330fb38add615f797ac9a87fc252ff98 (diff) | |
download | gnunet-15b0d71a635f02f5e0291a695d35a65698fdea05.tar.gz gnunet-15b0d71a635f02f5e0291a695d35a65698fdea05.zip |
Clean up and renaming
- renamed a lot of variables/functions that no longer serve credential but delegate
- correct printouts likewise
- cleaned up test_credential_own.sh to use credential service issuer side storage
- removed credential related parameters from VerifyRequestHandle struct
Diffstat (limited to 'src/credential/test_credential_own.sh')
-rwxr-xr-x | src/credential/test_credential_own.sh | 58 |
1 files changed, 14 insertions, 44 deletions
diff --git a/src/credential/test_credential_own.sh b/src/credential/test_credential_own.sh index 19dd686a9..d2ed0b0ac 100755 --- a/src/credential/test_credential_own.sh +++ b/src/credential/test_credential_own.sh | |||
@@ -54,6 +54,7 @@ STATE_STUD_ATTR="student" | |||
54 | REG_STUD_ATTR="student" | 54 | REG_STUD_ATTR="student" |
55 | END_ATTR="end" | 55 | END_ATTR="end" |
56 | 56 | ||
57 | # FORWARD, subject side stored | ||
57 | SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="a" --subject="$AKEY b.c" --ttl="2019-12-12 10:00:00"` | 58 | SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="a" --subject="$AKEY b.c" --ttl="2019-12-12 10:00:00"` |
58 | gnunet-credential --createSubjectSide --ego=a --import "$SIGNED" | 59 | gnunet-credential --createSubjectSide --ego=a --import "$SIGNED" |
59 | gnunet-namestore -D -z a | 60 | gnunet-namestore -D -z a |
@@ -79,66 +80,35 @@ gnunet-credential --createSubjectSide --ego=g --import "$SIGNED" | |||
79 | gnunet-namestore -D -z g | 80 | gnunet-namestore -D -z g |
80 | 81 | ||
81 | 82 | ||
82 | 83 | # BACKWARD, issuer side stored | |
83 | TEST_CREDENTIAL="mygnunetcreds" | ||
84 | # Own issuer side storage: | ||
85 | #gnunet-credential --createIssuerSide --ego=epub --attribute="issside" --subject="$EORG_KEY asd" --ttl=5m | ||
86 | |||
87 | #gnunet-namestore -D -z epub | ||
88 | |||
89 | # Own subject side storage: | ||
90 | #SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY" --ttl="2019-12-12 10:00:00"` | ||
91 | #gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED" | ||
92 | |||
93 | #SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY efghijklmno" --ttl="2019-12-12 10:00:00"` | ||
94 | #gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED" | ||
95 | |||
96 | #SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY efghijklmno.pqr" --ttl="2019-12-12 10:00:00"` | ||
97 | #gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED" | ||
98 | |||
99 | #SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd.stu" --subject="$EORG_KEY efghijklmno.pqr" --ttl="2019-12-12 10:00:00"` | ||
100 | #gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED" | ||
101 | |||
102 | #SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=stateu --attribute="aaa" --subject="$EPUB_KEY bbbb" --ttl="2019-12-12 10:00:00"` | ||
103 | #gnunet-credential --createSubjectSide --ego=epub --import "$SIGNED" | ||
104 | |||
105 | #gnunet-namestore -D -z eorg | ||
106 | |||
107 | # (1) EPub assigns the attribute "discount" to all entities that have been assigned "preferred" by EOrg | 84 | # (1) EPub assigns the attribute "discount" to all entities that have been assigned "preferred" by EOrg |
108 | gnunet-namestore -p -z epub -a -n $DISC_ATTR -t ATTR -V "$EORG_KEY $PREF_ATTR" -e 5m -c test_credential_lookup.conf | 85 | gnunet-credential --createIssuerSide --ego=epub --attribute=$DISC_ATTR --subject="$EORG_KEY $PREF_ATTR" --ttl=5m -c test_credential_lookup.conf |
109 | gnunet-namestore -p -z epub -a -n "random" -t ATTR -V "$GKEY random" -e 5m -c test_credential_lookup.conf | ||
110 | 86 | ||
111 | # (2) EOrg assigns the attribute "preferred" to all entities that have been assigned "student" by StateU | 87 | # (2) EOrg assigns the attribute "preferred" to all entities that have been assigned "student" by StateU |
112 | gnunet-namestore -p -z eorg -a -n $PREF_ATTR -t ATTR -V "$STATEU_KEY $STATE_STUD_ATTR" -e 5m -c test_credential_lookup.conf | 88 | gnunet-credential --createIssuerSide --ego=eorg --attribute=$PREF_ATTR --subject="$STATEU_KEY $STATE_STUD_ATTR" --ttl=5m -c test_credential_lookup.conf |
113 | 89 | ||
114 | # (3) StateU assigns the attribute "student" to all entities that have been asssigned "student" by RegistrarB | 90 | # (3) StateU assigns the attribute "student" to all entities that have been asssigned "student" by RegistrarB |
115 | gnunet-namestore -p -z stateu -a -n $STATE_STUD_ATTR -t ATTR -V "$REGISTRARB_KEY $REG_STUD_ATTR" -e 5m -c test_credential_lookup.conf | 91 | gnunet-credential --createIssuerSide --ego=stateu --attribute=$STATE_STUD_ATTR --subject="$REGISTRARB_KEY $REG_STUD_ATTR" --ttl=5m -c test_credential_lookup.conf |
116 | 92 | ||
117 | # (4) RegistrarB issues Alice the credential "student" | 93 | # (4) RegistrarB issues Alice the credential "student" |
118 | CRED=`$DO_TIMEOUT gnunet-credential --issue --ego=registrarb --subject=$ALICE_KEY --attribute=$REG_STUD_ATTR --ttl=5m -c test_credential_lookup.conf` | ||
119 | |||
120 | # Alice stores the credential under "mygnunetcreds" | ||
121 | #gnunet-namestore -p -z alice -a -n $TEST_CREDENTIAL -t CRED -V "$CRED" -e 5m -c test_credential_lookup.conf | ||
122 | |||
123 | SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=registrarb --attribute="$REG_STUD_ATTR" --subject="$ALICE_KEY" --ttl="2019-12-12 10:00:00"` | 94 | SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=registrarb --attribute="$REG_STUD_ATTR" --subject="$ALICE_KEY" --ttl="2019-12-12 10:00:00"` |
124 | gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED" | 95 | gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED" |
125 | 96 | ||
126 | # Starting to resolve | 97 | # Starting to resolve |
127 | echo "+++++Starting Collect" | 98 | echo "+++ Starting to Resolve +++" |
128 | 99 | ||
129 | CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=g -c test_credential_lookup.conf | paste -d, -s` | 100 | #CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=g -c test_credential_lookup.conf | paste -d, -s` |
130 | echo $CREDS | ||
131 | echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --credential=\'$CREDS\' -c test_credential_lookup.conf | ||
132 | RES_CRED=`gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --credential="$CREDS" -c test_credential_lookup.conf` | ||
133 | |||
134 | #CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice -c test_credential_lookup.conf | paste -d, -s` | ||
135 | #echo $CREDS | 101 | #echo $CREDS |
136 | #echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential=\'$CREDS\' -c test_credential_lookup.conf | 102 | #echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --credential=\'$CREDS\' -c test_credential_lookup.conf |
137 | #RES_CRED=`gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential="$CREDS" -c test_credential_lookup.conf` | 103 | #RES_CRED=`gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --credential="$CREDS" -c test_credential_lookup.conf` |
104 | |||
105 | CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice -c test_credential_lookup.conf | paste -d, -s` | ||
106 | echo $CREDS | ||
107 | echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential=\'$CREDS\' -c test_credential_lookup.conf | ||
108 | RES_CRED=`gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential="$CREDS" -c test_credential_lookup.conf` | ||
138 | 109 | ||
139 | 110 | ||
140 | # Cleanup properly | 111 | # Cleanup properly |
141 | gnunet-namestore -z alice -d -n $TEST_CREDENTIAL -t CRED -e never -c test_credential_lookup.conf | ||
142 | gnunet-namestore -z epub -d -n $DISC_ATTR -t ATTR -c test_credential_lookup.conf | 112 | gnunet-namestore -z epub -d -n $DISC_ATTR -t ATTR -c test_credential_lookup.conf |
143 | gnunet-namestore -z eorg -d -n $PREF_ATTR -t ATTR -c test_credential_lookup.conf | 113 | gnunet-namestore -z eorg -d -n $PREF_ATTR -t ATTR -c test_credential_lookup.conf |
144 | gnunet-namestore -z stateu -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf | 114 | gnunet-namestore -z stateu -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf |