diff options
-rw-r--r-- | po/POTFILES.in | 8 | ||||
-rw-r--r-- | src/credential/gnunet-service-credential.c | 11 | ||||
-rwxr-xr-x | src/credential/test_credential_verify.sh | 59 |
3 files changed, 54 insertions, 24 deletions
diff --git a/po/POTFILES.in b/po/POTFILES.in index 03cf22279..b3cc2b3ee 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in | |||
@@ -71,6 +71,10 @@ src/core/gnunet-service-core.c | |||
71 | src/core/gnunet-service-core_kx.c | 71 | src/core/gnunet-service-core_kx.c |
72 | src/core/gnunet-service-core_sessions.c | 72 | src/core/gnunet-service-core_sessions.c |
73 | src/core/gnunet-service-core_typemap.c | 73 | src/core/gnunet-service-core_typemap.c |
74 | src/credential/credential_api.c | ||
75 | src/credential/gnunet-credential.c | ||
76 | src/credential/gnunet-service-credential.c | ||
77 | src/credential/plugin_gnsrecord_credential.c | ||
74 | src/curl/curl.c | 78 | src/curl/curl.c |
75 | src/curl/curl_reschedule.c | 79 | src/curl/curl_reschedule.c |
76 | src/datacache/datacache.c | 80 | src/datacache/datacache.c |
@@ -244,7 +248,11 @@ src/nat/gnunet-helper-nat-server-windows.c | |||
244 | src/nat/gnunet-nat.c | 248 | src/nat/gnunet-nat.c |
245 | src/nat/gnunet-nat-server.c | 249 | src/nat/gnunet-nat-server.c |
246 | src/nat/gnunet-service-nat.c | 250 | src/nat/gnunet-service-nat.c |
251 | src/nat/gnunet-service-nat_helper.c | ||
252 | src/nat/gnunet-service-nat_stun.c | ||
247 | src/nat/nat_api.c | 253 | src/nat/nat_api.c |
254 | src/nat/nat_api_stun.c | ||
255 | src/nat/nat_api_test.c | ||
248 | src/nat/nat_auto.c | 256 | src/nat/nat_auto.c |
249 | src/nat/nat.c | 257 | src/nat/nat.c |
250 | src/nat/nat_mini.c | 258 | src/nat/nat_mini.c |
diff --git a/src/credential/gnunet-service-credential.c b/src/credential/gnunet-service-credential.c index 9f7b60f1f..f07c777d6 100644 --- a/src/credential/gnunet-service-credential.c +++ b/src/credential/gnunet-service-credential.c | |||
@@ -476,11 +476,16 @@ start_backward_resolution (void* cls, | |||
476 | strcpy (issuer_attribute_name, | 476 | strcpy (issuer_attribute_name, |
477 | (char*)&vrh->current_attribute->data[1]); | 477 | (char*)&vrh->current_attribute->data[1]); |
478 | char *next_attr = strtok (issuer_attribute_name, "."); | 478 | char *next_attr = strtok (issuer_attribute_name, "."); |
479 | GNUNET_asprintf (&lookup_attr, | 479 | GNUNET_asprintf (&lookup_attr, |
480 | "%s.gnu", | 480 | "%s.gnu", |
481 | next_attr); | 481 | next_attr); |
482 | next_attr += strlen (next_attr) + 1; | 482 | if (strlen (next_attr) == strlen ((char*)&vrh->current_attribute->data[1])) |
483 | vrh->current_attribute->attr_trailer = GNUNET_strdup (next_attr); | 483 | { |
484 | vrh->current_attribute->attr_trailer = NULL; | ||
485 | } else { | ||
486 | next_attr += strlen (next_attr) + 1; | ||
487 | vrh->current_attribute->attr_trailer = GNUNET_strdup (next_attr); | ||
488 | } | ||
484 | 489 | ||
485 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 490 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
486 | "Looking up %s\n", lookup_attr); | 491 | "Looking up %s\n", lookup_attr); |
diff --git a/src/credential/test_credential_verify.sh b/src/credential/test_credential_verify.sh index ab3c78f41..3b76d20e5 100755 --- a/src/credential/test_credential_verify.sh +++ b/src/credential/test_credential_verify.sh | |||
@@ -15,39 +15,56 @@ 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 | # (1) Authority.test -> Intermediate.org.user | 18 | # (1) Service.user -> GNU.project.member |
19 | # (2) Intermediate.org -> Issuer | 19 | # (2) GNU.project -> GNUnet |
20 | # (3) Issuer.user -> Subject | 20 | # (3) GNUnet.member -> GNUnet.developer |
21 | # (4) GNUnet.member -> GNUnet.user | ||
22 | # (5) GNUnet.developer -> Alice | ||
21 | 23 | ||
22 | 24 | ||
23 | which timeout &> /dev/null && DO_TIMEOUT="timeout 30" | 25 | which timeout &> /dev/null && DO_TIMEOUT="timeout 30" |
24 | gnunet-arm -s -c test_credential_lookup.conf | 26 | gnunet-arm -s -c test_credential_lookup.conf |
25 | gnunet-identity -C testissuer -c test_credential_lookup.conf | 27 | gnunet-identity -C service -c test_credential_lookup.conf |
26 | gnunet-identity -C testsubject -c test_credential_lookup.conf | 28 | gnunet-identity -C alice -c test_credential_lookup.conf |
27 | gnunet-identity -C testintermediate -c test_credential_lookup.conf | 29 | gnunet-identity -C gnu -c test_credential_lookup.conf |
28 | gnunet-identity -C testauthority -c test_credential_lookup.conf | 30 | gnunet-identity -C gnunet -c test_credential_lookup.conf |
29 | 31 | ||
30 | TEST_ATTR="user" | 32 | GNU_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep gnu | grep -v gnunet | awk '{print $3}') |
31 | INTERMEDIATE_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testintermediate | awk '{print $3}') | 33 | ALICE_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep alice | awk '{print $3}') |
32 | SUBJECT_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testsubject | awk '{print $3}') | 34 | GNUNET_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep gnunet | awk '{print $3}') |
33 | ISSUER_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testissuer | awk '{print $3}') | 35 | SERVICE_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep service | awk '{print $3}') |
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` | ||
36 | 36 | ||
37 | TEST_CREDENTIAL="t1" | 37 | USER_ATTR="user" |
38 | gnunet-namestore -p -z testsubject -a -n $TEST_CREDENTIAL -t CRED -V "$CRED" -e 5m -c test_credential_lookup.conf | 38 | GNU_PROJECT_ATTR="project" |
39 | MEMBER_ATTR="member" | ||
40 | DEVELOPER_ATTR="developer" | ||
41 | DEV_ATTR="developer" | ||
42 | TEST_CREDENTIAL="mygnunetcreds" | ||
39 | 43 | ||
40 | INTERMEDIATE_ATTR="org" | 44 | # (1) A service assigns the attribute "user" to all entities that have been assigned "member" by entities that werde assigned "project" from GNU |
41 | gnunet-namestore -p -z testintermediate -a -n $INTERMEDIATE_ATTR -t ATTR -V "$ISSUER_KEY" -e 5m -c test_credential_lookup.conf | 45 | gnunet-namestore -p -z service -a -n $USER_ATTR -t ATTR -V "$GNU_KEY $GNU_PROJECT_ATTR.$MEMBER_ATTR" -e 5m -c test_credential_lookup.conf |
42 | 46 | ||
43 | AUTHORITY_ATTR="test" | 47 | # (2) GNU recognized GNUnet as a GNU project and delegates the "project" attribute |
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 | 48 | gnunet-namestore -p -z gnu -a -n $GNU_PROJECT_ATTR -t ATTR -V "$GNUNET_KEY" -e 5m -c test_credential_lookup.conf |
49 | |||
50 | # (3+4) GNUnet assigns the attribute "member" to all entities gnunet has also assigned "developer" or "user" | ||
51 | gnunet-namestore -p -z gnunet -a -n $MEMBER_ATTR -t ATTR -V "$GNUNET_KEY $DEVELOPER_ATTR" -e 5m -c test_credential_lookup.conf | ||
52 | gnunet-namestore -p -z gnunet -a -n $MEMBER_ATTR -t ATTR -V "$GNUNET_KEY $USER_ATTR" -e 5m -c test_credential_lookup.conf | ||
53 | |||
54 | # (5) GNUnet issues Alice the credential "developer" | ||
55 | CRED=`$DO_TIMEOUT gnunet-credential --issue --ego=gnunet --subject=$ALICE_KEY --attribute=$DEV_ATTR --ttl=5m -c test_credential_lookup.conf` | ||
56 | |||
57 | # Alice stores the credential under "mygnunetcreds" | ||
58 | gnunet-namestore -p -z alice -a -n $TEST_CREDENTIAL -t CRED -V "$CRED" -e 5m -c test_credential_lookup.conf | ||
45 | 59 | ||
46 | #TODO2 Add -z swich like in gnunet-gns | 60 | #TODO2 Add -z swich like in gnunet-gns |
47 | RES_CRED=`gnunet-credential --verify --issuer=$AUTHORITY_KEY --attribute=$AUTHORITY_ATTR --subject=$SUBJECT_KEY --credential=$TEST_CREDENTIAL -c test_credential_lookup.conf` | 61 | RES_CRED=`gnunet-credential --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --credential=$TEST_CREDENTIAL -c test_credential_lookup.conf` |
48 | 62 | ||
49 | #TODO cleanup properly | 63 | #TODO cleanup properly |
50 | gnunet-namestore -z testsubject -d -n $TEST_CREDENTIAL -t CRED -e never -c test_credential_lookup.conf | 64 | gnunet-namestore -z alice -d -n $TEST_CREDENTIAL -t CRED -e never -c test_credential_lookup.conf |
65 | gnunet-namestore -z gnu -d -n $GNU_PROJECT_ATTR -t ATTR -c test_credential_lookup.conf | ||
66 | gnunet-namestore -z gnunet -d -n $MEMBER_ATTR -t ATTR -c test_credential_lookup.conf | ||
67 | gnunet-namestore -z service -d -n $USER_ATTR -t ATTR -c test_credential_lookup.conf | ||
51 | gnunet-arm -e -c test_credential_lookup.conf | 68 | gnunet-arm -e -c test_credential_lookup.conf |
52 | 69 | ||
53 | if [ "$RES_CRED" == "Successful." ] | 70 | if [ "$RES_CRED" == "Successful." ] |