diff options
Diffstat (limited to 'src/identity-provider/gnunet-idp.c')
-rw-r--r-- | src/identity-provider/gnunet-idp.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/identity-provider/gnunet-idp.c b/src/identity-provider/gnunet-idp.c index 6b2bdcc96..b4785580a 100644 --- a/src/identity-provider/gnunet-idp.c +++ b/src/identity-provider/gnunet-idp.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | #include "gnunet_namestore_service.h" | 29 | #include "gnunet_namestore_service.h" |
30 | #include "gnunet_identity_provider_service.h" | ||
30 | #include "gnunet_identity_service.h" | 31 | #include "gnunet_identity_service.h" |
31 | #include "gnunet_signatures.h" | 32 | #include "gnunet_signatures.h" |
32 | 33 | ||
@@ -61,6 +62,16 @@ static char* ego_name; | |||
61 | static struct GNUNET_IDENTITY_Handle *identity_handle; | 62 | static struct GNUNET_IDENTITY_Handle *identity_handle; |
62 | 63 | ||
63 | /** | 64 | /** |
65 | * IdP handle | ||
66 | */ | ||
67 | static struct GNUNET_IDENTITY_PROVIDER_Handle *idp_handle; | ||
68 | |||
69 | /** | ||
70 | * IdP operation | ||
71 | */ | ||
72 | static struct GNUNET_IDENTITY_PROVIDER_Operation *idp_op; | ||
73 | |||
74 | /** | ||
64 | * Namestore handle | 75 | * Namestore handle |
65 | */ | 76 | */ |
66 | static struct GNUNET_NAMESTORE_Handle *namestore_handle; | 77 | static struct GNUNET_NAMESTORE_Handle *namestore_handle; |
@@ -235,7 +246,19 @@ abe_lookup_cb (void *cls, | |||
235 | return; | 246 | return; |
236 | } | 247 | } |
237 | 248 | ||
238 | size = GNUNET_CRYPTO_cpabe_encrypt (attr_value, | 249 | struct GNUNET_IDENTITY_PROVIDER_Attribute *attr; |
250 | attr = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_PROVIDER_Attribute) + strlen (attr_value) + 1); | ||
251 | attr->attribute_type = GNUNET_IDENTITY_PROVIDER_AT_STRING; | ||
252 | attr->data = &attr[1]; | ||
253 | attr->data_size = strlen (attr_value) + 1; | ||
254 | idp_op = GNUNET_IDENTITY_PROVIDER_attribute_store (idp_handle, | ||
255 | zone, | ||
256 | attr_name, | ||
257 | attr, | ||
258 | &store_attr_cont, | ||
259 | NULL); | ||
260 | |||
261 | /*size = GNUNET_CRYPTO_cpabe_encrypt (attr_value, | ||
239 | strlen (attr_value) + 1, | 262 | strlen (attr_value) + 1, |
240 | attr_name, | 263 | attr_name, |
241 | abe_key, | 264 | abe_key, |
@@ -251,7 +274,7 @@ abe_lookup_cb (void *cls, | |||
251 | 1, | 274 | 1, |
252 | &new_record, | 275 | &new_record, |
253 | &store_attr_cont, | 276 | &store_attr_cont, |
254 | NULL); | 277 | NULL);*/ |
255 | } | 278 | } |
256 | 279 | ||
257 | static void | 280 | static void |
@@ -301,6 +324,7 @@ run (void *cls, | |||
301 | } | 324 | } |
302 | 325 | ||
303 | namestore_handle = GNUNET_NAMESTORE_connect (c); | 326 | namestore_handle = GNUNET_NAMESTORE_connect (c); |
327 | idp_handle = GNUNET_IDENTITY_PROVIDER_connect (c); | ||
304 | //Get Ego | 328 | //Get Ego |
305 | identity_handle = GNUNET_IDENTITY_connect (c, | 329 | identity_handle = GNUNET_IDENTITY_connect (c, |
306 | &ego_cb, | 330 | &ego_cb, |