From 4d4a16e000683046ebb19e6efe15e11d60c2178d Mon Sep 17 00:00:00 2001 From: Andreas Ebner Date: Fri, 20 Sep 2019 11:32:00 +0200 Subject: [PATCH] Test cleanup/fix: - added missing "- -" to collect for macOS - replaced 'import $SIGNED' with 'import=$SIGNED' to match all other parameters and better visibility --- src/credential/test_credential_bi_and.sh | 9 +++---- src/credential/test_credential_bi_and2.sh | 9 +++---- src/credential/test_credential_bi_and3.sh | 12 +++++----- src/credential/test_credential_bi_and4.sh | 7 +++--- src/credential/test_credential_bi_bw.sh | 7 +++--- src/credential/test_credential_bi_bw_link.sh | 7 +++--- src/credential/test_credential_bi_bw_link2.sh | 9 +++---- src/credential/test_credential_bi_fw.sh | 9 +++---- src/credential/test_credential_issue.sh | 7 +++--- src/credential/test_credential_own.sh | 24 ++++++++++--------- src/credential/test_credential_verify.sh | 6 +++-- src/credential/test_credential_verify_and.sh | 8 ++++--- .../test_credential_verify_simple.sh | 6 +++-- 13 files changed, 67 insertions(+), 53 deletions(-) diff --git a/src/credential/test_credential_bi_and.sh b/src/credential/test_credential_bi_and.sh index a7ed3ce1a..d52fb5dbe 100755 --- a/src/credential/test_credential_bi_and.sh +++ b/src/credential/test_credential_bi_and.sh @@ -37,6 +37,7 @@ EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}') GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}') HKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep h | awk '{print $3}') +gnunet-identity -d # (1) (A.a) <- B.b # (2) (B.b) <- C.c AND G.g @@ -55,16 +56,16 @@ gnunet-credential --createIssuerSide --ego=g --attribute="g" --subject="$HKEY h" gnunet-namestore -D -z b SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=d --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=d --import="$SIGNED" gnunet-namestore -D -z d SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=e --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=e --import="$SIGNED" gnunet-namestore -D -z e SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private gnunet-namestore -D -z f SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=h --attribute="h" --subject="$FKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private gnunet-namestore -D -z h # Starting to resolve diff --git a/src/credential/test_credential_bi_and2.sh b/src/credential/test_credential_bi_and2.sh index 23b55111c..f076c1c5c 100755 --- a/src/credential/test_credential_bi_and2.sh +++ b/src/credential/test_credential_bi_and2.sh @@ -37,6 +37,7 @@ EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}') GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}') HKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep h | awk '{print $3}') +gnunet-identity -d # (1) (A.a) <- B.b # (2) (B.b) <- C.c AND G.g @@ -52,16 +53,16 @@ gnunet-credential --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c, gnunet-namestore -D -z b SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=d --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=d --import="$SIGNED" gnunet-namestore -D -z d SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=e --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=e --import="$SIGNED" gnunet-namestore -D -z e SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private gnunet-namestore -D -z f SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=g --attribute="g" --subject="$FKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private gnunet-namestore -D -z h # Starting to resolve diff --git a/src/credential/test_credential_bi_and3.sh b/src/credential/test_credential_bi_and3.sh index e2f167622..80dddcc14 100755 --- a/src/credential/test_credential_bi_and3.sh +++ b/src/credential/test_credential_bi_and3.sh @@ -36,8 +36,8 @@ EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}') GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}') HKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep h | awk '{print $3}') - gnunet-identity -d + # (1) (A.a) <- B.b # (2) (B.b) <- C.c AND G.g # (3) C.c <- (D.d) @@ -53,18 +53,18 @@ gnunet-credential --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c, gnunet-namestore -D -z b SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=d --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=d --import="$SIGNED" gnunet-namestore -D -z d SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=e --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=e --import="$SIGNED" gnunet-namestore -D -z e SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=g --attribute="g" --subject="$HKEY h" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=h --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=h --import="$SIGNED" gnunet-namestore -D -z h SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=h --attribute="h" --subject="$FKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private gnunet-namestore -D -z f # Starting to resolve diff --git a/src/credential/test_credential_bi_and4.sh b/src/credential/test_credential_bi_and4.sh index c4db5c82a..18731d5d1 100755 --- a/src/credential/test_credential_bi_and4.sh +++ b/src/credential/test_credential_bi_and4.sh @@ -37,6 +37,7 @@ EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}') GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}') HKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep h | awk '{print $3}') +gnunet-identity -d # (1) (A.a) <- B.b # (2) (B.b) <- C.c AND G.g @@ -50,15 +51,15 @@ gnunet-credential --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c, gnunet-namestore -D -z b SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=g --attribute="g" --subject="$FKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$FKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private gnunet-namestore -D -z f # Starting to resolve echo "+++ Starting to Resolve +++" -DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=f --backward -c test_credential_lookup.conf | paste -d, -s` +DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=f --backward -c test_credential_lookup.conf | paste -d, -s - -` echo $DELS echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' --backward -c test_credential_lookup.conf gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" --backward -c test_credential_lookup.conf diff --git a/src/credential/test_credential_bi_bw.sh b/src/credential/test_credential_bi_bw.sh index 3a2043db6..618fae95f 100755 --- a/src/credential/test_credential_bi_bw.sh +++ b/src/credential/test_credential_bi_bw.sh @@ -35,6 +35,7 @@ DKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep d | awk '{print EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print $3}') FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}') GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}') +gnunet-identity -d # (1) (A.a) <- B.b # (2) (B.b) <- C.c @@ -49,13 +50,13 @@ gnunet-credential --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c" gnunet-namestore -D -z b SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=d --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=d --import="$SIGNED" gnunet-namestore -D -z d SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=e --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=e --import="$SIGNED" gnunet-namestore -D -z e SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private gnunet-namestore -D -z f # Starting to resolve diff --git a/src/credential/test_credential_bi_bw_link.sh b/src/credential/test_credential_bi_bw_link.sh index 86b0e7418..f002c2141 100755 --- a/src/credential/test_credential_bi_bw_link.sh +++ b/src/credential/test_credential_bi_bw_link.sh @@ -35,6 +35,7 @@ DKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep d | awk '{print EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print $3}') FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}') GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}') +gnunet-identity -d # (1) (A.a) <- B.b # (2) (B.b) <- G.g.c @@ -52,13 +53,13 @@ gnunet-credential --createIssuerSide --ego=g --attribute="g" --subject="$CKEY" - gnunet-namestore -D -z b SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=d --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=d --import="$SIGNED" gnunet-namestore -D -z d SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=e --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=e --import="$SIGNED" gnunet-namestore -D -z e SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private gnunet-namestore -D -z f # Starting to resolve diff --git a/src/credential/test_credential_bi_bw_link2.sh b/src/credential/test_credential_bi_bw_link2.sh index ccb71b880..f6055a7bb 100755 --- a/src/credential/test_credential_bi_bw_link2.sh +++ b/src/credential/test_credential_bi_bw_link2.sh @@ -35,6 +35,7 @@ DKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep d | awk '{print EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print $3}') FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}') GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}') +gnunet-identity -d # (1) (A.a) <- B.b # (2) (B.b) <- G.g.c @@ -50,16 +51,16 @@ gnunet-credential --createIssuerSide --ego=b --attribute="b" --subject="$GKEY g. gnunet-namestore -D -z b SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=g --attribute="g" --subject="$CKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=c --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=c --import="$SIGNED" gnunet-namestore -D -z c SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=d --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=d --import="$SIGNED" gnunet-namestore -D -z d SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=e --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=e --import="$SIGNED" gnunet-namestore -D -z e SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private gnunet-namestore -D -z f # Starting to resolve diff --git a/src/credential/test_credential_bi_fw.sh b/src/credential/test_credential_bi_fw.sh index 9c8f768c5..7cd5e5c52 100755 --- a/src/credential/test_credential_bi_fw.sh +++ b/src/credential/test_credential_bi_fw.sh @@ -35,6 +35,7 @@ DKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep d | awk '{print EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print $3}') FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}') GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}') +gnunet-identity -d # (1) (A.a) <- B.b # (2) (B.b) <- C.c @@ -50,16 +51,16 @@ gnunet-credential --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c" gnunet-namestore -D -z b SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=d --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=d --import="$SIGNED" gnunet-namestore -D -z d SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=e --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=e --import="$SIGNED" gnunet-namestore -D -z e SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="e" --subject="$FKEY f" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" gnunet-namestore -D -z f SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=f --attribute="f" --subject="$GKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=g --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=g --import="$SIGNED" --private gnunet-namestore -D -z g # Starting to resolve diff --git a/src/credential/test_credential_issue.sh b/src/credential/test_credential_issue.sh index 833a094e6..3d4b82cf6 100755 --- a/src/credential/test_credential_issue.sh +++ b/src/credential/test_credential_issue.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT LOCATION=$(which gnunet-config) @@ -28,8 +28,8 @@ gnunet-identity -C testissuer -c test_credential_lookup.conf gnunet-identity -C testsubject -c test_credential_lookup.conf SUBJECT_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testsubject | awk '{print $3}') ISSUER_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testissuer | awk '{print $3}') + # Get credential and store it with subject (3) -#CRED=`$DO_TIMEOUT gnunet-credential --issue --ego=testissuer --subject=$SUBJECT_KEY --attribute=$TEST_ATTR --ttl=5m -c test_credential_lookup.conf` SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=testissuer --attribute=$TEST_ATTR --subject=$SUBJECT_KEY --ttl="2019-12-12 10:00:00" -c test_credential_lookup.conf` STATUS=$? @@ -40,8 +40,7 @@ then exit 1 fi #Try import -$DO_TIMEOUT gnunet-credential --createSubjectSide --ego=testsubject --import "$SIGNED" --private -c test_credential_lookup.conf -#$DO_TIMEOUT gnunet-namestore -a -z testsubject -n c1 -t CRED -V "$CRED" -e 5m -c test_credential_lookup.conf +$DO_TIMEOUT gnunet-credential --createSubjectSide --ego=testsubject --import="$SIGNED" --private -c test_credential_lookup.conf RES=$? gnunet-arm -e -c test_credential_lookup.conf exit $RES diff --git a/src/credential/test_credential_own.sh b/src/credential/test_credential_own.sh index b868cdf67..8a94f90e7 100755 --- a/src/credential/test_credential_own.sh +++ b/src/credential/test_credential_own.sh @@ -56,31 +56,33 @@ STATE_STUD_ATTR="student" REG_STUD_ATTR="student" END_ATTR="end" +gnunet-identity -d + # FORWARD, subject side stored (different constallations) SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="a" --subject="$AKEY b.c" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=a --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=a --import="$SIGNED" gnunet-namestore -D -z a SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="b" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=d --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=d --import="$SIGNED" gnunet-namestore -D -z d SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=e --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=e --import="$SIGNED" gnunet-namestore -D -z e SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="c" --subject="$FKEY c" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="k" --subject="$FKEY c.k" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=f --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" gnunet-namestore -D -z f SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=f --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=g --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=g --import="$SIGNED" --private SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=g --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=g --import="$SIGNED" --private SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="h.o" --subject="$GKEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=g --import "$SIGNED" +gnunet-credential --createSubjectSide --ego=g --import="$SIGNED" gnunet-namestore -D -z g @@ -96,19 +98,19 @@ gnunet-credential --createIssuerSide --ego=stateu --attribute=$STATE_STUD_ATTR - # (4) RegistrarB issues Alice the credential "student" SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=registrarb --attribute="$REG_STUD_ATTR" --subject="$ALICE_KEY" --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=alice --import="$SIGNED" --private # Starting to resolve echo "+++ Starting to Resolve +++" # FORWARD -#DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=g --forward -c test_credential_lookup.conf | paste -d, -s` +#DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=g --forward -c test_credential_lookup.conf | paste -d, -s - -` #echo $DELS #echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate=\'$DELS\' --forward -c test_credential_lookup.conf #RES_DELS=`gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate="$DELS" --forward -c test_credential_lookup.conf` # BACKWARD -DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s` +DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s - -` echo $DELS echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --delegate=\'$DELS\' --backward -c test_credential_lookup.conf gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --delegate="$DELS" --backward -c test_credential_lookup.conf diff --git a/src/credential/test_credential_verify.sh b/src/credential/test_credential_verify.sh index 08060f60a..38492de8e 100755 --- a/src/credential/test_credential_verify.sh +++ b/src/credential/test_credential_verify.sh @@ -41,6 +41,8 @@ DEVELOPER_ATTR="developer" DEV_ATTR="developer" TEST_CREDENTIAL="mygnunetcreds" +gnunet-identity -d + # (1) A service assigns the attribute "user" to all entities that have been assigned "member" by entities that werde assigned "project" from GNU gnunet-credential --createIssuerSide --ego=service --attribute="$USER_ATTR" --subject="$GNU_KEY $GNU_PROJECT_ATTR.$MEMBER_ATTR" --ttl="2019-12-12 10:00:00" -c test_credential_lookup.conf gnunet-namestore -D -z service @@ -56,13 +58,13 @@ gnunet-namestore -D -z gnunet # (5) GNUnet signes the delegate and Alice stores it SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=gnunet --attribute=$DEV_ATTR --subject=$ALICE_KEY --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=alice --import="$SIGNED" --private gnunet-namestore -D -z alice # Starting to resolve echo "+++ Starting to Resolve +++" -DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$SERVICE_KEY --attribute=$USER_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s` +DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$SERVICE_KEY --attribute=$USER_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s - -` echo $DELS echo gnunet-credential --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --delegate=\'$DELS\' --backward -c test_credential_lookup.conf gnunet-credential --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --delegate="$DELS" --backward -c test_credential_lookup.conf diff --git a/src/credential/test_credential_verify_and.sh b/src/credential/test_credential_verify_and.sh index 03313c692..3a2852dc6 100755 --- a/src/credential/test_credential_verify_and.sh +++ b/src/credential/test_credential_verify_and.sh @@ -40,6 +40,8 @@ DEVELOPER_ATTR="developer" DEV_ATTR="developer" TEST_CREDENTIAL="mygnunetcreds" +gnunet-identity -d + # (1) A service assigns the attribute "user" to all entities that have been assigned "member" by entities that werde assigned "project" from GNU gnunet-credential --createIssuerSide --ego=service --attribute="$USER_ATTR" --subject="$GNU_KEY $GNU_PROJECT_ATTR.$MEMBER_ATTR" --ttl="2019-12-12 10:00:00" -c test_credential_lookup.conf gnunet-namestore -D -z service @@ -54,15 +56,15 @@ gnunet-namestore -D -z gnunet # (5) GNUnet signes the delegates and Alice stores it SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=gnunet --attribute=$DEV_ATTR --subject=$ALICE_KEY --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=alice --import="$SIGNED" --private SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=gnunet --attribute=$USER_ATTR --subject=$ALICE_KEY --ttl="2019-12-12 10:00:00"` -gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=alice --import="$SIGNED" --private gnunet-namestore -D -z alice # Starting to resolve echo "+++ Starting to Resolve +++" -DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$SERVICE_KEY --attribute=$USER_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s` +DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$SERVICE_KEY --attribute=$USER_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s - -` echo $DELS echo gnunet-credential --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --delegate=\'$DELS\' --backward -c test_credential_lookup.conf gnunet-credential --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --delegate="$DELS" --backward -c test_credential_lookup.conf diff --git a/src/credential/test_credential_verify_simple.sh b/src/credential/test_credential_verify_simple.sh index d7657c55f..bd0b260b1 100755 --- a/src/credential/test_credential_verify_simple.sh +++ b/src/credential/test_credential_verify_simple.sh @@ -27,15 +27,17 @@ TEST_ATTR="user" SUBJECT_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testsubject | awk '{print $3}') ISSUER_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testissuer | awk '{print $3}') +gnunet-identity -d + # Create delegate (1) SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=testissuer --attribute=$TEST_ATTR --subject=$SUBJECT_KEY --ttl="2019-12-12 10:00:00" -c test_credential_lookup.conf` -gnunet-credential --createSubjectSide --ego=testsubject --import "$SIGNED" --private +gnunet-credential --createSubjectSide --ego=testsubject --import="$SIGNED" --private gnunet-namestore -D -z testsubject # Starting to resolve echo "+++ Starting to Resolve +++" -DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$ISSUER_KEY --attribute=$TEST_ATTR --ego=testsubject -c test_credential_lookup.conf | paste -d, -s` +DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$ISSUER_KEY --attribute=$TEST_ATTR --ego=testsubject -c test_credential_lookup.conf | paste -d, -s - -` echo $DELS gnunet-credential --verify --issuer=$ISSUER_KEY --attribute=$TEST_ATTR --subject=$SUBJECT_KEY --delegate="$DELS" -c test_credential_lookup.conf -- 2.25.1