aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2021-04-21 17:13:56 +0200
committerMartin Schanzenbach <mschanzenbach@posteo.de>2021-04-21 17:13:56 +0200
commit10de0aecc4b96e5d24a3c053a9f33d78cdc69881 (patch)
tree75aedac4a33cc0b7c8c842097bec2386994a370d
parentdfe86f94252a403b8d2ce12fb2862712d4b7fbdd (diff)
downloadgnunet-schanzen/pabc.tar.gz
gnunet-schanzen/pabc.zip
-fix proof generationschanzen/pabc
-rw-r--r--src/reclaim/plugin_reclaim_credential_pabc.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/reclaim/plugin_reclaim_credential_pabc.c b/src/reclaim/plugin_reclaim_credential_pabc.c
index 47f9a9384..82bad2f00 100644
--- a/src/reclaim/plugin_reclaim_credential_pabc.c
+++ b/src/reclaim/plugin_reclaim_credential_pabc.c
@@ -383,11 +383,6 @@ pabc_create_presentation (void *cls,
383 383
384 384
385 PABC_ASSERT (pabc_new_ctx (&ctx)); 385 PABC_ASSERT (pabc_new_ctx (&ctx));
386 /**
387 * FIXME, how to get pp_name.
388 * Ideal would be an API that allows us to load pp by
389 * issuer name.
390 */
391 issuer = pabc_get_issuer_c (cls, credential); 386 issuer = pabc_get_issuer_c (cls, credential);
392 if (NULL == issuer) 387 if (NULL == issuer)
393 { 388 {
@@ -491,7 +486,15 @@ pabc_create_presentation (void *cls,
491 } 486 }
492 // print the result 487 // print the result
493 char *json = NULL; 488 char *json = NULL;
494 pabc_encode_proof (ctx, pp, proof, &json); 489 char *ppid = NULL;
490 char *userid = NULL;
491 GNUNET_assert (PABC_OK == pabc_cred_get_userid_from_cred (credential->data,
492 &userid));
493 GNUNET_assert (PABC_OK == pabc_cred_get_ppid_from_cred (credential->data,
494 &ppid));
495 pabc_cred_encode_proof (ctx, pp, proof, userid, ppid, &json);
496 GNUNET_free (ppid);
497 GNUNET_free (userid);
495 if (PABC_OK != status) 498 if (PABC_OK != status)
496 { 499 {
497 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 500 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -502,11 +505,17 @@ pabc_create_presentation (void *cls,
502 pabc_free_public_parameters (ctx, &pp); 505 pabc_free_public_parameters (ctx, &pp);
503 return GNUNET_SYSERR; 506 return GNUNET_SYSERR;
504 } 507 }
505 printf ("%s", json); 508 char *json_enc;
509 GNUNET_STRINGS_base64_encode (json,
510 strlen (json) + 1,
511 &json_enc);
512 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
513 "Presentation: %s\n", json_enc);
506 // clean up 514 // clean up
507 *pres = GNUNET_RECLAIM_presentation_new (GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC, 515 *pres = GNUNET_RECLAIM_presentation_new (GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC,
508 json, 516 json_enc,
509 strlen (json) + 1); 517 strlen (json_enc) + 1);
518 GNUNET_free (json_enc);
510 PABC_FREE_NULL (json); 519 PABC_FREE_NULL (json);
511 pabc_free_proof (ctx, pp, &proof); 520 pabc_free_proof (ctx, pp, &proof);
512 pabc_free_credential (ctx, pp, &cred); 521 pabc_free_credential (ctx, pp, &cred);