aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/identity-provider/gnunet-idp.c6
-rw-r--r--src/identity-provider/gnunet-service-identity-provider.c32
2 files changed, 22 insertions, 16 deletions
diff --git a/src/identity-provider/gnunet-idp.c b/src/identity-provider/gnunet-idp.c
index 2d7a1777f..6b2bdcc96 100644
--- a/src/identity-provider/gnunet-idp.c
+++ b/src/identity-provider/gnunet-idp.c
@@ -207,8 +207,8 @@ abe_lookup_cb (void *cls,
207 (void**)&new_record.data); 207 (void**)&new_record.data);
208 new_record.data_size = size; 208 new_record.data_size = size;
209 new_record.record_type = GNUNET_GNSRECORD_TYPE_ABE_MASTER; 209 new_record.record_type = GNUNET_GNSRECORD_TYPE_ABE_MASTER;
210 new_record.expiration_time = GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us; 210 new_record.expiration_time = GNUNET_TIME_UNIT_DAYS.rel_value_us;
211 new_record.flags = GNUNET_GNSRECORD_RF_PRIVATE; 211 new_record.flags = GNUNET_GNSRECORD_RF_PRIVATE | GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
212 ns_qe = GNUNET_NAMESTORE_records_store (namestore_handle, 212 ns_qe = GNUNET_NAMESTORE_records_store (namestore_handle,
213 zone, 213 zone,
214 "+", 214 "+",
@@ -243,7 +243,7 @@ abe_lookup_cb (void *cls,
243 new_record.data_size = size; 243 new_record.data_size = size;
244 new_record.record_type = GNUNET_GNSRECORD_TYPE_ID_ATTR; 244 new_record.record_type = GNUNET_GNSRECORD_TYPE_ID_ATTR;
245 new_record.expiration_time = GNUNET_TIME_UNIT_HOURS.rel_value_us; 245 new_record.expiration_time = GNUNET_TIME_UNIT_HOURS.rel_value_us;
246 new_record.flags = GNUNET_GNSRECORD_RF_NONE; 246 new_record.flags = GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
247 247
248 ns_qe = GNUNET_NAMESTORE_records_store (namestore_handle, 248 ns_qe = GNUNET_NAMESTORE_records_store (namestore_handle,
249 zone, 249 zone,
diff --git a/src/identity-provider/gnunet-service-identity-provider.c b/src/identity-provider/gnunet-service-identity-provider.c
index 1a6619227..8746e39f7 100644
--- a/src/identity-provider/gnunet-service-identity-provider.c
+++ b/src/identity-provider/gnunet-service-identity-provider.c
@@ -206,6 +206,8 @@ struct ParallelLookup
206 struct GNUNET_GNS_LookupRequest *lookup_request; 206 struct GNUNET_GNS_LookupRequest *lookup_request;
207 207
208 struct ExchangeHandle *handle; 208 struct ExchangeHandle *handle;
209
210 char *label;
209}; 211};
210 212
211struct IssueHandle 213struct IssueHandle
@@ -567,7 +569,7 @@ serialize_abe_keyinfo (const struct IssueHandle *handle,
567 enc_keyinfo, 569 enc_keyinfo,
568 enc_size); 570 enc_size);
569 GNUNET_free (enc_keyinfo); 571 GNUNET_free (enc_keyinfo);
570 return GNUNET_OK; 572 return sizeof (struct GNUNET_CRYPTO_EcdhePublicKey)+enc_size;
571} 573}
572 574
573static void 575static void
@@ -901,8 +903,8 @@ static void
901process_parallel_lookup (void *cls, uint32_t rd_count, 903process_parallel_lookup (void *cls, uint32_t rd_count,
902 const struct GNUNET_GNSRECORD_Data *rd) 904 const struct GNUNET_GNSRECORD_Data *rd)
903{ 905{
904 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 906 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
905 "Parallel lookup finished\n"); 907 "Parallel lookup finished (count=%u)\n", rd_count);
906 struct ParallelLookup *parallel_lookup = cls; 908 struct ParallelLookup *parallel_lookup = cls;
907 struct ExchangeHandle *handle = parallel_lookup->handle; 909 struct ExchangeHandle *handle = parallel_lookup->handle;
908 char *data; 910 char *data;
@@ -920,9 +922,9 @@ process_parallel_lookup (void *cls, uint32_t rd_count,
920 rd->data_size, 922 rd->data_size,
921 handle->key, 923 handle->key,
922 (void**)&data); 924 (void**)&data);
923 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding value: %s\n", data); 925 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "Adding value: %s\n", data);
924 token_add_attr (handle->token, 926 token_add_attr (handle->token,
925 label, 927 parallel_lookup->label,
926 data); 928 data);
927 GNUNET_free (data); 929 GNUNET_free (data);
928 } 930 }
@@ -930,13 +932,13 @@ process_parallel_lookup (void *cls, uint32_t rd_count,
930 i = 0; 932 i = 0;
931 for (; i < rd_count; i++) 933 for (; i < rd_count; i++)
932 { 934 {
933 if (rd->record_type == GNUNET_GNSRECORD_TYPE_ID_ATTR) 935 if (rd[i].record_type == GNUNET_GNSRECORD_TYPE_ID_ATTR)
934 { 936 {
935 data = GNUNET_GNSRECORD_value_to_string (rd[i].record_type, 937 data = GNUNET_GNSRECORD_value_to_string (rd[i].record_type,
936 rd[i].data, 938 rd[i].data,
937 rd[i].data_size); 939 rd[i].data_size);
938 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding value: %s\n", data); 940 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "Adding value: %s\n", data);
939 token_add_attr (handle->token, label, data); 941 token_add_attr (handle->token, parallel_lookup->label, data);
940 GNUNET_free (data); 942 GNUNET_free (data);
941 } 943 }
942 } 944 }
@@ -958,6 +960,7 @@ abort_parallel_lookups (void *cls)
958 for (lu = handle->parallel_lookups_head; 960 for (lu = handle->parallel_lookups_head;
959 NULL != lu;) { 961 NULL != lu;) {
960 GNUNET_GNS_lookup_cancel (lu->lookup_request); 962 GNUNET_GNS_lookup_cancel (lu->lookup_request);
963 GNUNET_free (lu->label);
961 tmp = lu->next; 964 tmp = lu->next;
962 GNUNET_CONTAINER_DLL_remove (handle->parallel_lookups_head, 965 GNUNET_CONTAINER_DLL_remove (handle->parallel_lookups_head,
963 handle->parallel_lookups_tail, 966 handle->parallel_lookups_tail,
@@ -1019,7 +1022,8 @@ process_lookup_result (void *cls, uint32_t rd_count,
1019 size, rd->data_size - sizeof (struct GNUNET_CRYPTO_EcdhePublicKey)); 1022 size, rd->data_size - sizeof (struct GNUNET_CRYPTO_EcdhePublicKey));
1020 1023
1021 scopes = GNUNET_strdup (buf); 1024 scopes = GNUNET_strdup (buf);
1022 1025 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
1026 "Scopes %s\n", scopes);
1023 handle->key = GNUNET_CRYPTO_cpabe_deserialize_key ((void*)(buf + strlen (scopes) + 1), 1027 handle->key = GNUNET_CRYPTO_cpabe_deserialize_key ((void*)(buf + strlen (scopes) + 1),
1024 rd->data_size - sizeof (struct GNUNET_CRYPTO_EcdhePublicKey) 1028 rd->data_size - sizeof (struct GNUNET_CRYPTO_EcdhePublicKey)
1025 - strlen (scopes) - 1); 1029 - strlen (scopes) - 1);
@@ -1027,15 +1031,17 @@ process_lookup_result (void *cls, uint32_t rd_count,
1027 for (scope = strtok (scopes, ","); NULL != scope; scope = strtok (NULL, ",")) 1031 for (scope = strtok (scopes, ","); NULL != scope; scope = strtok (NULL, ","))
1028 { 1032 {
1029 GNUNET_asprintf (&lookup_query, 1033 GNUNET_asprintf (&lookup_query,
1030 "%s.%s.gnu", 1034 "%s.gnu",
1031 scope, 1035 scope);
1032 GNUNET_CRYPTO_ecdsa_public_key_to_string (&handle->ticket->payload->identity_key)); 1036 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
1037 "Looking up %s\n", lookup_query);
1033 parallel_lookup = GNUNET_new (struct ParallelLookup); 1038 parallel_lookup = GNUNET_new (struct ParallelLookup);
1034 parallel_lookup->handle = handle; 1039 parallel_lookup->handle = handle;
1040 parallel_lookup->label = GNUNET_strdup (scope);
1035 parallel_lookup->lookup_request 1041 parallel_lookup->lookup_request
1036 = GNUNET_GNS_lookup (gns_handle, 1042 = GNUNET_GNS_lookup (gns_handle,
1037 lookup_query, 1043 lookup_query,
1038 &handle->ticket->aud_key, 1044 &handle->ticket->payload->identity_key,
1039 GNUNET_GNSRECORD_TYPE_ID_ATTR, 1045 GNUNET_GNSRECORD_TYPE_ID_ATTR,
1040 GNUNET_GNS_LO_LOCAL_MASTER, 1046 GNUNET_GNS_LO_LOCAL_MASTER,
1041 &process_parallel_lookup, 1047 &process_parallel_lookup,