uint32_t d_count = ntohl (vr_msg->d_count);
uint32_t c_count = ntohl (vr_msg->c_count);
struct GNUNET_CREDENTIAL_Delegation d_chain[d_count];
- //TODO rename creds
- struct GNUNET_CREDENTIAL_Delegate creds[c_count];
+ struct GNUNET_CREDENTIAL_Delegate dels[c_count];
GNUNET_CREDENTIAL_CredentialResultProcessor proc;
void *proc_cls;
d_count,
d_chain,
c_count,
- creds));
- if (GNUNET_NO == ntohl (vr_msg->cred_found))
+ dels));
+ if (GNUNET_NO == ntohl (vr_msg->del_found))
{
proc (proc_cls,
0,
d_count,
d_chain,
c_count,
- creds);
+ dels);
}
}
c_msg->subject_key = *subject_key;
c_msg->issuer_key = *issuer_key;
c_msg->issuer_attribute_len = htons(strlen(issuer_attribute));
- //c_msg->resolution_algo = htons(Backward);
- c_msg->resolution_algo = htons(Forward);
+ c_msg->resolution_algo = htons(Backward);
+ //c_msg->resolution_algo = htons(Forward);
GNUNET_memcpy (&c_msg[1],
issuer_attribute,
* @param issuer_key the issuer public key
* @param issuer_attribute the issuer attribute
* @param subject_key the subject public key
- * @param credential_count number of credentials provided
- * @param credentials subject credentials
+ * @param delegate_count number of delegates provided
+ * @param delegates subject delegates
* @param proc function to call on result
* @param proc_cls closure for processor
* @return handle to the queued request
const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
const char *issuer_attribute,
const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
- uint32_t credential_count,
- const struct GNUNET_CREDENTIAL_Delegate *credentials,
+ uint32_t delegate_count,
+ const struct GNUNET_CREDENTIAL_Delegate *delegates,
GNUNET_CREDENTIAL_CredentialResultProcessor proc,
void *proc_cls)
{
size_t nlen;
size_t clen;
- if (NULL == issuer_attribute || NULL == credentials)
+ if (NULL == issuer_attribute || NULL == delegates)
{
GNUNET_break (0);
return NULL;
}
- clen = GNUNET_CREDENTIAL_credentials_get_size (credential_count,
- credentials);
+ clen = GNUNET_CREDENTIAL_delegates_get_size (delegate_count,
+ delegates);
//DEBUG LOG
LOG (GNUNET_ERROR_TYPE_DEBUG,
GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY);
v_msg->id = htonl (vr->r_id);
v_msg->subject_key = *subject_key;
- v_msg->c_count = htonl(credential_count);
+ v_msg->d_count = htonl(delegate_count);
v_msg->issuer_key = *issuer_key;
v_msg->issuer_attribute_len = htons(strlen(issuer_attribute));
- //v_msg->resolution_algo = htons(Backward);
- v_msg->resolution_algo = htons(Forward);
+ v_msg->resolution_algo = htons(Backward);
+ //v_msg->resolution_algo = htons(Forward);
GNUNET_memcpy (&v_msg[1],
issuer_attribute,
strlen (issuer_attribute));
- GNUNET_CREDENTIAL_credentials_serialize (credential_count,
- credentials,
+ GNUNET_CREDENTIAL_delegates_serialize (delegate_count,
+ delegates,
clen,
((char*)&v_msg[1])
+ strlen (issuer_attribute) + 1);
struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
/**
- * Credential DLL
- */
- struct CredentialRecordEntry *cred_chain_head;
-
- /**
- * Credential DLL
- */
- struct CredentialRecordEntry *cred_chain_tail;
-
- /**
- * Credential DLL size
- */
- uint32_t cred_chain_size;
-
- /**
- * Credential DLL
+ * Delegate DLL
*/
struct DelegateRecordEntry *del_chain_head;
/**
- * Credential DLL
+ * Delegate DLL
*/
struct DelegateRecordEntry *del_chain_tail;
/**
- * Credential DLL size
+ * Delegate DLL size
*/
uint32_t del_chain_size;
enum direction resolution_algo;
/**
- * Credential iterator
- */
- struct GNUNET_NAMESTORE_ZoneIterator *cred_collection_iter;
-
- /**
- * Credential iterator
+ * Delegate iterator for lookup
*/
struct GNUNET_NAMESTORE_QueueEntry *dele_qe;
-
- /**
- * Collect task
- */
- struct GNUNET_SCHEDULER_Task *collect_next_task;
};
static void
cleanup_handle (struct VerifyRequestHandle *vrh)
{
- struct CredentialRecordEntry *cr_entry;
+ struct DelegateRecordEntry *del_entry;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Cleaning up...\n");
if (NULL != vrh->lookup_request) {
GNUNET_GNS_lookup_cancel (vrh->lookup_request);
}
cleanup_delegation_set (vrh->root_set);
GNUNET_free_non_null (vrh->issuer_attribute);
- for (cr_entry = vrh->cred_chain_head; NULL != vrh->cred_chain_head;
- cr_entry = vrh->cred_chain_head) {
- GNUNET_CONTAINER_DLL_remove (vrh->cred_chain_head,
- vrh->cred_chain_tail,
- cr_entry);
- GNUNET_free_non_null (cr_entry->credential);
- GNUNET_free (cr_entry);
+ for (del_entry = vrh->del_chain_head; NULL != vrh->del_chain_head;
+ del_entry = vrh->del_chain_head) {
+ GNUNET_CONTAINER_DLL_remove (vrh->del_chain_head,
+ vrh->del_chain_tail,
+ del_entry);
+ GNUNET_free_non_null (del_entry->delegate);
+ GNUNET_free (del_entry);
}
GNUNET_free (vrh);
}
struct DelegationChainResultMessage *rmsg;
struct DelegationChainEntry *dce;
struct GNUNET_CREDENTIAL_Delegation dd[vrh->delegation_chain_size];
- //TODO rename cred/cd
//TODO rename all methods using credential
- struct GNUNET_CREDENTIAL_Delegate cred[vrh->del_chain_size];
- struct DelegateRecordEntry *cd;
+ struct GNUNET_CREDENTIAL_Delegate dele[vrh->del_chain_size];
+ struct DelegateRecordEntry *del;
struct DelegateRecordEntry *tmp;
size_t size;
}
// Remove all not needed credentials
- for (cd = vrh->del_chain_head; NULL != cd;) {
- if (cd->refcount > 0) {
- cd = cd->next;
+ for (del = vrh->del_chain_head; NULL != del;) {
+ if (del->refcount > 0) {
+ del = del->next;
continue;
}
- tmp = cd;
- cd = cd->next;
+ tmp = del;
+ del = del->next;
GNUNET_CONTAINER_DLL_remove (vrh->del_chain_head,
vrh->del_chain_tail,
tmp);
vrh->del_chain_size--;
}
- /**
- * Get serialized record data
- * Append at the end of rmsg
- */
- cd = vrh->del_chain_head;
+ // Get serialized record data
+ // Append at the end of rmsg
+ del = vrh->del_chain_head;
for (uint32_t i = 0; i < vrh->del_chain_size; i++) {
- cred[i].issuer_key = cd->delegate->issuer_key;
- cred[i].subject_key = cd->delegate->subject_key;
- cred[i].issuer_attribute_len
- = strlen (cd->delegate->issuer_attribute) + 1;
- cred[i].issuer_attribute = cd->delegate->issuer_attribute;
- cred[i].expiration = cd->delegate->expiration;
- cred[i].signature = cd->delegate->signature;
- cd = cd->next;
+ dele[i].issuer_key = del->delegate->issuer_key;
+ dele[i].subject_key = del->delegate->subject_key;
+ dele[i].issuer_attribute_len
+ = strlen (del->delegate->issuer_attribute) + 1;
+ dele[i].issuer_attribute = del->delegate->issuer_attribute;
+ dele[i].expiration = del->delegate->expiration;
+ dele[i].signature = del->delegate->signature;
+ del = del->next;
}
size = GNUNET_CREDENTIAL_delegation_chain_get_size (vrh->delegation_chain_size,
dd,
vrh->del_chain_size,
- cred);
+ dele);
env = GNUNET_MQ_msg_extra (rmsg,
size,
GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT);
rmsg->c_count = htonl (vrh->del_chain_size);
if (0 < vrh->del_chain_size)
- rmsg->cred_found = htonl (GNUNET_YES);
+ rmsg->del_found = htonl (GNUNET_YES);
else
- rmsg->cred_found = htonl (GNUNET_NO);
+ rmsg->del_found = htonl (GNUNET_NO);
GNUNET_assert (
-1
!= GNUNET_CREDENTIAL_delegation_chain_serialize (vrh->delegation_chain_size,
dd,
vrh->del_chain_size,
- cred,
+ dele,
size,
(char *)&rmsg[1]));
}
static void
-test_resolution (void *cls,
+forward_resolution (void *cls,
uint32_t rd_count,
const struct GNUNET_GNSRECORD_Data *rd)
{
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Found: Solution\n");
- // Add to delegation_chain
+ // Add found solution into delegation_chain
struct DelegationSetQueueEntry *tmp_set;
for (tmp_set = ds_entry; NULL != tmp_set->parent_queue_entry;
tmp_set = tmp_set->parent_queue_entry->parent_set) {
tmp_set->delegation_chain_entry);
}
}
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "tmpentrylast %s %s\n",
- GNUNET_CRYPTO_ecdsa_public_key_to_string(&vrh->delegation_chain_head->subject_key),
- vrh->delegation_chain_head->subject_attribute);
// Increase refcount for this delegate
for (struct DelegateRecordEntry *del_entry = vrh->del_chain_head; del_entry != NULL; del_entry = del_entry->next) {
&del->issuer_key,
GNUNET_GNSRECORD_TYPE_DELEGATE,
GNUNET_GNS_LO_DEFAULT,
- &test_resolution,
+ &forward_resolution,
ds_entry);
}
dq_entry->required_solutions = ntohl (sets->set_count);
dq_entry->parent_set = current_set;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "# New OR entry into queue\n");
-
GNUNET_CONTAINER_DLL_insert (current_set->queue_entries_head,
current_set->queue_entries_tail,
dq_entry);
// Backtrack
for (tmp_set = ds_entry; NULL != tmp_set->parent_queue_entry;
tmp_set = tmp_set->parent_queue_entry->parent_set) {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "# %s\n", tmp_set->unresolved_attribute_delegation);
tmp_set->parent_queue_entry->required_solutions--;
if (NULL != tmp_set->delegation_chain_entry) {
vrh->delegation_chain_size++;
issuer_attribute_name[strlen (ds_entry->unresolved_attribute_delegation)
+ 1];
strcpy (issuer_attribute_name, ds_entry->unresolved_attribute_delegation);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "# Issuer Att Name: %s\n", issuer_attribute_name);
char *next_attr = strtok (issuer_attribute_name, ".");
if (NULL == next_attr) {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
* @param cls the closure (our client lookup handle)
*/
static void
-delegation_chain_resolution_start (void *cls)
+delegation_chain_bw_resolution_start (void *cls)
{
struct VerifyRequestHandle *vrh = cls;
struct DelegationSetQueueEntry *ds_entry;
return;
}
- /**
- * Check for attributes from the issuer and follow the chain
- * till you get the required subject's attributes
- */
+
+ //Check for attributes from the issuer and follow the chain
+ //till you get the required subject's attributes
char issuer_attribute_name[strlen (vrh->issuer_attribute) + 1];
strcpy (issuer_attribute_name, vrh->issuer_attribute);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
ds_entry->lookup_attribute = GNUNET_strdup (vrh->issuer_attribute);
vrh->root_set = ds_entry;
vrh->pending_lookups = 1;
+
// Start with backward resolution
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "# Start Backward Resolution\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start Backward Resolution\n");
ds_entry->lookup_request = GNUNET_GNS_lookup (gns,
issuer_attribute_name,
// ds_entry created belongs to the first lookup, vrh still has the
// issuer+attr we look for
for (del_entry = vrh->del_chain_head; del_entry != NULL; del_entry = del_entry->next) {
- //char issuer_attribute_name[strlen (vrh->issuer_attribute) + 1];
- //strcpy (issuer_attribute_name, vrh->issuer_attribute);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Looking for %s.%s\n",
GNUNET_memcpy (ds_entry->issuer_key,
&del_entry->delegate->subject_key,
sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
- //ds_entry->issuer_attribute = GNUNET_strdup (vrh->issuer_attribute);
ds_entry->attr_trailer = GNUNET_strdup(del_entry->delegate->issuer_attribute);
ds_entry->handle = vrh;
- // TODO: no lookup attribute for forward?
- //ds_entry->lookup_attribute = GNUNET_strdup (vrh->issuer_attribute);
vrh->root_set = ds_entry;
vrh->pending_lookups ++;
// Start with forward resolution
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "# Start Forward Resolution\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start Forward Resolution\n");
ds_entry->lookup_request = GNUNET_GNS_lookup (gns,
GNUNET_GNS_EMPTY_LABEL_AT,
&del_entry->delegate->issuer_key, // issuer_key,
GNUNET_GNSRECORD_TYPE_DELEGATE,
GNUNET_GNS_LO_DEFAULT,
- &test_resolution,
+ &forward_resolution,
ds_entry);
}
}
struct VerifyRequestHandle *vrh;
struct GNUNET_SERVICE_Client *client = cls;
struct DelegateRecordEntry *del_entry;
- uint32_t credentials_count;
- uint32_t credential_data_size;
+ uint32_t delegate_count;
+ uint32_t delegate_data_size;
char attr[GNUNET_CREDENTIAL_MAX_LENGTH + 1];
char issuer_attribute[GNUNET_CREDENTIAL_MAX_LENGTH + 1];
char *attrptr = attr;
- char *credential_data;
+ char *delegate_data;
const char *utf_in;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received VERIFY message\n");
}
// Parse delegates from verifaction message
- credentials_count = ntohl (v_msg->c_count);
- credential_data_size = ntohs (v_msg->header.size)
+ delegate_count = ntohl (v_msg->d_count);
+ delegate_data_size = ntohs (v_msg->header.size)
- sizeof (struct VerifyMessage)
- ntohs (v_msg->issuer_attribute_len) - 1;
- struct GNUNET_CREDENTIAL_Delegate credentials[credentials_count];
- memset (credentials,
+ struct GNUNET_CREDENTIAL_Delegate delegates[delegate_count];
+ memset (delegates,
0,
- sizeof (struct GNUNET_CREDENTIAL_Delegate) * credentials_count);
- credential_data = (char *)&v_msg[1] + ntohs (v_msg->issuer_attribute_len) + 1;
+ sizeof (struct GNUNET_CREDENTIAL_Delegate) * delegate_count);
+ delegate_data = (char *)&v_msg[1] + ntohs (v_msg->issuer_attribute_len) + 1;
if (GNUNET_OK
- != GNUNET_CREDENTIAL_credentials_deserialize (credential_data_size,
- credential_data,
- credentials_count,
- credentials)) {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot deserialize credentials!\n");
+ != GNUNET_CREDENTIAL_delegates_deserialize (delegate_data_size,
+ delegate_data,
+ delegate_count,
+ delegates)) {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot deserialize delegates!\n");
send_lookup_response (vrh);
return;
}
// Prepare vrh delegation chain for later validation
- for (uint32_t i = 0; i < credentials_count; i++) {
+ for (uint32_t i = 0; i < delegate_count; i++) {
del_entry = GNUNET_new (struct DelegateRecordEntry);
del_entry->delegate
= GNUNET_malloc (sizeof (struct GNUNET_CREDENTIAL_Delegate)
- + credentials[i].issuer_attribute_len + 1);
+ + delegates[i].issuer_attribute_len + 1);
GNUNET_memcpy (del_entry->delegate,
- &credentials[i],
+ &delegates[i],
sizeof (struct GNUNET_CREDENTIAL_Delegate));
GNUNET_memcpy (&del_entry->delegate[1],
- credentials[i].issuer_attribute,
- credentials[i].issuer_attribute_len);
+ delegates[i].issuer_attribute,
+ delegates[i].issuer_attribute_len);
del_entry->delegate->issuer_attribute_len
- = credentials[i].issuer_attribute_len;
+ = delegates[i].issuer_attribute_len;
del_entry->delegate->issuer_attribute = (char *)&del_entry->delegate[1];
GNUNET_CONTAINER_DLL_insert_tail (vrh->del_chain_head,
vrh->del_chain_tail,
// Switch resolution algo
if(Backward == vrh->resolution_algo){
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "+++++++++++++++++backward\n");
- delegation_chain_resolution_start (vrh);
+ delegation_chain_bw_resolution_start (vrh);
} else if (Forward == vrh->resolution_algo){
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "+++++++++++++++++forward\n");
delegation_chain_fw_resolution_start (vrh);
} else{
//TODO
}
static void
-handle_cred_collection_error_cb (void *cls)
+handle_delegate_collection_error_cb (void *cls)
{
struct VerifyRequestHandle *vrh = cls;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Got disconnected from namestore database.\n");
- vrh->cred_collection_iter = NULL;
+ vrh->dele_qe = NULL;
send_lookup_response (vrh);
}
static void
-handle_cred_collection_finished_cb (void *cls)
+delegate_collection_finished (void *cls)
{
struct VerifyRequestHandle *vrh = cls;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Done collecting credentials.\n");
- vrh->cred_collection_iter = NULL;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Done collecting delegates.\n");
+
if(Backward == vrh->resolution_algo){
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "+++++++++++++++++backward\n");
- delegation_chain_resolution_start (vrh);
+ delegation_chain_bw_resolution_start (vrh);
} else if (Forward == vrh->resolution_algo){
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "+++++++++++++++++forward\n");
delegation_chain_fw_resolution_start (vrh);
} else{
//TODO
}
static void
-tmp_handle_cred_collection_cb (void *cls,
+handle_delegate_collection_cb (void *cls,
const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
const char *label,
unsigned int rd_count,
del_entry);
vrh->del_chain_size++;
}
- // No need to collect next, should have all already
- //vrh->collect_next_task = GNUNET_SCHEDULER_add_now (&collect_next, vrh);
- handle_cred_collection_finished_cb(vrh);
+
+ delegate_collection_finished(vrh);
}
static void
send_lookup_response (vrh);
return;
}
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Getting credentials for subject\n");
- /**
- * First, get attribute from subject
- */
- // TODO NAMESTORE_lookup auf empty label statt iteration, iteration genutzt da nicht wusste welches label
- /*vrh->cred_collection_iter = GNUNET_NAMESTORE_zone_iteration_start (
- namestore,
- &c_msg->subject_key,
- &handle_cred_collection_error_cb,
- vrh,
- &handle_cred_collection_cb,
- vrh,
- &handle_cred_collection_finished_cb,
- vrh);*/
- //TODO rename tmp_handle_... and test_resolution..
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Getting delegates for subject\n");
+
+ // Get all delegates from subject
vrh->dele_qe = GNUNET_NAMESTORE_records_lookup (namestore,
&c_msg->subject_key,
GNUNET_GNS_EMPTY_LABEL_AT,
- &handle_cred_collection_error_cb,
+ &handle_delegate_collection_error_cb,
vrh,
- &tmp_handle_cred_collection_cb,
+ &handle_delegate_collection_cb,
vrh);
GNUNET_SERVICE_client_continue (vrh->client);
}
REG_STUD_ATTR="student"
END_ATTR="end"
+# FORWARD, subject side stored
SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="a" --subject="$AKEY b.c" --ttl="2019-12-12 10:00:00"`
gnunet-credential --createSubjectSide --ego=a --import "$SIGNED"
gnunet-namestore -D -z a
gnunet-namestore -D -z g
-
-TEST_CREDENTIAL="mygnunetcreds"
-# Own issuer side storage:
-#gnunet-credential --createIssuerSide --ego=epub --attribute="issside" --subject="$EORG_KEY asd" --ttl=5m
-
-#gnunet-namestore -D -z epub
-
-# Own subject side storage:
-#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY" --ttl="2019-12-12 10:00:00"`
-#gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED"
-
-#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY efghijklmno" --ttl="2019-12-12 10:00:00"`
-#gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED"
-
-#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd" --subject="$EORG_KEY efghijklmno.pqr" --ttl="2019-12-12 10:00:00"`
-#gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED"
-
-#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=epub --attribute="abcd.stu" --subject="$EORG_KEY efghijklmno.pqr" --ttl="2019-12-12 10:00:00"`
-#gnunet-credential --createSubjectSide --ego=eorg --import "$SIGNED"
-
-#SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=stateu --attribute="aaa" --subject="$EPUB_KEY bbbb" --ttl="2019-12-12 10:00:00"`
-#gnunet-credential --createSubjectSide --ego=epub --import "$SIGNED"
-
-#gnunet-namestore -D -z eorg
-
+# BACKWARD, issuer side stored
# (1) EPub assigns the attribute "discount" to all entities that have been assigned "preferred" by EOrg
-gnunet-namestore -p -z epub -a -n $DISC_ATTR -t ATTR -V "$EORG_KEY $PREF_ATTR" -e 5m -c test_credential_lookup.conf
-gnunet-namestore -p -z epub -a -n "random" -t ATTR -V "$GKEY random" -e 5m -c test_credential_lookup.conf
+gnunet-credential --createIssuerSide --ego=epub --attribute=$DISC_ATTR --subject="$EORG_KEY $PREF_ATTR" --ttl=5m -c test_credential_lookup.conf
# (2) EOrg assigns the attribute "preferred" to all entities that have been assigned "student" by StateU
-gnunet-namestore -p -z eorg -a -n $PREF_ATTR -t ATTR -V "$STATEU_KEY $STATE_STUD_ATTR" -e 5m -c test_credential_lookup.conf
+gnunet-credential --createIssuerSide --ego=eorg --attribute=$PREF_ATTR --subject="$STATEU_KEY $STATE_STUD_ATTR" --ttl=5m -c test_credential_lookup.conf
# (3) StateU assigns the attribute "student" to all entities that have been asssigned "student" by RegistrarB
-gnunet-namestore -p -z stateu -a -n $STATE_STUD_ATTR -t ATTR -V "$REGISTRARB_KEY $REG_STUD_ATTR" -e 5m -c test_credential_lookup.conf
+gnunet-credential --createIssuerSide --ego=stateu --attribute=$STATE_STUD_ATTR --subject="$REGISTRARB_KEY $REG_STUD_ATTR" --ttl=5m -c test_credential_lookup.conf
# (4) RegistrarB issues Alice the credential "student"
-CRED=`$DO_TIMEOUT gnunet-credential --issue --ego=registrarb --subject=$ALICE_KEY --attribute=$REG_STUD_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
-
SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=registrarb --attribute="$REG_STUD_ATTR" --subject="$ALICE_KEY" --ttl="2019-12-12 10:00:00"`
gnunet-credential --createSubjectSide --ego=alice --import "$SIGNED"
# Starting to resolve
-echo "+++++Starting Collect"
+echo "+++ Starting to Resolve +++"
-CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=g -c test_credential_lookup.conf | paste -d, -s`
-echo $CREDS
-echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --credential=\'$CREDS\' -c test_credential_lookup.conf
-RES_CRED=`gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --credential="$CREDS" -c test_credential_lookup.conf`
-
-#CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice -c test_credential_lookup.conf | paste -d, -s`
+#CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=g -c test_credential_lookup.conf | paste -d, -s`
#echo $CREDS
-#echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential=\'$CREDS\' -c test_credential_lookup.conf
-#RES_CRED=`gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential="$CREDS" -c test_credential_lookup.conf`
+#echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --credential=\'$CREDS\' -c test_credential_lookup.conf
+#RES_CRED=`gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --credential="$CREDS" -c test_credential_lookup.conf`
+
+CREDS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice -c test_credential_lookup.conf | paste -d, -s`
+echo $CREDS
+echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential=\'$CREDS\' -c test_credential_lookup.conf
+RES_CRED=`gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --credential="$CREDS" -c test_credential_lookup.conf`
# Cleanup properly
-gnunet-namestore -z alice -d -n $TEST_CREDENTIAL -t CRED -e never -c test_credential_lookup.conf
gnunet-namestore -z epub -d -n $DISC_ATTR -t ATTR -c test_credential_lookup.conf
gnunet-namestore -z eorg -d -n $PREF_ATTR -t ATTR -c test_credential_lookup.conf
gnunet-namestore -z stateu -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf