aboutsummaryrefslogtreecommitdiff
path: root/src/credential/gnunet-service-credential.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2016-12-02 15:57:58 +0100
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2016-12-02 15:57:58 +0100
commit59f9630b8be3dcde087a4ef6956217704d0dacb4 (patch)
treebf36e60f8af69ad387a955a14a73f69d0a950eb4 /src/credential/gnunet-service-credential.c
parentded88c36e813c2a6b669d7082ecda1695f5b24bd (diff)
downloadgnunet-59f9630b8be3dcde087a4ef6956217704d0dacb4.tar.gz
gnunet-59f9630b8be3dcde087a4ef6956217704d0dacb4.zip
-fix compile
Diffstat (limited to 'src/credential/gnunet-service-credential.c')
-rw-r--r--src/credential/gnunet-service-credential.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/src/credential/gnunet-service-credential.c b/src/credential/gnunet-service-credential.c
index ed7d249e3..aa3c02003 100644
--- a/src/credential/gnunet-service-credential.c
+++ b/src/credential/gnunet-service-credential.c
@@ -28,6 +28,7 @@
28#include "gnunet_statistics_service.h" 28#include "gnunet_statistics_service.h"
29#include "credential.h" 29#include "credential.h"
30#include "gnunet_protocols.h" 30#include "gnunet_protocols.h"
31#include "gnunet_signatures.h"
31 32
32// For Looking up GNS request 33// For Looking up GNS request
33#include <gnunet_dnsparser_lib.h> 34#include <gnunet_dnsparser_lib.h>
@@ -83,8 +84,8 @@ struct AttributeRecordEntry
83 /** 84 /**
84 * 85 *
85 */ 86 */
86 struct GNUNET_CREDENTIAL_AttributeDelegationRecordData; 87 struct GNUNET_CREDENTIAL_AttributeRecordData record_data;
87} 88};
88 89
89/** 90/**
90 * Handle to a lookup operation from api 91 * Handle to a lookup operation from api
@@ -264,16 +265,10 @@ send_lookup_response (void* cls,
264 struct GNUNET_MQ_Envelope *env; 265 struct GNUNET_MQ_Envelope *env;
265 struct VerifyResultMessage *rmsg; 266 struct VerifyResultMessage *rmsg;
266 const struct GNUNET_CREDENTIAL_CredentialRecordData *crd; 267 const struct GNUNET_CREDENTIAL_CredentialRecordData *crd;
267 struct GNUNET_CREDENTIAL_AttributeDelegationRecordData *adrd;
268 struct CredentialRecordEntry *cr_entry; 268 struct CredentialRecordEntry *cr_entry;
269 struct AttributeRecordEntry *attr_entry; 269 int cred_verified;
270 bool cred_verified;
271 270
272 cred_record_count = 0; 271 cred_record_count = 0;
273 adrd = GNUNET_CREDENTIAL_AttributeDelegationRecordData
274 GNUNET_CONTAINER_DLL_insert_tail (vrh->attr_queue_head,
275 vrh->attr_queue_tail,
276 attr_entry);
277 for (i=0; i < rd_count; i++) 272 for (i=0; i < rd_count; i++)
278 { 273 {
279 if (GNUNET_GNSRECORD_TYPE_CREDENTIAL != rd[i].record_type) 274 if (GNUNET_GNSRECORD_TYPE_CREDENTIAL != rd[i].record_type)
@@ -294,22 +289,17 @@ send_lookup_response (void* cls,
294 vrh->cred_chain_tail, 289 vrh->cred_chain_tail,
295 cr_entry); 290 cr_entry);
296 291
297 if(GNUNET_CRYPTO_ecdsa_verify(GNUNET_SIGNATURE_PURPOSE_CREDENTIAL, purpose, sig, issuer_key)) 292 if(GNUNET_OK == GNUNET_CRYPTO_ecdsa_verify(GNUNET_SIGNATURE_PURPOSE_CREDENTIAL,
293 &crd->purpose,
294 &crd->sig, &crd->issuer_key))
298 { 295 {
299 cred_verified = true; 296 cred_verified = GNUNET_YES;
300 break; 297 break;
301 } 298 }
302 299
303 } 300 }
304 301
305 302
306 /**
307 * Check for attributes from the issuer and follow the chain
308 * till you get the required subject's attributes
309 */
310 if(cred_verified != true){
311 for(i=0 ; i < rd_count ; i++){
312
313 303
314 /** 304 /**
315 * TODO 305 * TODO
@@ -335,7 +325,7 @@ send_lookup_response (void* cls,
335 GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT); 325 GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT);
336 //Assign id so that client can find associated request 326 //Assign id so that client can find associated request
337 rmsg->id = vrh->request_id; 327 rmsg->id = vrh->request_id;
338 rmsg->ad_count = htonl (attr_record_count); 328 rmsg->ad_count = htonl (cred_record_count);
339 329
340 /** 330 /**
341 * Get serialized record data 331 * Get serialized record data
@@ -343,10 +333,10 @@ send_lookup_response (void* cls,
343 */ 333 */
344 i = 0; 334 i = 0;
345 struct GNUNET_CREDENTIAL_CredentialRecordData *tmp_record = (struct GNUNET_CREDENTIAL_CredentialRecordData*) &rmsg[1]; 335 struct GNUNET_CREDENTIAL_CredentialRecordData *tmp_record = (struct GNUNET_CREDENTIAL_CredentialRecordData*) &rmsg[1];
346 for (ar_entry = vrh->attr_chain_head; NULL != ar_entry; ar_entry = ar_entry->next) 336 for (cr_entry = vrh->cred_chain_head; NULL != cr_entry; cr_entry = cr_entry->next)
347 { 337 {
348 memcpy (tmp_record, 338 memcpy (tmp_record,
349 &ar_entry->record_data, 339 &cr_entry->record_data,
350 sizeof (struct GNUNET_CREDENTIAL_CredentialRecordData)); 340 sizeof (struct GNUNET_CREDENTIAL_CredentialRecordData));
351 tmp_record++; 341 tmp_record++;
352 } 342 }