From 074ea7502e93b290f9300974f5a349a8de4f4753 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 29 Mar 2022 15:21:49 +0200 Subject: centralize exchange online signature logic --- src/lib/exchange_api_handle.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/lib/exchange_api_handle.c') 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: -- cgit v1.2.3