From: Schanzenbach, Martin Date: Wed, 7 Dec 2016 15:43:35 +0000 (+0100) Subject: - fix; more recognizable case in test X-Git-Tag: gnunet-0.11.0rc0~24^2~120 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d0f60b23e15edfd27a0885a3cd0bd6daa765cde3;p=oweals%2Fgnunet.git - fix; more recognizable case in test --- 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 src/core/gnunet-service-core_kx.c src/core/gnunet-service-core_sessions.c src/core/gnunet-service-core_typemap.c +src/credential/credential_api.c +src/credential/gnunet-credential.c +src/credential/gnunet-service-credential.c +src/credential/plugin_gnsrecord_credential.c src/curl/curl.c src/curl/curl_reschedule.c src/datacache/datacache.c @@ -244,7 +248,11 @@ src/nat/gnunet-helper-nat-server-windows.c src/nat/gnunet-nat.c src/nat/gnunet-nat-server.c src/nat/gnunet-service-nat.c +src/nat/gnunet-service-nat_helper.c +src/nat/gnunet-service-nat_stun.c src/nat/nat_api.c +src/nat/nat_api_stun.c +src/nat/nat_api_test.c src/nat/nat_auto.c src/nat/nat.c 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, strcpy (issuer_attribute_name, (char*)&vrh->current_attribute->data[1]); char *next_attr = strtok (issuer_attribute_name, "."); - GNUNET_asprintf (&lookup_attr, + GNUNET_asprintf (&lookup_attr, "%s.gnu", next_attr); - next_attr += strlen (next_attr) + 1; - vrh->current_attribute->attr_trailer = GNUNET_strdup (next_attr); + if (strlen (next_attr) == strlen ((char*)&vrh->current_attribute->data[1])) + { + vrh->current_attribute->attr_trailer = NULL; + } else { + next_attr += strlen (next_attr) + 1; + vrh->current_attribute->attr_trailer = GNUNET_strdup (next_attr); + } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "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 rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f` -# (1) Authority.test -> Intermediate.org.user -# (2) Intermediate.org -> Issuer -# (3) Issuer.user -> Subject +# (1) Service.user -> GNU.project.member +# (2) GNU.project -> GNUnet +# (3) GNUnet.member -> GNUnet.developer +# (4) GNUnet.member -> GNUnet.user +# (5) GNUnet.developer -> Alice which timeout &> /dev/null && DO_TIMEOUT="timeout 30" gnunet-arm -s -c test_credential_lookup.conf -gnunet-identity -C testissuer -c test_credential_lookup.conf -gnunet-identity -C testsubject -c test_credential_lookup.conf -gnunet-identity -C testintermediate -c test_credential_lookup.conf -gnunet-identity -C testauthority -c test_credential_lookup.conf +gnunet-identity -C service -c test_credential_lookup.conf +gnunet-identity -C alice -c test_credential_lookup.conf +gnunet-identity -C gnu -c test_credential_lookup.conf +gnunet-identity -C gnunet -c test_credential_lookup.conf -TEST_ATTR="user" -INTERMEDIATE_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testintermediate | awk '{print $3}') -SUBJECT_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testsubject | awk '{print $3}') -ISSUER_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testissuer | awk '{print $3}') -AUTHORITY_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testauthority | awk '{print $3}') -CRED=`$DO_TIMEOUT gnunet-credential --issue --ego=testissuer --subject=$SUBJECT_KEY --attribute=$TEST_ATTR --ttl=5m -c test_credential_lookup.conf` +GNU_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep gnu | grep -v gnunet | awk '{print $3}') +ALICE_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep alice | awk '{print $3}') +GNUNET_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep gnunet | awk '{print $3}') +SERVICE_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep service | awk '{print $3}') -TEST_CREDENTIAL="t1" -gnunet-namestore -p -z testsubject -a -n $TEST_CREDENTIAL -t CRED -V "$CRED" -e 5m -c test_credential_lookup.conf +USER_ATTR="user" +GNU_PROJECT_ATTR="project" +MEMBER_ATTR="member" +DEVELOPER_ATTR="developer" +DEV_ATTR="developer" +TEST_CREDENTIAL="mygnunetcreds" -INTERMEDIATE_ATTR="org" -gnunet-namestore -p -z testintermediate -a -n $INTERMEDIATE_ATTR -t ATTR -V "$ISSUER_KEY" -e 5m -c test_credential_lookup.conf +# (1) A service assigns the attribute "user" to all entities that have been assigned "member" by entities that werde assigned "project" from GNU +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 -AUTHORITY_ATTR="test" -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 +# (2) GNU recognized GNUnet as a GNU project and delegates the "project" attribute +gnunet-namestore -p -z gnu -a -n $GNU_PROJECT_ATTR -t ATTR -V "$GNUNET_KEY" -e 5m -c test_credential_lookup.conf + +# (3+4) GNUnet assigns the attribute "member" to all entities gnunet has also assigned "developer" or "user" +gnunet-namestore -p -z gnunet -a -n $MEMBER_ATTR -t ATTR -V "$GNUNET_KEY $DEVELOPER_ATTR" -e 5m -c test_credential_lookup.conf +gnunet-namestore -p -z gnunet -a -n $MEMBER_ATTR -t ATTR -V "$GNUNET_KEY $USER_ATTR" -e 5m -c test_credential_lookup.conf + +# (5) GNUnet issues Alice the credential "developer" +CRED=`$DO_TIMEOUT gnunet-credential --issue --ego=gnunet --subject=$ALICE_KEY --attribute=$DEV_ATTR --ttl=5m -c test_credential_lookup.conf` + +# Alice stores the credential under "mygnunetcreds" +gnunet-namestore -p -z alice -a -n $TEST_CREDENTIAL -t CRED -V "$CRED" -e 5m -c test_credential_lookup.conf #TODO2 Add -z swich like in gnunet-gns -RES_CRED=`gnunet-credential --verify --issuer=$AUTHORITY_KEY --attribute=$AUTHORITY_ATTR --subject=$SUBJECT_KEY --credential=$TEST_CREDENTIAL -c test_credential_lookup.conf` +RES_CRED=`gnunet-credential --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --credential=$TEST_CREDENTIAL -c test_credential_lookup.conf` #TODO cleanup properly -gnunet-namestore -z testsubject -d -n $TEST_CREDENTIAL -t CRED -e never -c test_credential_lookup.conf +gnunet-namestore -z alice -d -n $TEST_CREDENTIAL -t CRED -e never -c test_credential_lookup.conf +gnunet-namestore -z gnu -d -n $GNU_PROJECT_ATTR -t ATTR -c test_credential_lookup.conf +gnunet-namestore -z gnunet -d -n $MEMBER_ATTR -t ATTR -c test_credential_lookup.conf +gnunet-namestore -z service -d -n $USER_ATTR -t ATTR -c test_credential_lookup.conf gnunet-arm -e -c test_credential_lookup.conf if [ "$RES_CRED" == "Successful." ]