diff options
Diffstat (limited to 'src/credential/test_credential_verify.sh')
-rwxr-xr-x | src/credential/test_credential_verify.sh | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/credential/test_credential_verify.sh b/src/credential/test_credential_verify.sh index 6e5ba4647..ab3c78f41 100755 --- a/src/credential/test_credential_verify.sh +++ b/src/credential/test_credential_verify.sh | |||
@@ -31,7 +31,8 @@ TEST_ATTR="user" | |||
31 | INTERMEDIATE_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testintermediate | awk '{print $3}') | 31 | INTERMEDIATE_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testintermediate | awk '{print $3}') |
32 | SUBJECT_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testsubject | awk '{print $3}') | 32 | SUBJECT_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testsubject | awk '{print $3}') |
33 | ISSUER_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testissuer | awk '{print $3}') | 33 | ISSUER_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testissuer | awk '{print $3}') |
34 | CRED=`$DO_TIMEOUT gnunet-credential --issue --ego=testissuer --subject=$SUBJECT_KEY --attribute=$TEST_ATTR -c test_credential_lookup.conf` | 34 | AUTHORITY_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testauthority | awk '{print $3}') |
35 | CRED=`$DO_TIMEOUT gnunet-credential --issue --ego=testissuer --subject=$SUBJECT_KEY --attribute=$TEST_ATTR --ttl=5m -c test_credential_lookup.conf` | ||
35 | 36 | ||
36 | TEST_CREDENTIAL="t1" | 37 | TEST_CREDENTIAL="t1" |
37 | gnunet-namestore -p -z testsubject -a -n $TEST_CREDENTIAL -t CRED -V "$CRED" -e 5m -c test_credential_lookup.conf | 38 | gnunet-namestore -p -z testsubject -a -n $TEST_CREDENTIAL -t CRED -V "$CRED" -e 5m -c test_credential_lookup.conf |
@@ -43,17 +44,13 @@ AUTHORITY_ATTR="test" | |||
43 | gnunet-namestore -p -z testauthority -a -n $AUTHORITY_ATTR -t ATTR -V "$INTERMEDIATE_KEY $INTERMEDIATE_ATTR.$TEST_ATTR" -e 5m -c test_credential_lookup.conf | 44 | gnunet-namestore -p -z testauthority -a -n $AUTHORITY_ATTR -t ATTR -V "$INTERMEDIATE_KEY $INTERMEDIATE_ATTR.$TEST_ATTR" -e 5m -c test_credential_lookup.conf |
44 | 45 | ||
45 | #TODO2 Add -z swich like in gnunet-gns | 46 | #TODO2 Add -z swich like in gnunet-gns |
46 | #RES_CRED=`$DO_TIMEOUT gnunet-credential --verify --issuer=$ISSUER_KEY --attribute="$TEST_ATTR" --subject=$SUBJECT_KEY --credential=$TEST_CREDENTIAL -c test_credential_lookup.conf` | 47 | RES_CRED=`gnunet-credential --verify --issuer=$AUTHORITY_KEY --attribute=$AUTHORITY_ATTR --subject=$SUBJECT_KEY --credential=$TEST_CREDENTIAL -c test_credential_lookup.conf` |
47 | valgrind gnunet-credential --verify --issuer=$AUTHORITY_KEY --attribute=$AUTHORITY_ATTR --subject=$SUBJECT_KEY --credential=$TEST_CREDENTIAL -c test_credential_lookup.conf | ||
48 | 48 | ||
49 | #TODO cleanup properly | 49 | #TODO cleanup properly |
50 | gnunet-namestore -z testsubject -d -n $TEST_CREDENTIAL -t CRED -e never -c test_credential_lookup.conf | 50 | gnunet-namestore -z testsubject -d -n $TEST_CREDENTIAL -t CRED -e never -c test_credential_lookup.conf |
51 | gnunet-arm -e -c test_credential_lookup.conf | 51 | gnunet-arm -e -c test_credential_lookup.conf |
52 | 52 | ||
53 | #TODO3 proper test | 53 | if [ "$RES_CRED" == "Successful." ] |
54 | exit 0 | ||
55 | |||
56 | if [ "$RES_CRED" == "Ok!" ] | ||
57 | then | 54 | then |
58 | exit 0 | 55 | exit 0 |
59 | else | 56 | else |