2 trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
4 LOCATION=$(which gnunet-config)
7 LOCATION="gnunet-config"
9 $LOCATION --version 1> /dev/null
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
16 rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
21 which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22 gnunet-arm -s -c test_abd_lookup.conf
24 gnunet-identity -C a -c test_abd_lookup.conf
25 gnunet-identity -C b -c test_abd_lookup.conf
26 gnunet-identity -C c -c test_abd_lookup.conf
27 gnunet-identity -C d -c test_abd_lookup.conf
28 gnunet-identity -C e -c test_abd_lookup.conf
29 gnunet-identity -C f -c test_abd_lookup.conf
30 gnunet-identity -C g -c test_abd_lookup.conf
31 AKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep a | awk '{print $3}')
32 BKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep b | awk '{print $3}')
33 CKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep c | awk '{print $3}')
34 DKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep d | awk '{print $3}')
35 EKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep e | awk '{print $3}')
36 FKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep f | awk '{print $3}')
37 GKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep g | awk '{print $3}')
48 gnunet-abd --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_abd_lookup.conf
49 gnunet-namestore -D -z a
50 gnunet-abd --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c" --ttl=5m -c test_abd_lookup.conf
51 gnunet-namestore -D -z b
53 SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
54 gnunet-abd --createSubjectSide --ego=d --import="$SIGNED"
55 gnunet-namestore -D -z d
56 SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
57 gnunet-abd --createSubjectSide --ego=e --import="$SIGNED"
58 gnunet-namestore -D -z e
59 SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=e --attribute="e" --subject="$FKEY f" --ttl="2019-12-12 10:00:00"`
60 gnunet-abd --createSubjectSide --ego=f --import="$SIGNED"
61 gnunet-namestore -D -z f
62 SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=f --attribute="f" --subject="$GKEY" --ttl="2019-12-12 10:00:00"`
63 gnunet-abd --createSubjectSide --ego=g --import="$SIGNED" --private
64 gnunet-namestore -D -z g
67 echo "+++ Starting to Resolve +++"
69 DELS=`$DO_TIMEOUT gnunet-abd --collect --issuer=$AKEY --attribute="a" --ego=g --forward --backward -c test_abd_lookup.conf | paste -d, -s - -`
71 echo gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate=\'$DELS\' --forward --backward -c test_abd_lookup.conf
72 gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate="$DELS" --forward --backward -c test_abd_lookup.conf
77 gnunet-namestore -z a -d -n "a" -t ATTR -c test_abd_lookup.conf
78 gnunet-namestore -z b -d -n "b" -t ATTR -c test_abd_lookup.conf
79 gnunet-namestore -z d -d -n "@" -t DEL -c test_abd_lookup.conf
80 gnunet-namestore -z e -d -n "@" -t DEL -c test_abd_lookup.conf
81 gnunet-namestore -z f -d -n "@" -t DEL -c test_abd_lookup.conf
82 gnunet-namestore -z g -d -n "@" -t DEL -c test_abd_lookup.conf
84 gnunet-arm -e -c test_abd_lookup.conf
90 echo "FAIL: Failed to verify credential."