aboutsummaryrefslogtreecommitdiff
path: root/src/identity-provider/test_idp_revoke.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/identity-provider/test_idp_revoke.sh')
-rwxr-xr-xsrc/identity-provider/test_idp_revoke.sh60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/identity-provider/test_idp_revoke.sh b/src/identity-provider/test_idp_revoke.sh
new file mode 100755
index 000000000..d5c2c3f77
--- /dev/null
+++ b/src/identity-provider/test_idp_revoke.sh
@@ -0,0 +1,60 @@
1#!/bin/bash
2trap "gnunet-arm -e -c test_idp.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_idp.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_idp.conf
27gnunet-identity -C alice -c test_idp.conf
28gnunet-identity -C bob -c test_idp.conf
29gnunet-identity -C eve -c test_idp.conf
30ALICE_KEY=$(gnunet-identity -d -c test_idp.conf | grep alice | awk '{print $3}')
31BOB_KEY=$(gnunet-identity -d -c test_idp.conf | grep bob | awk '{print $3}')
32EVE_KEY=$(gnunet-identity -d -c test_idp.conf | grep eve | awk '{print $3}')
33
34gnunet-idp -e alice -a email -V john@doe.gnu -c test_idp.conf
35gnunet-idp -e alice -a name -V John -c test_idp.conf
36TICKET_BOB=$(gnunet-idp -e alice -i "email,name" -r $BOB_KEY -c test_idp.conf | awk '{print $1}')
37#gnunet-idp -e bob -C $TICKET_BOB -c test_idp.conf
38TICKET_EVE=$(gnunet-idp -e alice -i "email" -r $EVE_KEY -c test_idp.conf | awk '{print $1}')
39
40
41#echo "Consuming $TICKET"
42#gnunet-idp -e eve -C $TICKET_EVE -c test_idp.conf
43gnunet-idp -e alice -R $TICKET_EVE -c test_idp.conf
44
45gnunet-idp -e eve -C $TICKET_EVE -c test_idp.conf > /dev/null 2>&1
46if test $? == 0
47then
48 echo "Eve can still resolve attributes..."
49 gnunet-arm -e -c test_idp.conf
50 exit 1
51fi
52gnunet-idp -e bob -C $TICKET_BOB -c test_idp.conf > /dev/null 2>&1
53if test $? != 0
54then
55 echo "Bob cannot resolve attributes..."
56 gnunet-arm -e -c test_idp.conf
57 exit 1
58fi
59
60gnunet-arm -e -c test_idp.conf