struct CredentialRecordEntry *cred_pointer;
const char *attribute;
const char *cred_attribute;
- char *issuer_key;
- char *cred_issuer_key;
- const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key_ecdsa;
- const struct GNUNET_CRYPTO_EcdsaPublicKey *cred_issuer_key_ecdsa;
for(cred_pointer = vrh->cred_chain_head; cred_pointer != NULL;
cred_pointer = cred_pointer->next){
cred = &cred_pointer->record_data;
- issuer_key_ecdsa = &vrh->attr_pointer->record_data.subject_key;
- cred_issuer_key_ecdsa = &cred_pointer->record_data.issuer_key;
- issuer_key = GNUNET_CRYPTO_ecdsa_public_key_to_string(issuer_key_ecdsa);
- cred_issuer_key = GNUNET_CRYPTO_ecdsa_public_key_to_string(cred_issuer_key_ecdsa);
- if(0 == strcmp(issuer_key,cred_issuer_key))
- {
+ if(0 == memcmp (&vrh->attr_pointer->record_data.subject_key,
+ &cred_pointer->record_data.issuer_key,
+ sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey))){
+
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Found issuer\n");
- }
+
+ }
+
+
+
}
-
-
+
+
//Start from next to head
- for(vrh->attr_pointer = vrh->attr_queue_head->next ; vrh->attr_pointer->next != NULL ;
- vrh->attr_pointer = vrh->attr_pointer->next ){
+ vrh->attr_pointer = vrh->attr_pointer->next;
+
+
+ if(vrh->attr_pointer->next != NULL){
//Start with backward resolution
- GNUNET_GNS_lookup (gns,
- vrh->issuer_attribute,
- &vrh->issuer_key, //issuer_key,
- GNUNET_GNSRECORD_TYPE_ATTRIBUTE,
- GNUNET_GNS_LO_DEFAULT,
- NULL, //shorten_key, always NULL
- &start_backward_resolution,
- vrh);
+ vrh->lookup_request = GNUNET_GNS_lookup (gns,
+ vrh->issuer_attribute,
+ &vrh->issuer_key, //issuer_key,
+ GNUNET_GNSRECORD_TYPE_ATTRIBUTE,
+ GNUNET_GNS_LO_DEFAULT,
+ NULL, //shorten_key, always NULL
+ &start_backward_resolution,
+ vrh);
}
+
}
/**
const struct GNUNET_CREDENTIAL_CredentialRecordData *crd;
struct GNUNET_CRYPTO_EccSignaturePurpose *purp;
struct CredentialRecordEntry *cr_entry;
+ uint32_t cred_verified;
cred_record_count = 0;
struct AttributeRecordEntry *attr_entry;
struct GNUNET_CREDENTIAL_AttributeRecordData *ard =
GNUNET_new(struct GNUNET_CREDENTIAL_AttributeRecordData);
-
+
attr_entry->record_data = *ard;
ard->subject_key = vrh->issuer_key;
GNUNET_CONTAINER_DLL_insert_tail (vrh->attr_queue_head,
if(cred_verified != GNUNET_YES){
- vrh->attr_pointer = vrh->attr_queue_head;
+ vrh->attr_pointer = vrh->attr_pointer->next;
+ if(vrh->attr_pointer != NULL){
- //Start with backward resolution
- GNUNET_GNS_lookup (gns,
- vrh->issuer_attribute,
- &vrh->issuer_key, //issuer_key,
- GNUNET_GNSRECORD_TYPE_ATTRIBUTE,
- GNUNET_GNS_LO_DEFAULT,
- NULL, //shorten_key, always NULL
- &start_backward_resolution,
- vrh);
+ //Start with backward resolution
+ GNUNET_GNS_lookup (gns,
+ vrh->issuer_attribute,
+ &vrh->issuer_key, //issuer_key,
+ GNUNET_GNSRECORD_TYPE_ATTRIBUTE,
+ GNUNET_GNS_LO_DEFAULT,
+ NULL, //shorten_key, always NULL
+ &start_backward_resolution,
+ vrh);
+ }
}