aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-11-21 23:46:23 +0100
committerChristian Grothoff <christian@grothoff.org>2021-11-21 23:46:23 +0100
commit141015969be5bcdcd231cfa639250a537456255e (patch)
tree55b6d6fa87dfece9c826ec1608414083c32f849b
parent8e1adab1d9d32fbd4a6519e809b84b9f2518dfc9 (diff)
downloadanastasis-141015969be5bcdcd231cfa639250a537456255e.tar.gz
anastasis-141015969be5bcdcd231cfa639250a537456255e.zip
-bugfixes
-rw-r--r--src/testing/testing_api_cmd_keyshare_lookup.c21
-rw-r--r--src/testing/testing_cmd_challenge_answer.c8
2 files changed, 16 insertions, 13 deletions
diff --git a/src/testing/testing_api_cmd_keyshare_lookup.c b/src/testing/testing_api_cmd_keyshare_lookup.c
index 5b2adea..8b06a67 100644
--- a/src/testing/testing_api_cmd_keyshare_lookup.c
+++ b/src/testing/testing_api_cmd_keyshare_lookup.c
@@ -222,7 +222,7 @@ keyshare_lookup_run (void *cls,
222 const struct ANASTASIS_CRYPTO_TruthKeyP *truth_key; 222 const struct ANASTASIS_CRYPTO_TruthKeyP *truth_key;
223 const struct ANASTASIS_CRYPTO_TruthUUIDP *truth_uuid; 223 const struct ANASTASIS_CRYPTO_TruthUUIDP *truth_uuid;
224 const struct ANASTASIS_PaymentSecretP *payment_secret; 224 const struct ANASTASIS_PaymentSecretP *payment_secret;
225 const char **answer; 225 const char **answerp;
226 226
227 ksls->is = is; 227 ksls->is = is;
228 if (NULL == ksls->upload_reference) 228 if (NULL == ksls->upload_reference)
@@ -301,13 +301,13 @@ keyshare_lookup_run (void *cls,
301 } 301 }
302 if (GNUNET_OK != 302 if (GNUNET_OK !=
303 ANASTASIS_TESTING_get_trait_code (download_cmd, 303 ANASTASIS_TESTING_get_trait_code (download_cmd,
304 &answer)) 304 &answerp))
305 { 305 {
306 GNUNET_break (0); 306 GNUNET_break (0);
307 TALER_TESTING_interpreter_fail (ksls->is); 307 TALER_TESTING_interpreter_fail (ksls->is);
308 return; 308 return;
309 } 309 }
310 if (NULL == *answer) 310 if (NULL == *answerp)
311 { 311 {
312 GNUNET_break (0); 312 GNUNET_break (0);
313 TALER_TESTING_interpreter_fail (ksls->is); 313 TALER_TESTING_interpreter_fail (ksls->is);
@@ -317,7 +317,7 @@ keyshare_lookup_run (void *cls,
317 else 317 else
318 { 318 {
319 /* answer is the answer */ 319 /* answer is the answer */
320 answer = &ksls->answer; 320 answerp = &ksls->answer;
321 } 321 }
322 322
323 if (NULL != ksls->payment_reference) 323 if (NULL != ksls->payment_reference)
@@ -344,9 +344,9 @@ keyshare_lookup_run (void *cls,
344 { 344 {
345 struct GNUNET_HashCode h_answer; 345 struct GNUNET_HashCode h_answer;
346 346
347 if (NULL != *answer) 347 if (NULL != *answerp)
348 GNUNET_CRYPTO_hash (*answer, 348 GNUNET_CRYPTO_hash (*answerp,
349 strlen (*answer), 349 strlen (*answerp),
350 &h_answer); 350 &h_answer);
351 ksls->kslo = ANASTASIS_keyshare_lookup (is->ctx, 351 ksls->kslo = ANASTASIS_keyshare_lookup (is->ctx,
352 ksls->anastasis_url, 352 ksls->anastasis_url,
@@ -354,7 +354,7 @@ keyshare_lookup_run (void *cls,
354 truth_key, 354 truth_key,
355 payment_secret, 355 payment_secret,
356 GNUNET_TIME_UNIT_ZERO, 356 GNUNET_TIME_UNIT_ZERO,
357 (NULL != *answer) 357 (NULL != *answerp)
358 ? &h_answer 358 ? &h_answer
359 : NULL, 359 : NULL,
360 &keyshare_lookup_cb, 360 &keyshare_lookup_cb,
@@ -386,6 +386,7 @@ keyshare_lookup_cleanup (void *cls,
386 GNUNET_free (ksls->pay_uri); 386 GNUNET_free (ksls->pay_uri);
387 GNUNET_free (ksls->order_id); 387 GNUNET_free (ksls->order_id);
388 GNUNET_free (ksls->code); 388 GNUNET_free (ksls->code);
389 GNUNET_free (ksls->filename);
389 GNUNET_free (ksls->instructions); 390 GNUNET_free (ksls->instructions);
390 GNUNET_free (ksls->redirect_uri); 391 GNUNET_free (ksls->redirect_uri);
391 GNUNET_free (ksls); 392 GNUNET_free (ksls);
@@ -401,7 +402,7 @@ keyshare_lookup_cleanup (void *cls,
401 * @param index index number of the object to extract. 402 * @param index index number of the object to extract.
402 * @return #GNUNET_OK on success 403 * @return #GNUNET_OK on success
403 */ 404 */
404static int 405static enum GNUNET_GenericReturnValue
405keyshare_lookup_traits (void *cls, 406keyshare_lookup_traits (void *cls,
406 const void **ret, 407 const void **ret,
407 const char *trait, 408 const char *trait,
@@ -416,7 +417,7 @@ keyshare_lookup_traits (void *cls,
416 TALER_TESTING_make_trait_order_id ( 417 TALER_TESTING_make_trait_order_id (
417 (const char **) &ksls->order_id), 418 (const char **) &ksls->order_id),
418 ANASTASIS_TESTING_make_trait_code ( 419 ANASTASIS_TESTING_make_trait_code (
419 (const char **) ksls->code), 420 (const char **) &ksls->code),
420 TALER_TESTING_trait_end () 421 TALER_TESTING_trait_end ()
421 }; 422 };
422 423
diff --git a/src/testing/testing_cmd_challenge_answer.c b/src/testing/testing_cmd_challenge_answer.c
index ec8d03d..c9cb976 100644
--- a/src/testing/testing_cmd_challenge_answer.c
+++ b/src/testing/testing_cmd_challenge_answer.c
@@ -91,7 +91,7 @@ struct ChallengeState
91 /** 91 /**
92 * code we read in the file generated by the plugin 92 * code we read in the file generated by the plugin
93 */ 93 */
94 char code[22]; 94 char *code;
95 95
96}; 96};
97 97
@@ -166,6 +166,7 @@ challenge_answer_cb (void *af_cls,
166 TALER_TESTING_interpreter_fail (cs->is); 166 TALER_TESTING_interpreter_fail (cs->is);
167 return; 167 return;
168 } 168 }
169 cs->code = GNUNET_malloc (22);
169 if (0 == fscanf (file, 170 if (0 == fscanf (file,
170 "%21s", 171 "%21s",
171 cs->code)) 172 cs->code))
@@ -480,6 +481,7 @@ challenge_cleanup (void *cls,
480 } 481 }
481 GNUNET_free (cs->payment_uri); 482 GNUNET_free (cs->payment_uri);
482 GNUNET_free (cs->order_id); 483 GNUNET_free (cs->order_id);
484 GNUNET_free (cs->code);
483 GNUNET_free (cs); 485 GNUNET_free (cs);
484} 486}
485 487
@@ -493,7 +495,7 @@ challenge_cleanup (void *cls,
493 * @param index index number of the object to extract. 495 * @param index index number of the object to extract.
494 * @return #GNUNET_OK on success 496 * @return #GNUNET_OK on success
495 */ 497 */
496static int 498static enum GNUNET_GenericReturnValue
497challenge_create_traits (void *cls, 499challenge_create_traits (void *cls,
498 const void **ret, 500 const void **ret,
499 const char *trait, 501 const char *trait,
@@ -502,7 +504,7 @@ challenge_create_traits (void *cls,
502 struct ChallengeState *cs = cls; 504 struct ChallengeState *cs = cls;
503 struct TALER_TESTING_Trait traits[] = { 505 struct TALER_TESTING_Trait traits[] = {
504 ANASTASIS_TESTING_make_trait_code ( 506 ANASTASIS_TESTING_make_trait_code (
505 (const char **) cs->code), 507 (const char **) &cs->code),
506 ANASTASIS_TESTING_make_trait_payment_secret ( 508 ANASTASIS_TESTING_make_trait_payment_secret (
507 &cs->payment_order_req), 509 &cs->payment_order_req),
508 TALER_TESTING_make_trait_payto_uri ( 510 TALER_TESTING_make_trait_payto_uri (