aboutsummaryrefslogtreecommitdiff
path: root/src/credential/gnunet-credential.c
diff options
context:
space:
mode:
authorAndreas Ebner <pansy007@googlemail.com>2019-08-04 13:52:03 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-10-07 12:16:50 +0200
commit15b0d71a635f02f5e0291a695d35a65698fdea05 (patch)
tree5afc234a0ce848019d1098f3852fde06f14dcd98 /src/credential/gnunet-credential.c
parent93cd93a1330fb38add615f797ac9a87fc252ff98 (diff)
downloadgnunet-15b0d71a635f02f5e0291a695d35a65698fdea05.tar.gz
gnunet-15b0d71a635f02f5e0291a695d35a65698fdea05.zip
Clean up and renaming
- renamed a lot of variables/functions that no longer serve credential but delegate - correct printouts likewise - cleaned up test_credential_own.sh to use credential service issuer side storage - removed credential related parameters from VerifyRequestHandle struct
Diffstat (limited to 'src/credential/gnunet-credential.c')
-rw-r--r--src/credential/gnunet-credential.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/credential/gnunet-credential.c b/src/credential/gnunet-credential.c
index 64f5c5a5f..07148a1b5 100644
--- a/src/credential/gnunet-credential.c
+++ b/src/credential/gnunet-credential.c
@@ -254,17 +254,17 @@ handle_collect_result (void *cls,
254 unsigned int d_count, 254 unsigned int d_count,
255 struct GNUNET_CREDENTIAL_Delegation *dc, 255 struct GNUNET_CREDENTIAL_Delegation *dc,
256 unsigned int c_count, 256 unsigned int c_count,
257 struct GNUNET_CREDENTIAL_Delegate *cred) 257 struct GNUNET_CREDENTIAL_Delegate *dele)
258{ 258{
259 int i; 259 int i;
260 char *line; 260 char *line;
261 261
262 verify_request = NULL; 262 verify_request = NULL;
263 if (NULL != cred) 263 if (NULL != dele)
264 { 264 {
265 for (i = 0; i < c_count; i++) 265 for (i = 0; i < c_count; i++)
266 { 266 {
267 line = GNUNET_CREDENTIAL_delegate_to_string (&cred[i]); 267 line = GNUNET_CREDENTIAL_delegate_to_string (&dele[i]);
268 printf ("%s\n", line); 268 printf ("%s\n", line);
269 GNUNET_free (line); 269 GNUNET_free (line);
270 } 270 }
@@ -272,7 +272,6 @@ handle_collect_result (void *cls,
272 printf("Received NULL\n"); 272 printf("Received NULL\n");
273 } 273 }
274 274
275
276 GNUNET_SCHEDULER_shutdown (); 275 GNUNET_SCHEDULER_shutdown ();
277} 276}
278 277
@@ -282,14 +281,14 @@ handle_verify_result (void *cls,
282 unsigned int d_count, 281 unsigned int d_count,
283 struct GNUNET_CREDENTIAL_Delegation *dc, 282 struct GNUNET_CREDENTIAL_Delegation *dc,
284 unsigned int c_count, 283 unsigned int c_count,
285 struct GNUNET_CREDENTIAL_Delegate *cred) 284 struct GNUNET_CREDENTIAL_Delegate *dele)
286{ 285{
287 int i; 286 int i;
288 char *iss_key; 287 char *iss_key;
289 char *sub_key; 288 char *sub_key;
290 289
291 verify_request = NULL; 290 verify_request = NULL;
292 if (NULL == cred) 291 if (NULL == dele)
293 printf ("Failed.\n"); 292 printf ("Failed.\n");
294 else 293 else
295 { 294 {
@@ -319,19 +318,18 @@ handle_verify_result (void *cls,
319 GNUNET_free (iss_key); 318 GNUNET_free (iss_key);
320 GNUNET_free (sub_key); 319 GNUNET_free (sub_key);
321 } 320 }
322 printf ("\nCredentials:\n"); 321 printf ("\nDelegate(s):\n");
323 for (i = 0; i < c_count; i++) 322 for (i = 0; i < c_count; i++)
324 { 323 {
325 iss_key = GNUNET_CRYPTO_ecdsa_public_key_to_string (&cred[i].issuer_key); 324 iss_key = GNUNET_CRYPTO_ecdsa_public_key_to_string (&dele[i].issuer_key);
326 sub_key = GNUNET_CRYPTO_ecdsa_public_key_to_string (&cred[i].subject_key); 325 sub_key = GNUNET_CRYPTO_ecdsa_public_key_to_string (&dele[i].subject_key);
327 printf ("%s.%s <- %s\n", iss_key, cred[i].issuer_attribute, sub_key); 326 printf ("%s.%s <- %s\n", iss_key, dele[i].issuer_attribute, sub_key);
328 GNUNET_free (iss_key); 327 GNUNET_free (iss_key);
329 GNUNET_free (sub_key); 328 GNUNET_free (sub_key);
330 } 329 }
331 printf ("Successful.\n"); 330 printf ("Successful.\n");
332 } 331 }
333 332
334
335 GNUNET_SCHEDULER_shutdown (); 333 GNUNET_SCHEDULER_shutdown ();
336} 334}
337 335