diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2016-11-20 17:49:04 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2016-11-20 17:49:04 +0100 |
commit | fad73f2435336733ae585c7a018df860bec3bdf1 (patch) | |
tree | 912becfd30ae7d6a4d1fcc53095eef5205daf5ec /src/credential | |
parent | 18f106166cf64cc72206cd35301276aa21ca100a (diff) | |
download | gnunet-fad73f2435336733ae585c7a018df860bec3bdf1.tar.gz gnunet-fad73f2435336733ae585c7a018df860bec3bdf1.zip |
- add missing API; no impl
Diffstat (limited to 'src/credential')
-rw-r--r-- | src/credential/credential_api.c | 49 | ||||
-rw-r--r-- | src/credential/gnunet-credential.c | 108 | ||||
-rw-r--r-- | src/credential/gnunet-service-credential.c | 10 | ||||
-rw-r--r-- | src/credential/plugin_gnsrecord_credential.c | 8 |
4 files changed, 84 insertions, 91 deletions
diff --git a/src/credential/credential_api.c b/src/credential/credential_api.c index 4864d54d0..8ff66c574 100644 --- a/src/credential/credential_api.c +++ b/src/credential/credential_api.c | |||
@@ -38,18 +38,18 @@ | |||
38 | /** | 38 | /** |
39 | * Handle to a verify request | 39 | * Handle to a verify request |
40 | */ | 40 | */ |
41 | struct GNUNET_CREDENTIAL_VerifyRequest | 41 | struct GNUNET_CREDENTIAL_Request |
42 | { | 42 | { |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * DLL | 45 | * DLL |
46 | */ | 46 | */ |
47 | struct GNUNET_CREDENTIAL_VerifyRequest *next; | 47 | struct GNUNET_CREDENTIAL_Request *next; |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * DLL | 50 | * DLL |
51 | */ | 51 | */ |
52 | struct GNUNET_CREDENTIAL_VerifyRequest *prev; | 52 | struct GNUNET_CREDENTIAL_Request *prev; |
53 | 53 | ||
54 | /** | 54 | /** |
55 | * handle to credential service | 55 | * handle to credential service |
@@ -98,12 +98,12 @@ struct GNUNET_CREDENTIAL_Handle | |||
98 | /** | 98 | /** |
99 | * Head of linked list of active verify requests. | 99 | * Head of linked list of active verify requests. |
100 | */ | 100 | */ |
101 | struct GNUNET_CREDENTIAL_VerifyRequest *verify_head; | 101 | struct GNUNET_CREDENTIAL_Request *verify_head; |
102 | 102 | ||
103 | /** | 103 | /** |
104 | * Tail of linked list of active verify requests. | 104 | * Tail of linked list of active verify requests. |
105 | */ | 105 | */ |
106 | struct GNUNET_CREDENTIAL_VerifyRequest *verify_tail; | 106 | struct GNUNET_CREDENTIAL_Request *verify_tail; |
107 | 107 | ||
108 | /** | 108 | /** |
109 | * Reconnect task | 109 | * Reconnect task |
@@ -210,16 +210,13 @@ handle_result (void *cls, | |||
210 | const struct VerifyResultMessage *vr_msg) | 210 | const struct VerifyResultMessage *vr_msg) |
211 | { | 211 | { |
212 | struct GNUNET_CREDENTIAL_Handle *handle = cls; | 212 | struct GNUNET_CREDENTIAL_Handle *handle = cls; |
213 | uint32_t ad_count = ntohl (vr_msg->ad_count); | ||
214 | struct GNUNET_CREDENTIAL_RecordData ad[ad_count]; | ||
215 | uint32_t r_id = ntohl (vr_msg->id); | 213 | uint32_t r_id = ntohl (vr_msg->id); |
216 | struct GNUNET_CREDENTIAL_VerifyRequest *vr; | 214 | struct GNUNET_CREDENTIAL_Request *vr; |
217 | GNUNET_CREDENTIAL_VerifyResultProcessor proc; | 215 | GNUNET_CREDENTIAL_VerifyResultProcessor proc; |
218 | void *proc_cls; | 216 | void *proc_cls; |
219 | 217 | ||
220 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 218 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
221 | "Received verify reply from CREDENTIAL service (%u credentials)\n", | 219 | "Received verify reply from CREDENTIAL service\n"); |
222 | (unsigned int) ad_count); | ||
223 | for (vr = handle->verify_head; NULL != vr; vr = vr->next) | 220 | for (vr = handle->verify_head; NULL != vr; vr = vr->next) |
224 | if (vr->r_id == r_id) | 221 | if (vr->r_id == r_id) |
225 | break; | 222 | break; |
@@ -240,8 +237,7 @@ handle_result (void *cls, | |||
240 | */ | 237 | */ |
241 | proc (proc_cls, | 238 | proc (proc_cls, |
242 | NULL, | 239 | NULL, |
243 | ad_count, | 240 | GNUNET_NO); // TODO |
244 | ad); // TODO | ||
245 | } | 241 | } |
246 | 242 | ||
247 | 243 | ||
@@ -260,7 +256,7 @@ reconnect (struct GNUNET_CREDENTIAL_Handle *handle) | |||
260 | NULL), | 256 | NULL), |
261 | GNUNET_MQ_handler_end () | 257 | GNUNET_MQ_handler_end () |
262 | }; | 258 | }; |
263 | struct GNUNET_CREDENTIAL_VerifyRequest *vr; | 259 | struct GNUNET_CREDENTIAL_Request *vr; |
264 | 260 | ||
265 | GNUNET_assert (NULL == handle->mq); | 261 | GNUNET_assert (NULL == handle->mq); |
266 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 262 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -330,7 +326,7 @@ GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle) | |||
330 | * @param lr the verify request to cancel | 326 | * @param lr the verify request to cancel |
331 | */ | 327 | */ |
332 | void | 328 | void |
333 | GNUNET_CREDENTIAL_verify_cancel (struct GNUNET_CREDENTIAL_VerifyRequest *vr) | 329 | GNUNET_CREDENTIAL_verify_cancel (struct GNUNET_CREDENTIAL_Request *vr) |
334 | { | 330 | { |
335 | struct GNUNET_CREDENTIAL_Handle *handle = vr->credential_handle; | 331 | struct GNUNET_CREDENTIAL_Handle *handle = vr->credential_handle; |
336 | 332 | ||
@@ -341,30 +337,35 @@ GNUNET_CREDENTIAL_verify_cancel (struct GNUNET_CREDENTIAL_VerifyRequest *vr) | |||
341 | GNUNET_free (vr); | 337 | GNUNET_free (vr); |
342 | } | 338 | } |
343 | 339 | ||
344 | |||
345 | /** | 340 | /** |
346 | * Perform an asynchronous verify operation for a credential. | 341 | * Performs attribute verification. |
342 | * Checks if there is a delegation chain from | ||
343 | * attribute ``issuer_attribute'' issued by the issuer | ||
344 | * with public key ``issuer_key'' maps to the attribute | ||
345 | * ``subject_attribute'' claimed by the subject with key | ||
346 | * ``subject_key'' | ||
347 | * | 347 | * |
348 | * @param handle handle to the Credential service | 348 | * @param handle handle to the Credential service |
349 | * @param credential the credential to look up | 349 | * @param issuer_key the issuer public key |
350 | * @param subject Ego to check the credential for | 350 | * @param issuer_attribute the issuer attribute |
351 | * @param subject_key the subject public key | ||
352 | * @param subject_attribute the attribute claimed by the subject | ||
351 | * @param proc function to call on result | 353 | * @param proc function to call on result |
352 | * @param proc_cls closure for processor | 354 | * @param proc_cls closure for processor |
353 | * @return handle to the queued request | 355 | * @return handle to the queued request |
354 | */ | 356 | */ |
355 | struct GNUNET_CREDENTIAL_VerifyRequest* | 357 | struct GNUNET_CREDENTIAL_Request* |
356 | GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, | 358 | GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, |
359 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, | ||
357 | const char *issuer_attribute, | 360 | const char *issuer_attribute, |
358 | const char *subject_attribute, | ||
359 | const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, | 361 | const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, |
360 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, | 362 | const char *subject_attribute, |
361 | uint32_t credential_flags, | ||
362 | GNUNET_CREDENTIAL_VerifyResultProcessor proc, | 363 | GNUNET_CREDENTIAL_VerifyResultProcessor proc, |
363 | void *proc_cls) | 364 | void *proc_cls) |
364 | { | 365 | { |
365 | /* IPC to shorten credential names, return shorten_handle */ | 366 | /* IPC to shorten credential names, return shorten_handle */ |
366 | struct VerifyMessage *v_msg; | 367 | struct VerifyMessage *v_msg; |
367 | struct GNUNET_CREDENTIAL_VerifyRequest *vr; | 368 | struct GNUNET_CREDENTIAL_Request *vr; |
368 | size_t nlen; | 369 | size_t nlen; |
369 | 370 | ||
370 | if (NULL == issuer_attribute) | 371 | if (NULL == issuer_attribute) |
@@ -382,7 +383,7 @@ GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, | |||
382 | GNUNET_break (0); | 383 | GNUNET_break (0); |
383 | return NULL; | 384 | return NULL; |
384 | } | 385 | } |
385 | vr = GNUNET_new (struct GNUNET_CREDENTIAL_VerifyRequest); | 386 | vr = GNUNET_new (struct GNUNET_CREDENTIAL_Request); |
386 | vr->credential_handle = handle; | 387 | vr->credential_handle = handle; |
387 | vr->verify_proc = proc; | 388 | vr->verify_proc = proc; |
388 | vr->proc_cls = proc_cls; | 389 | vr->proc_cls = proc_cls; |
diff --git a/src/credential/gnunet-credential.c b/src/credential/gnunet-credential.c index 94a4b3899..31cd4fd8f 100644 --- a/src/credential/gnunet-credential.c +++ b/src/credential/gnunet-credential.c | |||
@@ -50,7 +50,7 @@ static char *lookup_credential; | |||
50 | /** | 50 | /** |
51 | * Handle to verify request | 51 | * Handle to verify request |
52 | */ | 52 | */ |
53 | static struct GNUNET_CREDENTIAL_VerifyRequest *verify_request; | 53 | static struct GNUNET_CREDENTIAL_Request *verify_request; |
54 | 54 | ||
55 | /** | 55 | /** |
56 | * Lookup an ego with the identity service. | 56 | * Lookup an ego with the identity service. |
@@ -82,11 +82,6 @@ static char *subject_key; | |||
82 | */ | 82 | */ |
83 | static char *issuer_key; | 83 | static char *issuer_key; |
84 | 84 | ||
85 | /* | ||
86 | * Credential flags | ||
87 | */ | ||
88 | static int credential_flags; | ||
89 | |||
90 | 85 | ||
91 | 86 | ||
92 | /** | 87 | /** |
@@ -158,20 +153,18 @@ do_timeout (void *cls) | |||
158 | */ | 153 | */ |
159 | static void | 154 | static void |
160 | handle_verify_result (void *cls, | 155 | handle_verify_result (void *cls, |
161 | struct GNUNET_IDENTITY_Ego *issuer, | 156 | struct GNUNET_CRYPTO_EcdsaPublicKey *issuer, |
162 | uint16_t issuer_len, | 157 | uint32_t status) |
163 | const struct GNUNET_CREDENTIAL_RecordData *data) | ||
164 | { | 158 | { |
165 | 159 | ||
166 | 160 | ||
167 | verify_request = NULL; | 161 | verify_request = NULL; |
168 | if (0 == issuer_len) | 162 | if (GNUNET_NO == status) |
169 | printf ("No results.\n"); | 163 | printf ("Verify failed.\n"); |
170 | else | 164 | else |
171 | printf ("%u\n", | 165 | printf ("Successful.\n"); |
172 | issuer_len); | 166 | |
173 | 167 | ||
174 | |||
175 | GNUNET_SCHEDULER_shutdown (); | 168 | GNUNET_SCHEDULER_shutdown (); |
176 | } | 169 | } |
177 | 170 | ||
@@ -188,7 +181,7 @@ handle_verify_result (void *cls, | |||
188 | static void | 181 | static void |
189 | lookup_credentials (struct GNUNET_IDENTITY_Ego *ego) | 182 | lookup_credentials (struct GNUNET_IDENTITY_Ego *ego) |
190 | { | 183 | { |
191 | 184 | ||
192 | struct GNUNET_CRYPTO_EcdsaPublicKey subject_pkey; | 185 | struct GNUNET_CRYPTO_EcdsaPublicKey subject_pkey; |
193 | struct GNUNET_CRYPTO_EcdsaPublicKey issuer_pkey; | 186 | struct GNUNET_CRYPTO_EcdsaPublicKey issuer_pkey; |
194 | 187 | ||
@@ -217,21 +210,20 @@ lookup_credentials (struct GNUNET_IDENTITY_Ego *ego) | |||
217 | GNUNET_SCHEDULER_shutdown (); | 210 | GNUNET_SCHEDULER_shutdown (); |
218 | return; | 211 | return; |
219 | } | 212 | } |
220 | 213 | ||
221 | verify_request = GNUNET_CREDENTIAL_verify(credential, | 214 | verify_request = GNUNET_CREDENTIAL_verify(credential, |
222 | "", | 215 | &issuer_pkey, |
223 | lookup_credential, | 216 | "test", //TODO argument |
224 | &subject_pkey, | 217 | &subject_pkey, |
225 | &issuer_pkey, | 218 | lookup_credential, |
226 | credential_flags, | 219 | &handle_verify_result, |
227 | &handle_verify_result, | 220 | NULL); |
228 | NULL); | 221 | return; |
229 | return; | ||
230 | } | 222 | } |
231 | else | 223 | else |
232 | { | 224 | { |
233 | fprintf (stderr, | 225 | fprintf (stderr, |
234 | _("Please specify name to lookup, subject key and issuer key!\n")); | 226 | _("Please specify name to lookup, subject key and issuer key!\n")); |
235 | GNUNET_SCHEDULER_shutdown (); | 227 | GNUNET_SCHEDULER_shutdown (); |
236 | return; | 228 | return; |
237 | } | 229 | } |
@@ -252,23 +244,23 @@ lookup_credentials (struct GNUNET_IDENTITY_Ego *ego) | |||
252 | */ | 244 | */ |
253 | static void | 245 | static void |
254 | identity_master_cb (void *cls, | 246 | identity_master_cb (void *cls, |
255 | struct GNUNET_IDENTITY_Ego *ego, | 247 | struct GNUNET_IDENTITY_Ego *ego, |
256 | void **ctx, | 248 | void **ctx, |
257 | const char *name) | 249 | const char *name) |
258 | { | 250 | { |
259 | 251 | ||
260 | id_op = NULL; | 252 | id_op = NULL; |
261 | if (NULL == ego) | 253 | if (NULL == ego) |
262 | { | 254 | { |
263 | fprintf (stderr, | 255 | fprintf (stderr, |
264 | _("Ego for `gns-master' not found, cannot perform lookup. Did you run gnunet-gns-import.sh?\n")); | 256 | _("Ego for `gns-master' not found, cannot perform lookup. Did you run gnunet-gns-import.sh?\n")); |
265 | GNUNET_SCHEDULER_shutdown (); | 257 | GNUNET_SCHEDULER_shutdown (); |
266 | return; | 258 | return; |
267 | } | 259 | } |
268 | 260 | ||
269 | lookup_credentials(ego); | 261 | lookup_credentials(ego); |
270 | 262 | ||
271 | 263 | ||
272 | } | 264 | } |
273 | 265 | ||
274 | 266 | ||
@@ -286,41 +278,41 @@ run (void *cls, | |||
286 | const char *cfgfile, | 278 | const char *cfgfile, |
287 | const struct GNUNET_CONFIGURATION_Handle *c) | 279 | const struct GNUNET_CONFIGURATION_Handle *c) |
288 | { | 280 | { |
289 | 281 | ||
290 | cfg = c; | 282 | cfg = c; |
291 | credential = GNUNET_CREDENTIAL_connect (cfg); | 283 | credential = GNUNET_CREDENTIAL_connect (cfg); |
292 | identity = GNUNET_IDENTITY_connect (cfg, NULL, NULL); | 284 | identity = GNUNET_IDENTITY_connect (cfg, NULL, NULL); |
293 | 285 | ||
294 | |||
295 | 286 | ||
296 | 287 | ||
288 | |||
297 | if (NULL == credential) | 289 | if (NULL == credential) |
298 | { | 290 | { |
299 | fprintf (stderr, | 291 | fprintf (stderr, |
300 | _("Failed to connect to CREDENTIAL\n")); | 292 | _("Failed to connect to CREDENTIAL\n")); |
301 | return; | 293 | return; |
302 | } | 294 | } |
303 | if (NULL == identity) | 295 | if (NULL == identity) |
304 | { | 296 | { |
305 | fprintf (stderr, | 297 | fprintf (stderr, |
306 | _("Failed to connect to IDENTITY\n")); | 298 | _("Failed to connect to IDENTITY\n")); |
307 | return; | 299 | return; |
308 | } | 300 | } |
309 | tt = GNUNET_SCHEDULER_add_delayed (timeout, | 301 | tt = GNUNET_SCHEDULER_add_delayed (timeout, |
310 | &do_timeout, NULL); | 302 | &do_timeout, NULL); |
311 | GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); | 303 | GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); |
312 | |||
313 | 304 | ||
314 | |||
315 | GNUNET_break (NULL == id_op); | ||
316 | id_op = GNUNET_IDENTITY_get (identity, | ||
317 | "gns-master",//# TODO: Create credential-master | ||
318 | &identity_master_cb, | ||
319 | cls); | ||
320 | GNUNET_assert (NULL != id_op); | ||
321 | 305 | ||
322 | 306 | ||
323 | 307 | GNUNET_break (NULL == id_op); | |
308 | id_op = GNUNET_IDENTITY_get (identity, | ||
309 | "gns-master",//# TODO: Create credential-master | ||
310 | &identity_master_cb, | ||
311 | cls); | ||
312 | GNUNET_assert (NULL != id_op); | ||
313 | |||
314 | |||
315 | |||
324 | 316 | ||
325 | } | 317 | } |
326 | 318 | ||
@@ -339,15 +331,15 @@ main (int argc, char *const *argv) | |||
339 | {'u', "lookup", "CREDENTIAL", | 331 | {'u', "lookup", "CREDENTIAL", |
340 | gettext_noop ("Lookup a record for the given credential"), 1, | 332 | gettext_noop ("Lookup a record for the given credential"), 1, |
341 | &GNUNET_GETOPT_set_string, &lookup_credential}, | 333 | &GNUNET_GETOPT_set_string, &lookup_credential}, |
342 | /** { 'T', "timeout", "DELAY", | 334 | /** { 'T', "timeout", "DELAY", |
343 | gettext_noop ("Specify timeout for the lookup"), 1, | 335 | gettext_noop ("Specify timeout for the lookup"), 1, |
344 | &GNUNET_GETOPT_set_relative_time, &timeout }, | 336 | &GNUNET_GETOPT_set_relative_time, &timeout }, |
345 | {'t', "type", "TYPE", | 337 | {'t', "type", "TYPE", |
346 | gettext_noop ("Specify the type of the record to lookup"), 1, | 338 | gettext_noop ("Specify the type of the record to lookup"), 1, |
347 | &GNUNET_GETOPT_set_string, &lookup_type},**/ | 339 | &GNUNET_GETOPT_set_string, &lookup_type},**/ |
348 | {'z', "zone", "NAME", | 340 | {'z', "zone", "NAME", |
349 | gettext_noop ("Specify the name of the ego of the zone to lookup the record in"), 1, | 341 | gettext_noop ("Specify the name of the ego of the zone to lookup the record in"), 1, |
350 | &GNUNET_GETOPT_set_string, &zone_ego_name}, | 342 | &GNUNET_GETOPT_set_string, &zone_ego_name}, |
351 | {'s', "subject", "PKEY", | 343 | {'s', "subject", "PKEY", |
352 | gettext_noop ("Specify the public key of the subject to lookup the credential for"), 1, | 344 | gettext_noop ("Specify the public key of the subject to lookup the credential for"), 1, |
353 | &GNUNET_GETOPT_set_string, &subject_key}, | 345 | &GNUNET_GETOPT_set_string, &subject_key}, |
@@ -364,11 +356,11 @@ main (int argc, char *const *argv) | |||
364 | 356 | ||
365 | GNUNET_log_setup ("gnunet-credential", "WARNING", NULL); | 357 | GNUNET_log_setup ("gnunet-credential", "WARNING", NULL); |
366 | ret = | 358 | ret = |
367 | (GNUNET_OK == | 359 | (GNUNET_OK == |
368 | GNUNET_PROGRAM_run (argc, argv, "gnunet-credential", | 360 | GNUNET_PROGRAM_run (argc, argv, "gnunet-credential", |
369 | _("GNUnet credential resolver tool"), | 361 | _("GNUnet credential resolver tool"), |
370 | options, | 362 | options, |
371 | &run, NULL)) ? 0 : 1; | 363 | &run, NULL)) ? 0 : 1; |
372 | GNUNET_free ((void*) argv); | 364 | GNUNET_free ((void*) argv); |
373 | return ret; | 365 | return ret; |
374 | } | 366 | } |
diff --git a/src/credential/gnunet-service-credential.c b/src/credential/gnunet-service-credential.c index 114041be1..58be7853b 100644 --- a/src/credential/gnunet-service-credential.c +++ b/src/credential/gnunet-service-credential.c | |||
@@ -61,7 +61,7 @@ struct AttributeRecordEntry | |||
61 | /** | 61 | /** |
62 | * Payload | 62 | * Payload |
63 | */ | 63 | */ |
64 | struct GNUNET_CREDENTIAL_RecordData record_data; | 64 | struct GNUNET_CREDENTIAL_AttributeRecordData record_data; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | /** | 67 | /** |
@@ -231,7 +231,7 @@ send_lookup_response (void* cls, | |||
231 | int attr_record_count; | 231 | int attr_record_count; |
232 | struct GNUNET_MQ_Envelope *env; | 232 | struct GNUNET_MQ_Envelope *env; |
233 | struct VerifyResultMessage *rmsg; | 233 | struct VerifyResultMessage *rmsg; |
234 | const struct GNUNET_CREDENTIAL_RecordData *ard; | 234 | const struct GNUNET_CREDENTIAL_AttributeRecordData *ard; |
235 | struct AttributeRecordEntry *ar_entry; | 235 | struct AttributeRecordEntry *ar_entry; |
236 | 236 | ||
237 | attr_record_count = 0; | 237 | attr_record_count = 0; |
@@ -260,7 +260,7 @@ send_lookup_response (void* cls, | |||
260 | /** | 260 | /** |
261 | * Get serialized record data size | 261 | * Get serialized record data size |
262 | */ | 262 | */ |
263 | len = attr_record_count * sizeof (struct GNUNET_CREDENTIAL_RecordData); | 263 | len = attr_record_count * sizeof (struct GNUNET_CREDENTIAL_AttributeRecordData); |
264 | 264 | ||
265 | /** | 265 | /** |
266 | * Prepare a lookup result response message for the client | 266 | * Prepare a lookup result response message for the client |
@@ -277,12 +277,12 @@ send_lookup_response (void* cls, | |||
277 | * Append at the end of rmsg | 277 | * Append at the end of rmsg |
278 | */ | 278 | */ |
279 | i = 0; | 279 | i = 0; |
280 | struct GNUNET_CREDENTIAL_RecordData *tmp_record = (struct GNUNET_CREDENTIAL_RecordData*) &rmsg[1]; | 280 | struct GNUNET_CREDENTIAL_AttributeRecordData *tmp_record = (struct GNUNET_CREDENTIAL_AttributeRecordData*) &rmsg[1]; |
281 | for (ar_entry = vrh->attr_chain_head; NULL != ar_entry; ar_entry = ar_entry->next) | 281 | for (ar_entry = vrh->attr_chain_head; NULL != ar_entry; ar_entry = ar_entry->next) |
282 | { | 282 | { |
283 | memcpy (tmp_record, | 283 | memcpy (tmp_record, |
284 | &ar_entry->record_data, | 284 | &ar_entry->record_data, |
285 | sizeof (struct GNUNET_CREDENTIAL_RecordData)); | 285 | sizeof (struct GNUNET_CREDENTIAL_AttributeRecordData)); |
286 | tmp_record++; | 286 | tmp_record++; |
287 | } | 287 | } |
288 | GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq(vrh->client), | 288 | GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq(vrh->client), |
diff --git a/src/credential/plugin_gnsrecord_credential.c b/src/credential/plugin_gnsrecord_credential.c index 3ff00737b..cc645468d 100644 --- a/src/credential/plugin_gnsrecord_credential.c +++ b/src/credential/plugin_gnsrecord_credential.c | |||
@@ -53,12 +53,12 @@ credential_value_to_string (void *cls, | |||
53 | { | 53 | { |
54 | case GNUNET_GNSRECORD_TYPE_CREDENTIAL: | 54 | case GNUNET_GNSRECORD_TYPE_CREDENTIAL: |
55 | { | 55 | { |
56 | struct GNUNET_CREDENTIAL_RecordData cred; | 56 | struct GNUNET_CREDENTIAL_AttributeRecordData cred; |
57 | char *cred_str; | 57 | char *cred_str; |
58 | char *subject_pkey; | 58 | char *subject_pkey; |
59 | char *issuer_pkey; | 59 | char *issuer_pkey; |
60 | uint32_t cf; // Credential flags | 60 | uint32_t cf; // Credential flags |
61 | if (data_size < sizeof (struct GNUNET_CREDENTIAL_RecordData)) | 61 | if (data_size < sizeof (struct GNUNET_CREDENTIAL_AttributeRecordData)) |
62 | return NULL; /* malformed */ | 62 | return NULL; /* malformed */ |
63 | memcpy (&cred, | 63 | memcpy (&cred, |
64 | data, | 64 | data, |
@@ -111,7 +111,7 @@ credential_string_to_value (void *cls, | |||
111 | { | 111 | { |
112 | case GNUNET_GNSRECORD_TYPE_CREDENTIAL: | 112 | case GNUNET_GNSRECORD_TYPE_CREDENTIAL: |
113 | { | 113 | { |
114 | struct GNUNET_CREDENTIAL_RecordData *cred; | 114 | struct GNUNET_CREDENTIAL_AttributeRecordData *cred; |
115 | unsigned int cf; // credential flags | 115 | unsigned int cf; // credential flags |
116 | 116 | ||
117 | size_t enclen = (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) * 8; | 117 | size_t enclen = (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) * 8; |
@@ -134,7 +134,7 @@ credential_string_to_value (void *cls, | |||
134 | s); | 134 | s); |
135 | return GNUNET_SYSERR; | 135 | return GNUNET_SYSERR; |
136 | } | 136 | } |
137 | *data_size = sizeof (struct GNUNET_CREDENTIAL_RecordData) + strlen (name) + 1; | 137 | *data_size = sizeof (struct GNUNET_CREDENTIAL_AttributeRecordData) + strlen (name) + 1; |
138 | *data = cred = GNUNET_malloc (*data_size); | 138 | *data = cred = GNUNET_malloc (*data_size); |
139 | GNUNET_CRYPTO_ecdsa_public_key_from_string (subject_pkey, | 139 | GNUNET_CRYPTO_ecdsa_public_key_from_string (subject_pkey, |
140 | strlen (subject_pkey), | 140 | strlen (subject_pkey), |