#include "gnunet_statistics_service.h"
#include "credential.h"
#include "gnunet_protocols.h"
+#include "gnunet_signatures.h"
// For Looking up GNS request
#include <gnunet_dnsparser_lib.h>
/**
*
*/
- struct GNUNET_CREDENTIAL_AttributeDelegationRecordData;
-}
+ struct GNUNET_CREDENTIAL_AttributeRecordData record_data;
+};
/**
* Handle to a lookup operation from api
struct GNUNET_MQ_Envelope *env;
struct VerifyResultMessage *rmsg;
const struct GNUNET_CREDENTIAL_CredentialRecordData *crd;
- struct GNUNET_CREDENTIAL_AttributeDelegationRecordData *adrd;
struct CredentialRecordEntry *cr_entry;
- struct AttributeRecordEntry *attr_entry;
- bool cred_verified;
+ int cred_verified;
cred_record_count = 0;
- adrd = GNUNET_CREDENTIAL_AttributeDelegationRecordData
- GNUNET_CONTAINER_DLL_insert_tail (vrh->attr_queue_head,
- vrh->attr_queue_tail,
- attr_entry);
for (i=0; i < rd_count; i++)
{
if (GNUNET_GNSRECORD_TYPE_CREDENTIAL != rd[i].record_type)
vrh->cred_chain_tail,
cr_entry);
- if(GNUNET_CRYPTO_ecdsa_verify(GNUNET_SIGNATURE_PURPOSE_CREDENTIAL, purpose, sig, issuer_key))
+ if(GNUNET_OK == GNUNET_CRYPTO_ecdsa_verify(GNUNET_SIGNATURE_PURPOSE_CREDENTIAL,
+ &crd->purpose,
+ &crd->sig, &crd->issuer_key))
{
- cred_verified = true;
+ cred_verified = GNUNET_YES;
break;
}
}
- /**
- * Check for attributes from the issuer and follow the chain
- * till you get the required subject's attributes
- */
- if(cred_verified != true){
- for(i=0 ; i < rd_count ; i++){
-
/**
* TODO
GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT);
//Assign id so that client can find associated request
rmsg->id = vrh->request_id;
- rmsg->ad_count = htonl (attr_record_count);
+ rmsg->ad_count = htonl (cred_record_count);
/**
* Get serialized record data
*/
i = 0;
struct GNUNET_CREDENTIAL_CredentialRecordData *tmp_record = (struct GNUNET_CREDENTIAL_CredentialRecordData*) &rmsg[1];
- for (ar_entry = vrh->attr_chain_head; NULL != ar_entry; ar_entry = ar_entry->next)
+ for (cr_entry = vrh->cred_chain_head; NULL != cr_entry; cr_entry = cr_entry->next)
{
memcpy (tmp_record,
- &ar_entry->record_data,
+ &cr_entry->record_data,
sizeof (struct GNUNET_CREDENTIAL_CredentialRecordData));
tmp_record++;
}