aboutsummaryrefslogtreecommitdiff
path: root/src/credential/test_credential_own.sh
diff options
context:
space:
mode:
authorAndreas Ebner <pansy007@googlemail.com>2019-08-06 16:17:33 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-10-07 12:17:28 +0200
commit33525da20575ba0149d1c6bcaac74e52d4e0ddd7 (patch)
tree91966b82a290b9b9d34c9d6e1c10f13d1b8156ed /src/credential/test_credential_own.sh
parent15b0d71a635f02f5e0291a695d35a65698fdea05 (diff)
downloadgnunet-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-xsrc/credential/test_credential_own.sh28
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"
74gnunet-namestore -D -z f 74gnunet-namestore -D -z f
75 75
76SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=f --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"` 76SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=f --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"`
77gnunet-credential --createSubjectSide --ego=g --import "$SIGNED" 77gnunet-credential --createSubjectSide --ego=g --import "$SIGNED" --private
78SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"` 78SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"`
79gnunet-credential --createSubjectSide --ego=g --import "$SIGNED" --private
80SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="h.o" --subject="$GKEY" --ttl="2019-12-12 10:00:00"`
79gnunet-credential --createSubjectSide --ego=g --import "$SIGNED" 81gnunet-credential --createSubjectSide --ego=g --import "$SIGNED"
80gnunet-namestore -D -z g 82gnunet-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"
94SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=registrarb --attribute="$REG_STUD_ATTR" --subject="$ALICE_KEY" --ttl="2019-12-12 10:00:00"` 96SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=registrarb --attribute="$REG_STUD_ATTR" --subject="$ALICE_KEY" --ttl="2019-12-12 10:00:00"`
95gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED" 97gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED" --private
96 98
97# Starting to resolve 99# Starting to resolve
98echo "+++ Starting to Resolve +++" 100echo "+++ 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
105CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice -c test_credential_lookup.conf | paste -d, -s` 107DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s`
106echo $CREDS 108echo $DELS
107echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential=\'$CREDS\' -c test_credential_lookup.conf 109echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --delegate=\'$DELS\' --backward -c test_credential_lookup.conf
108RES_CRED=`gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential="$CREDS" -c test_credential_lookup.conf` 110RES_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
121gnunet-arm -e -c test_credential_lookup.conf 123gnunet-arm -e -c test_credential_lookup.conf
122 124
123if [ "$RES_CRED" != "Failed." ] 125if [ "$RES_DELS" != "Failed." ]
124then 126then
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
128else 130else
129 echo "FAIL: Failed to verify credential $RES_CRED." 131 echo "FAIL: Failed to verify credential $RES_DELS."
130 exit 1 132 exit 1
131fi 133fi
132 134