diff options
Diffstat (limited to 'src/exchange-lib')
| -rw-r--r-- | src/exchange-lib/exchange_api_common.c | 25 | ||||
| -rw-r--r-- | src/exchange-lib/testing_api_cmd_deposit.c | 4 | ||||
| -rw-r--r-- | src/exchange-lib/testing_api_cmd_payback.c | 2 | ||||
| -rw-r--r-- | src/exchange-lib/testing_api_cmd_refresh.c | 4 | ||||
| -rw-r--r-- | src/exchange-lib/testing_api_cmd_refund.c | 2 | ||||
| -rw-r--r-- | src/exchange-lib/testing_api_cmd_track.c | 4 | ||||
| -rw-r--r-- | src/exchange-lib/testing_api_trait_coin_priv.c | 2 | 
7 files changed, 34 insertions, 9 deletions
| diff --git a/src/exchange-lib/exchange_api_common.c b/src/exchange-lib/exchange_api_common.c index de05348f..6b0aa6ff 100644 --- a/src/exchange-lib/exchange_api_common.c +++ b/src/exchange-lib/exchange_api_common.c @@ -325,4 +325,29 @@ TALER_EXCHANGE_verify_coin_history (const char *currency,  } +/** + * Obtain meta data about an exchange (online) signing + * key. + * + * @param keys from where to obtain the meta data + * @param exchange_pub public key to lookup + * @return NULL on error (@a exchange_pub not known) + */ +const struct TALER_EXCHANGE_SigningPublicKey * +TALER_EXCHANGE_get_exchange_signing_key_info (const struct TALER_EXCHANGE_Keys *keys, +					      const struct TALER_ExchangePublicKeyP *exchange_pub) +{ +  for (unsigned int i=0;i<keys->num_sign_keys;i++) +  { +    const struct TALER_EXCHANGE_SigningPublicKey *spk; + +    spk = &keys->sign_keys[i]; +    if (0 == memcmp (exchange_pub, +		     &spk->key, +		     sizeof (struct TALER_ExchangePublicKeyP))) +      return spk; +  } +  return NULL; +} +  /* end of exchange_api_common.c */ diff --git a/src/exchange-lib/testing_api_cmd_deposit.c b/src/exchange-lib/testing_api_cmd_deposit.c index 4f3757f5..59209fcc 100644 --- a/src/exchange-lib/testing_api_cmd_deposit.c +++ b/src/exchange-lib/testing_api_cmd_deposit.c @@ -246,7 +246,7 @@ deposit_run (void *cls,    struct DepositState *ds = cls;    const struct TALER_TESTING_Command *coin_cmd;    struct TALER_TESTING_Command *this_cmd; -  struct TALER_CoinSpendPrivateKeyP *coin_priv; +  const struct TALER_CoinSpendPrivateKeyP *coin_priv;    struct TALER_CoinSpendPublicKeyP coin_pub;    const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;    struct TALER_DenominationSignature *denom_pub_sig; @@ -450,7 +450,7 @@ deposit_traits (void *cls,    struct DepositState *ds = cls;    const struct TALER_TESTING_Command *coin_cmd;    /* Will point to coin cmd internals. */ -  struct TALER_CoinSpendPrivateKeyP *coin_spent_priv; +  const struct TALER_CoinSpendPrivateKeyP *coin_spent_priv;    coin_cmd = TALER_TESTING_interpreter_lookup_command      (ds->is, diff --git a/src/exchange-lib/testing_api_cmd_payback.c b/src/exchange-lib/testing_api_cmd_payback.c index 56026162..43118ef0 100644 --- a/src/exchange-lib/testing_api_cmd_payback.c +++ b/src/exchange-lib/testing_api_cmd_payback.c @@ -224,7 +224,7 @@ payback_run (void *cls,  {    struct PaybackState *ps = cls;    const struct TALER_TESTING_Command *coin_cmd; -  struct TALER_CoinSpendPrivateKeyP *coin_priv; +  const struct TALER_CoinSpendPrivateKeyP *coin_priv;    struct TALER_DenominationBlindingKeyP *blinding_key;    const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;    struct TALER_DenominationSignature *coin_sig; diff --git a/src/exchange-lib/testing_api_cmd_refresh.c b/src/exchange-lib/testing_api_cmd_refresh.c index 982b4d29..93939bf8 100644 --- a/src/exchange-lib/testing_api_cmd_refresh.c +++ b/src/exchange-lib/testing_api_cmd_refresh.c @@ -715,7 +715,7 @@ refresh_link_run (void *cls,      }    } -  struct TALER_CoinSpendPrivateKeyP *coin_priv; +  const struct TALER_CoinSpendPrivateKeyP *coin_priv;    if (GNUNET_OK != TALER_TESTING_get_trait_coin_priv      (coin_cmd, 0, &coin_priv))    { @@ -903,7 +903,7 @@ refresh_melt_run (void *cls,      (num_fresh_coins,       struct TALER_EXCHANGE_DenomPublicKey);    { -    struct TALER_CoinSpendPrivateKeyP *melt_priv; +    const struct TALER_CoinSpendPrivateKeyP *melt_priv;      struct TALER_Amount melt_amount;      struct TALER_Amount fresh_amount;      struct TALER_DenominationSignature *melt_sig; diff --git a/src/exchange-lib/testing_api_cmd_refund.c b/src/exchange-lib/testing_api_cmd_refund.c index 136ee631..de70da27 100644 --- a/src/exchange-lib/testing_api_cmd_refund.c +++ b/src/exchange-lib/testing_api_cmd_refund.c @@ -143,7 +143,7 @@ refund_run (void *cls,              struct TALER_TESTING_Interpreter *is)  {    struct RefundState *rs = cls; -  struct TALER_CoinSpendPrivateKeyP *coin_priv; +  const struct TALER_CoinSpendPrivateKeyP *coin_priv;    struct TALER_CoinSpendPublicKeyP coin;    const char *contract_terms;    struct GNUNET_HashCode h_contract_terms; diff --git a/src/exchange-lib/testing_api_cmd_track.c b/src/exchange-lib/testing_api_cmd_track.c index c7fbf408..201ac3f9 100644 --- a/src/exchange-lib/testing_api_cmd_track.c +++ b/src/exchange-lib/testing_api_cmd_track.c @@ -259,14 +259,14 @@ deposit_wtid_cb   * @param cmd the command to execute.   * @param is the interpreter state.   */ -void +static void  track_transaction_run (void *cls,                         const struct TALER_TESTING_Command *cmd,                         struct TALER_TESTING_Interpreter *is)  {    struct TrackTransactionState *tts = cls;    const struct TALER_TESTING_Command *transaction_cmd; -  struct TALER_CoinSpendPrivateKeyP *coin_priv; +  const struct TALER_CoinSpendPrivateKeyP *coin_priv;    struct TALER_CoinSpendPublicKeyP coin_pub;    const char *contract_terms;    const json_t *wire_details; diff --git a/src/exchange-lib/testing_api_trait_coin_priv.c b/src/exchange-lib/testing_api_trait_coin_priv.c index 5e9193f1..baaa794b 100644 --- a/src/exchange-lib/testing_api_trait_coin_priv.c +++ b/src/exchange-lib/testing_api_trait_coin_priv.c @@ -46,7 +46,7 @@ int  TALER_TESTING_get_trait_coin_priv    (const struct TALER_TESTING_Command *cmd,     unsigned int index, -   struct TALER_CoinSpendPrivateKeyP **coin_priv) +   const struct TALER_CoinSpendPrivateKeyP **coin_priv)  {    return cmd->traits (cmd->cls,                        (void **) coin_priv, | 
