diff options
author | Andreas Ebner <pansy007@googlemail.com> | 2019-08-06 16:17:33 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-10-07 12:17:28 +0200 |
commit | 33525da20575ba0149d1c6bcaac74e52d4e0ddd7 (patch) | |
tree | 91966b82a290b9b9d34c9d6e1c10f13d1b8156ed /src/credential/test_credential_own.sh | |
parent | 15b0d71a635f02f5e0291a695d35a65698fdea05 (diff) | |
download | gnunet-33525da20575ba0149d1c6bcaac74e52d4e0ddd7.tar.gz gnunet-33525da20575ba0149d1c6bcaac74e52d4e0ddd7.zip |
Removed GNUNET_CREDENTIAL_Credential, new cmdline parameters, formatting:
- removed all files and functions related to GNUNET_CREDENTIAL_Credential, has been replaced by GNUNET_CREDENTIAL_Delegate
- renamed cmline parameter 'credential'
- added cmline parameter for backward/forward search and a related enum
- added cmline parameter to store private delegates
- only private delegates are used as start/end of the search algorithm (set to vrh in collect)
- run valgrind: no memory exceptions
- run clang-format
Diffstat (limited to 'src/credential/test_credential_own.sh')
-rwxr-xr-x | src/credential/test_credential_own.sh | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/credential/test_credential_own.sh b/src/credential/test_credential_own.sh index d2ed0b0ac..4ff1a8e08 100755 --- a/src/credential/test_credential_own.sh +++ b/src/credential/test_credential_own.sh | |||
@@ -74,8 +74,10 @@ gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" | |||
74 | gnunet-namestore -D -z f | 74 | gnunet-namestore -D -z f |
75 | 75 | ||
76 | SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=f --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"` | 76 | SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=f --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"` |
77 | gnunet-credential --createSubjectSide --ego=g --import "$SIGNED" | 77 | gnunet-credential --createSubjectSide --ego=g --import "$SIGNED" --private |
78 | SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"` | 78 | SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"` |
79 | gnunet-credential --createSubjectSide --ego=g --import "$SIGNED" --private | ||
80 | SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="h.o" --subject="$GKEY" --ttl="2019-12-12 10:00:00"` | ||
79 | gnunet-credential --createSubjectSide --ego=g --import "$SIGNED" | 81 | gnunet-credential --createSubjectSide --ego=g --import "$SIGNED" |
80 | gnunet-namestore -D -z g | 82 | gnunet-namestore -D -z g |
81 | 83 | ||
@@ -92,20 +94,20 @@ gnunet-credential --createIssuerSide --ego=stateu --attribute=$STATE_STUD_ATTR - | |||
92 | 94 | ||
93 | # (4) RegistrarB issues Alice the credential "student" | 95 | # (4) RegistrarB issues Alice the credential "student" |
94 | SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=registrarb --attribute="$REG_STUD_ATTR" --subject="$ALICE_KEY" --ttl="2019-12-12 10:00:00"` | 96 | SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=registrarb --attribute="$REG_STUD_ATTR" --subject="$ALICE_KEY" --ttl="2019-12-12 10:00:00"` |
95 | gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED" | 97 | gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED" --private |
96 | 98 | ||
97 | # Starting to resolve | 99 | # Starting to resolve |
98 | echo "+++ Starting to Resolve +++" | 100 | echo "+++ Starting to Resolve +++" |
99 | 101 | ||
100 | #CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=g -c test_credential_lookup.conf | paste -d, -s` | 102 | #DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=g --forward -c test_credential_lookup.conf | paste -d, -s` |
101 | #echo $CREDS | 103 | #echo $DELS |
102 | #echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --credential=\'$CREDS\' -c test_credential_lookup.conf | 104 | #echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate=\'$DELS\' --forward -c test_credential_lookup.conf |
103 | #RES_CRED=`gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --credential="$CREDS" -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` |
104 | 106 | ||
105 | CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice -c test_credential_lookup.conf | paste -d, -s` | 107 | DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s` |
106 | echo $CREDS | 108 | echo $DELS |
107 | echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential=\'$CREDS\' -c test_credential_lookup.conf | 109 | echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --delegate=\'$DELS\' --backward -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` | 110 | RES_DELS=`gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --delegate="$DELS" --backward -c test_credential_lookup.conf` |
109 | 111 | ||
110 | 112 | ||
111 | # Cleanup properly | 113 | # Cleanup properly |
@@ -120,13 +122,13 @@ gnunet-namestore -z stateu -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_loo | |||
120 | 122 | ||
121 | gnunet-arm -e -c test_credential_lookup.conf | 123 | gnunet-arm -e -c test_credential_lookup.conf |
122 | 124 | ||
123 | if [ "$RES_CRED" != "Failed." ] | 125 | if [ "$RES_DELS" != "Failed." ] |
124 | then | 126 | then |
125 | # TODO: replace echo -e bashism | 127 | # TODO: replace echo -e bashism |
126 | echo -e "${RES_CRED}" | 128 | echo -e "${RES_DELS}" |
127 | exit 0 | 129 | exit 0 |
128 | else | 130 | else |
129 | echo "FAIL: Failed to verify credential $RES_CRED." | 131 | echo "FAIL: Failed to verify credential $RES_DELS." |
130 | exit 1 | 132 | exit 1 |
131 | fi | 133 | fi |
132 | 134 | ||