summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_link.c
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2021-10-25 17:19:41 +0200
committerChristian Grothoff <christian@grothoff.org>2021-10-27 09:23:13 +0200
commitf7d08e8c2bbd6c5eaa73f339f551683c9d93ebeb (patch)
tree13b04b5bcfca900f89ecdb1f979e6602ba1f0522 /src/lib/exchange_api_link.c
parent58ea04167ca46e7ef82d25900cae731741854279 (diff)
downloadexchange-f7d08e8c2bbd6c5eaa73f339f551683c9d93ebeb.tar.gz
exchange-f7d08e8c2bbd6c5eaa73f339f551683c9d93ebeb.tar.bz2
exchange-f7d08e8c2bbd6c5eaa73f339f551683c9d93ebeb.zip
-work on FTBFS;
Diffstat (limited to 'src/lib/exchange_api_link.c')
-rw-r--r--src/lib/exchange_api_link.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/lib/exchange_api_link.c b/src/lib/exchange_api_link.c
index ceb318841..e36ffcd93 100644
--- a/src/lib/exchange_api_link.c
+++ b/src/lib/exchange_api_link.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2015-2020 Taler Systems SA
+ Copyright (C) 2015-2021 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -92,12 +92,15 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh,
struct TALER_DenominationPublicKey *pub)
{
struct GNUNET_CRYPTO_RsaSignature *bsig;
- struct GNUNET_CRYPTO_RsaPublicKey *rpub;
+ struct TALER_DenominationPublicKey rpub;
struct TALER_CoinSpendSignatureP link_sig;
struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_rsa_public_key ("denom_pub", &rpub),
- GNUNET_JSON_spec_rsa_signature ("ev_sig", &bsig),
- GNUNET_JSON_spec_fixed_auto ("link_sig", &link_sig),
+ TALER_JSON_spec_denomination_public_key ("denom_pub",
+ &rpub),
+ GNUNET_JSON_spec_rsa_signature ("ev_sig",
+ &bsig),
+ GNUNET_JSON_spec_fixed_auto ("link_sig",
+ &link_sig),
GNUNET_JSON_spec_end ()
};
struct TALER_TransferSecretP secret;
@@ -121,21 +124,21 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh,
/* extract coin and signature */
*coin_priv = fc.coin_priv;
- sig->rsa_signature
+ sig->cipher = TALER_DENOMINATION_RSA;
+ sig->details.rsa_signature
= TALER_rsa_unblind (bsig,
&fc.blinding_key.bks,
- rpub);
+ rpub.details.rsa_public_key);
/* verify link_sig */
{
struct TALER_PlanchetDetail pd;
- struct GNUNET_HashCode c_hash;
+ struct TALER_CoinPubHash c_hash;
struct TALER_CoinSpendPublicKeyP old_coin_pub;
GNUNET_CRYPTO_eddsa_key_get_public (&lh->coin_priv.eddsa_priv,
&old_coin_pub.eddsa_pub);
- pub->rsa_public_key = rpub;
if (GNUNET_OK !=
- TALER_planchet_prepare (pub,
+ TALER_planchet_prepare (&rpub,
&fc,
&c_hash,
&pd))
@@ -161,7 +164,8 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh,
}
/* clean up */
- pub->rsa_public_key = GNUNET_CRYPTO_rsa_public_key_dup (rpub);
+ TALER_denom_pub_deep_copy (pub,
+ &rpub);
GNUNET_JSON_parse_free (spec);
return GNUNET_OK;
}
@@ -323,10 +327,8 @@ parse_link_ok (struct TALER_EXCHANGE_LinkHandle *lh,
GNUNET_assert (off_coin <= num_coins);
for (i = 0; i<off_coin; i++)
{
- if (NULL != sigs[i].rsa_signature)
- GNUNET_CRYPTO_rsa_signature_free (sigs[i].rsa_signature);
- if (NULL != pubs[i].rsa_public_key)
- GNUNET_CRYPTO_rsa_public_key_free (pubs[i].rsa_public_key);
+ TALER_denom_sig_free (&sigs[i]);
+ TALER_denom_pub_free (&pubs[i]);
}
}
return ret;