diff options
| author | Christian Grothoff <christian@grothoff.org> | 2015-08-14 22:42:19 +0200 | 
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2015-08-14 22:42:19 +0200 | 
| commit | a8f65175f46cbada28d801d144e8be71b268dd50 (patch) | |
| tree | cb74a510094b0d6af61a3f7111ed94b551754e07 | |
| parent | 3d1627daa7b62a30b8bb2d201829b1a6034e85be (diff) | |
adapt code to match (updated) spec
| -rw-r--r-- | src/mint-lib/mint_api_refresh.c | 24 | ||||
| -rw-r--r-- | src/mint-lib/test_mint_api.c | 2 | ||||
| -rw-r--r-- | src/mint/taler-mint-httpd_responses.c | 15 | 
3 files changed, 30 insertions, 11 deletions
| diff --git a/src/mint-lib/mint_api_refresh.c b/src/mint-lib/mint_api_refresh.c index 92535263..e09c0d32 100644 --- a/src/mint-lib/mint_api_refresh.c +++ b/src/mint-lib/mint_api_refresh.c @@ -1718,19 +1718,31 @@ struct TALER_MINT_RefreshRevealHandle   * to the application via the callback.   *   * @param rrh operation handle - * @param jsona reply from the mint + * @param json reply from the mint   * @param[out] coin_privs array of length `num_fresh_coins`, initialized to contain private keys   * @param[out] sigs array of length `num_fresh_coins`, initialized to cointain RSA signatures   * @return #GNUNET_OK on success, #GNUNET_SYSERR on errors   */  static int  refresh_reveal_ok (struct TALER_MINT_RefreshRevealHandle *rrh, -                   json_t *jsona, +                   json_t *json,                     struct TALER_CoinSpendPrivateKeyP *coin_privs,                     struct TALER_DenominationSignature *sigs)  {    unsigned int i; +  json_t *jsona; +  struct MAJ_Specification spec[] = { +    MAJ_spec_json ("ev_sigs", &jsona), +    MAJ_spec_end +  }; +  if (GNUNET_OK != +      MAJ_parse_json (json, +		      spec)) +  { +    GNUNET_break_op (0); +    return GNUNET_SYSERR; +  }    if (! json_is_array (jsona))    {      /* We expected an array of coins */ @@ -1747,7 +1759,7 @@ refresh_reveal_ok (struct TALER_MINT_RefreshRevealHandle *rrh,    {      const struct FreshCoin *fc;      struct TALER_DenominationPublicKey *pk; -    json_t *json; +    json_t *jsonai;      struct GNUNET_CRYPTO_rsa_Signature *blind_sig;      struct GNUNET_CRYPTO_rsa_Signature *sig;      struct TALER_CoinSpendPublicKeyP coin_pub; @@ -1760,11 +1772,11 @@ refresh_reveal_ok (struct TALER_MINT_RefreshRevealHandle *rrh,      fc = &rrh->md->fresh_coins[rrh->noreveal_index][i];      pk = &rrh->md->fresh_pks[i]; -    json = json_array_get (jsona, i); -    GNUNET_assert (NULL != json); +    jsonai = json_array_get (jsona, i); +    GNUNET_assert (NULL != jsonai);      if (GNUNET_OK != -        MAJ_parse_json (json, +        MAJ_parse_json (jsonai,                          spec))      {        GNUNET_break_op (0); diff --git a/src/mint-lib/test_mint_api.c b/src/mint-lib/test_mint_api.c index bbe81d5a..86797586 100644 --- a/src/mint-lib/test_mint_api.c +++ b/src/mint-lib/test_mint_api.c @@ -2019,7 +2019,7 @@ run (void *cls,    GNUNET_assert (NULL != mint);    shutdown_task      = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply -                                    (GNUNET_TIME_UNIT_SECONDS, 5), +                                    (GNUNET_TIME_UNIT_SECONDS, 30),                                      &do_shutdown, is);  } diff --git a/src/mint/taler-mint-httpd_responses.c b/src/mint/taler-mint-httpd_responses.c index 6c029b27..8a5573e8 100644 --- a/src/mint/taler-mint-httpd_responses.c +++ b/src/mint/taler-mint-httpd_responses.c @@ -783,17 +783,24 @@ TMH_RESPONSE_reply_refresh_reveal_success (struct MHD_Connection *connection,  {    int newcoin_index;    json_t *root; +  json_t *obj;    json_t *list;    int ret; -  root = json_object ();    list = json_array (); +  for (newcoin_index = 0; newcoin_index < num_newcoins; newcoin_index++) +  { +    obj = json_object (); +    json_object_set_new (obj, +			 "ev_sig", +			 TALER_json_from_rsa_signature (sigs[newcoin_index].rsa_signature)); +    json_array_append_new (list, +                           obj); +  } +  root = json_object ();    json_object_set_new (root,                         "ev_sigs",                         list); -  for (newcoin_index = 0; newcoin_index < num_newcoins; newcoin_index++) -    json_array_append_new (list, -                           TALER_json_from_rsa_signature (sigs[newcoin_index].rsa_signature));    ret = TMH_RESPONSE_reply_json (connection,                                   root,                                   MHD_HTTP_OK); | 
