aboutsummaryrefslogtreecommitdiff
path: root/src/credential/gnunet-credential.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2016-12-05 19:26:27 +0100
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2016-12-05 19:26:27 +0100
commitfcb5ecaede036d2bb89e5123345fd391520c344a (patch)
tree28745989144d41fa0ee0171626092a7c7f8492ee /src/credential/gnunet-credential.c
parent646723dd495657a184d1f7e439f4958a72bee1df (diff)
downloadgnunet-fcb5ecaede036d2bb89e5123345fd391520c344a.tar.gz
gnunet-fcb5ecaede036d2bb89e5123345fd391520c344a.zip
-add issue test
Diffstat (limited to 'src/credential/gnunet-credential.c')
-rw-r--r--src/credential/gnunet-credential.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/credential/gnunet-credential.c b/src/credential/gnunet-credential.c
index eaad6d5cf..874aa29cb 100644
--- a/src/credential/gnunet-credential.c
+++ b/src/credential/gnunet-credential.c
@@ -180,6 +180,7 @@ identity_cb (void *cls,
180{ 180{
181 const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 181 const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
182 struct GNUNET_CREDENTIAL_CredentialRecordData *crd; 182 struct GNUNET_CREDENTIAL_CredentialRecordData *crd;
183 char *res;
183 184
184 el = NULL; 185 el = NULL;
185 if (NULL == ego) 186 if (NULL == ego)
@@ -200,10 +201,11 @@ identity_cb (void *cls,
200 privkey, 201 privkey,
201 &subject_pkey, 202 &subject_pkey,
202 issuer_attr); 203 issuer_attr);
203 printf ("Success.\n"); 204 res = GNUNET_GNSRECORD_value_to_string (GNUNET_GNSRECORD_TYPE_CREDENTIAL,
204 printf (GNUNET_GNSRECORD_value_to_string (GNUNET_GNSRECORD_TYPE_CREDENTIAL, 205 crd,
205 crd, 206 sizeof (struct GNUNET_CREDENTIAL_CredentialRecordData) + strlen (issuer_attr) + 1);
206 sizeof (crd) + strlen (issuer_attr) + 1)); 207 printf ("%s\n", res);
208 GNUNET_SCHEDULER_shutdown ();
207} 209}
208 210
209 211
@@ -225,15 +227,6 @@ run (void *cls,
225{ 227{
226 228
227 cfg = c; 229 cfg = c;
228 credential = GNUNET_CREDENTIAL_connect (cfg);
229
230 if (NULL == credential)
231 {
232 fprintf (stderr,
233 _("Failed to connect to CREDENTIAL\n"));
234 return;
235 }
236
237 230
238 231
239 tt = GNUNET_SCHEDULER_add_delayed (timeout, 232 tt = GNUNET_SCHEDULER_add_delayed (timeout,
@@ -281,6 +274,15 @@ run (void *cls,
281 issuer_key); 274 issuer_key);
282 GNUNET_SCHEDULER_shutdown (); 275 GNUNET_SCHEDULER_shutdown ();
283 } 276 }
277 credential = GNUNET_CREDENTIAL_connect (cfg);
278
279 if (NULL == credential)
280 {
281 fprintf (stderr,
282 _("Failed to connect to CREDENTIAL\n"));
283 return;
284 }
285
284 286
285 verify_request = GNUNET_CREDENTIAL_verify(credential, 287 verify_request = GNUNET_CREDENTIAL_verify(credential,
286 &issuer_pkey, 288 &issuer_pkey,