diff options
author | Andreas Ebner <a.e.bner@web.de> | 2019-09-20 10:49:02 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-10-07 12:18:20 +0200 |
commit | 3099a7c25cf6b11b0f1909e5a2651d65c0e921c7 (patch) | |
tree | c8f10fe3551b35e40d6adcb5e1c68771a12a104e /src/credential/test_credential_verify_simple.sh | |
parent | 5be14856a356b087ad97b479efd9b06172fdfd2f (diff) | |
download | gnunet-3099a7c25cf6b11b0f1909e5a2651d65c0e921c7.tar.gz gnunet-3099a7c25cf6b11b0f1909e5a2651d65c0e921c7.zip |
Cleanup TODOs, bugfix in cleanup and start of bidirectional chain resolution:
- removed and/or implemented all remaining TODOs
- fixed a bug in cleanup_handle() which caused to not cleanup correctly when a solution was prematurely found
- delegation_chain_bw/fw_resolution_start() not has a return value to indicate whether a solution was prematurely found
- cleaned up the test_... files (an additional cleanup commit might follow)
Diffstat (limited to 'src/credential/test_credential_verify_simple.sh')
-rwxr-xr-x | src/credential/test_credential_verify_simple.sh | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/credential/test_credential_verify_simple.sh b/src/credential/test_credential_verify_simple.sh index 41afb47b0..d7657c55f 100755 --- a/src/credential/test_credential_verify_simple.sh +++ b/src/credential/test_credential_verify_simple.sh | |||
@@ -15,7 +15,7 @@ fi | |||
15 | 15 | ||
16 | rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f` | 16 | rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f` |
17 | 17 | ||
18 | # (3) Isser.user -> Subject | 18 | # (1) Issuer.user -> Subject |
19 | 19 | ||
20 | 20 | ||
21 | which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30" | 21 | which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30" |
@@ -26,27 +26,29 @@ gnunet-identity -C testsubject -c test_credential_lookup.conf | |||
26 | TEST_ATTR="user" | 26 | TEST_ATTR="user" |
27 | SUBJECT_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testsubject | awk '{print $3}') | 27 | SUBJECT_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testsubject | awk '{print $3}') |
28 | ISSUER_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testissuer | awk '{print $3}') | 28 | ISSUER_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testissuer | awk '{print $3}') |
29 | CRED=`$DO_TIMEOUT gnunet-credential --issue --ego=testissuer --subject=$SUBJECT_KEY --attribute=$TEST_ATTR --ttl=5m -c test_credential_lookup.conf` | ||
30 | 29 | ||
31 | TEST_CREDENTIAL="t1" | 30 | # Create delegate (1) |
32 | gnunet-namestore -p -z testsubject -a -n $TEST_CREDENTIAL -t CRED -V "$CRED" -e 5m -c test_credential_lookup.conf | 31 | 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` |
32 | gnunet-credential --createSubjectSide --ego=testsubject --import "$SIGNED" --private | ||
33 | gnunet-namestore -D -z testsubject | ||
33 | 34 | ||
34 | CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$ISSUER_KEY --attribute=$TEST_ATTR --ego=testsubject -c test_credential_lookup.conf | paste -d, -s` | 35 | # Starting to resolve |
36 | echo "+++ Starting to Resolve +++" | ||
35 | 37 | ||
38 | DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$ISSUER_KEY --attribute=$TEST_ATTR --ego=testsubject -c test_credential_lookup.conf | paste -d, -s` | ||
39 | echo $DELS | ||
40 | gnunet-credential --verify --issuer=$ISSUER_KEY --attribute=$TEST_ATTR --subject=$SUBJECT_KEY --delegate="$DELS" -c test_credential_lookup.conf | ||
36 | 41 | ||
37 | #TODO2 Add -z swich like in gnunet-gns | 42 | RES=$? |
38 | #RES_CRED=`$DO_TIMEOUT gnunet-credential --verify --issuer=$ISSUER_KEY --attribute="$TEST_ATTR" --subject=$SUBJECT_KEY --credential=$TEST_CREDENTIAL -c test_credential_lookup.conf` | ||
39 | RES_CRED=`gnunet-credential --verify --issuer=$ISSUER_KEY --attribute=$TEST_ATTR --subject=$SUBJECT_KEY --credential="$CREDS" -c test_credential_lookup.conf` | ||
40 | 43 | ||
41 | #TODO cleanup properly | 44 | # Cleanup properly |
42 | gnunet-namestore -z testsubject -d -n $TEST_CREDENTIAL -t CRED -e never -c test_credential_lookup.conf | 45 | gnunet-namestore -z testsubject -d -n "@" -t DEL -c test_credential_lookup.conf |
43 | gnunet-identity -D testsubject -c test_credential_lookup.conf | ||
44 | gnunet-arm -e -c test_credential_lookup.conf | 46 | gnunet-arm -e -c test_credential_lookup.conf |
45 | #TODO3 proper test | 47 | |
46 | if [ "$RES_CRED" != "Failed." ] | 48 | if [ "$RES" == 0 ] |
47 | then | 49 | then |
48 | exit 0 | 50 | exit 0 |
49 | else | 51 | else |
50 | echo "FAIL: Failed to verify credential." | 52 | echo "FAIL: Failed to verify credential." |
51 | exit 1 | 53 | exit 1 |
52 | fi | 54 | fi \ No newline at end of file |