aboutsummaryrefslogtreecommitdiff
path: root/src/credential/gnunet-credential.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/credential/gnunet-credential.c')
-rw-r--r--src/credential/gnunet-credential.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/credential/gnunet-credential.c b/src/credential/gnunet-credential.c
index a743458d5..b31c2f66e 100644
--- a/src/credential/gnunet-credential.c
+++ b/src/credential/gnunet-credential.c
@@ -26,6 +26,8 @@
26#include <gnunet_util_lib.h> 26#include <gnunet_util_lib.h>
27#include <gnunet_credential_service.h> 27#include <gnunet_credential_service.h>
28#include <gnunet_gnsrecord_lib.h> 28#include <gnunet_gnsrecord_lib.h>
29#include "credential_misc.h"
30#include "credential_serialization.h"
29 31
30/** 32/**
31 * Configuration we are using. 33 * Configuration we are using.
@@ -220,7 +222,7 @@ identity_cb (void *cls,
220 const struct GNUNET_IDENTITY_Ego *ego) 222 const struct GNUNET_IDENTITY_Ego *ego)
221{ 223{
222 const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 224 const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
223 struct GNUNET_CREDENTIAL_CredentialRecordData *crd; 225 struct GNUNET_CREDENTIAL_Credential *crd;
224 struct GNUNET_TIME_Absolute etime_abs; 226 struct GNUNET_TIME_Absolute etime_abs;
225 struct GNUNET_TIME_Relative etime_rel; 227 struct GNUNET_TIME_Relative etime_rel;
226 char *res; 228 char *res;
@@ -261,14 +263,13 @@ identity_cb (void *cls,
261 privkey = GNUNET_IDENTITY_ego_get_private_key (ego); 263 privkey = GNUNET_IDENTITY_ego_get_private_key (ego);
262 GNUNET_free_non_null (issuer_ego_name); 264 GNUNET_free_non_null (issuer_ego_name);
263 issuer_ego_name = NULL; 265 issuer_ego_name = NULL;
264 crd = GNUNET_CREDENTIAL_issue (credential, 266 crd = GNUNET_CREDENTIAL_credential_issue (privkey,
265 privkey, 267 &subject_pkey,
266 &subject_pkey, 268 issuer_attr,
267 issuer_attr, 269 &etime_abs);
268 &etime_abs); 270
269 res = GNUNET_GNSRECORD_value_to_string (GNUNET_GNSRECORD_TYPE_CREDENTIAL, 271 res = GNUNET_CREDENTIAL_credential_to_string (crd);
270 crd, 272 GNUNET_free (crd);
271 sizeof (struct GNUNET_CREDENTIAL_CredentialRecordData) + strlen (issuer_attr) + 1);
272 printf ("%s\n", res); 273 printf ("%s\n", res);
273 GNUNET_SCHEDULER_shutdown (); 274 GNUNET_SCHEDULER_shutdown ();
274} 275}
@@ -354,7 +355,7 @@ run (void *cls,
354 _("You must provide issuer and subject attributes\n")); 355 _("You must provide issuer and subject attributes\n"));
355 GNUNET_SCHEDULER_shutdown (); 356 GNUNET_SCHEDULER_shutdown ();
356 } 357 }
357 358
358 printf ("Trying to find a chain from a credential under %s of %s to the attribute %s issued by %s\n", 359 printf ("Trying to find a chain from a credential under %s of %s to the attribute %s issued by %s\n",
359 subject_credential, subject_key, issuer_attr, issuer_key); 360 subject_credential, subject_key, issuer_attr, issuer_key);
360 361