summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_handle.c
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-03-29 15:21:49 +0200
committerChristian Grothoff <grothoff@gnunet.org>2022-03-29 15:21:49 +0200
commit074ea7502e93b290f9300974f5a349a8de4f4753 (patch)
treea37f6f2c3125cc828de8fb4bc5d09100df49148e /src/lib/exchange_api_handle.c
parent3249687b2a25c728b3b86ffc099c682bfed9c145 (diff)
downloadexchange-074ea7502e93b290f9300974f5a349a8de4f4753.tar.gz
exchange-074ea7502e93b290f9300974f5a349a8de4f4753.tar.bz2
exchange-074ea7502e93b290f9300974f5a349a8de4f4753.zip
centralize exchange online signature logic
Diffstat (limited to 'src/lib/exchange_api_handle.c')
-rw-r--r--src/lib/exchange_api_handle.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index e0fcd2b93..feab4ac44 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -1136,11 +1136,7 @@ decode_keys_json (const json_t *resp_obj,
if (check_sig)
{
- struct TALER_ExchangeKeySetPS ks = {
- .purpose.size = htonl (sizeof (ks)),
- .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_KEY_SET),
- .list_issue_date = GNUNET_TIME_timestamp_hton (key_data->list_issue_date)
- };
+ struct GNUNET_HashCode hc;
/* If we had any age restricted denominations, add their hash to the end of
* the normal denominations. */
@@ -1160,16 +1156,18 @@ decode_keys_json (const json_t *resp_obj,
}
GNUNET_CRYPTO_hash_context_finish (hash_context,
- &ks.hc);
+ &hc);
hash_context = NULL;
EXITIF (GNUNET_OK !=
TALER_EXCHANGE_test_signing_key (key_data,
&pub));
+
EXITIF (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_KEY_SET,
- &ks,
- &sig.eddsa_signature,
- &pub.eddsa_pub));
+ TALER_exchange_online_key_set_verify (
+ key_data->list_issue_date,
+ &hc,
+ &pub,
+ &sig));
}
return GNUNET_OK;
EXITIF_exit: