-fix
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Mon, 24 Apr 2017 15:50:33 +0000 (17:50 +0200)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Mon, 24 Apr 2017 15:50:33 +0000 (17:50 +0200)
src/credential/gnunet-service-credential.c
src/credential/test_credential_verify_and.sh

index 3178b133e1e546e83bcac92ce5314d31cb43b386..be75e485ec375f65b2e573615e93fe7f1f9ad95c 100644 (file)
@@ -961,13 +961,13 @@ handle_verify (void *cls,
   for (i=0;i<credentials_count;i++) {
     cr_entry = GNUNET_new (struct CredentialRecordEntry);
     cr_entry->credential = GNUNET_malloc (sizeof (struct GNUNET_CREDENTIAL_Credential) +
-                                          strlen (credentials[i].issuer_attribute) + 1);
+                                          credentials[i].issuer_attribute_len);
     GNUNET_memcpy (cr_entry->credential,
                    &credentials[i],
                    sizeof (struct GNUNET_CREDENTIAL_Credential));
     GNUNET_memcpy (&cr_entry->credential[1],
                    credentials[i].issuer_attribute,
-                   strlen (credentials[i].issuer_attribute));
+                   credentials[i].issuer_attribute_len);
     cr_entry->credential->issuer_attribute = (char*)&cr_entry->credential[1];
     GNUNET_CONTAINER_DLL_insert_tail (vrh->cred_chain_head,
                                       vrh->cred_chain_tail,
index 833d36f958971c8e5e7dc4b52236b3e8054f720a..9d5c1962e95cbcb01065aa16aded5d9479151176 100755 (executable)
@@ -54,14 +54,14 @@ gnunet-namestore -p -z gnunet -a -n $MEMBER_ATTR -t ATTR -V "$GNUNET_KEY $DEVELO
 CRED1=`$DO_TIMEOUT gnunet-credential --issue --ego=gnunet --subject=$ALICE_KEY --attribute=$DEV_ATTR --ttl=5m -c test_credential_lookup.conf`
 # (5) GNUnet issues Alice the credential "user"
 CRED2=`$DO_TIMEOUT gnunet-credential --issue --ego=gnunet --subject=$ALICE_KEY --attribute=$USER_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 "$CRED1" -e 5m -c test_credential_lookup.conf
 gnunet-namestore -p -z alice -a -n $TEST_CREDENTIAL -t CRED -V "$CRED2" -e 5m -c test_credential_lookup.conf
 
+CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$SERVICE_KEY --attribute=$USER_ATTR --ego=alice -c test_credential_lookup.conf | paste -d, -s`
+
 #TODO2 Add -z swich like in gnunet-gns
-RES_CRED=`gnunet-credential --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --credential=$TEST_CREDENTIAL -c test_credential_lookup.conf`
+RES_CRED=`gnunet-credential --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --credential="$CREDS" -c test_credential_lookup.conf`
 
 
 #TODO cleanup properly