-fix compile
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Fri, 2 Dec 2016 14:57:58 +0000 (15:57 +0100)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Fri, 2 Dec 2016 14:57:58 +0000 (15:57 +0100)
src/credential/gnunet-service-credential.c

index ed7d249e3fc1400cdb4e8bee711eea809402b59d..aa3c02003a8fcbdaf6abc3a9a0d98cabe024fefa 100644 (file)
@@ -28,6 +28,7 @@
 #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>
@@ -83,8 +84,8 @@ struct AttributeRecordEntry
   /**
    *
    */
-  struct GNUNET_CREDENTIAL_AttributeDelegationRecordData;
-}
+  struct GNUNET_CREDENTIAL_AttributeRecordData record_data;
+};
 
 /**
  * Handle to a lookup operation from api
@@ -264,16 +265,10 @@ send_lookup_response (void* cls,
   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)
@@ -294,22 +289,17 @@ send_lookup_response (void* cls,
                                       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
@@ -335,7 +325,7 @@ send_lookup_response (void* cls,
                              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
@@ -343,10 +333,10 @@ send_lookup_response (void* cls,
    */
   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++;
   }