From 40629e89920267dadba39f5f7f2ab3d844088a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Mon, 3 Jul 2023 16:18:40 +0200 Subject: [age-withdraw] added library function for age-withdraw - Added TALER_EXCHANGE_age_withdraw - Also: Change TALER_EXCHANGE_batch_withdraw and related functions to use GNUNET_CURL_ctx, TALER_EXCHANGE_keys and const char *echange_url --- src/util/exchange_signatures.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/util/exchange_signatures.c') diff --git a/src/util/exchange_signatures.c b/src/util/exchange_signatures.c index 6f8ebdaff..3aa464aa7 100644 --- a/src/util/exchange_signatures.c +++ b/src/util/exchange_signatures.c @@ -413,6 +413,34 @@ TALER_exchange_online_age_withdraw_confirmation_sign ( } +enum GNUNET_GenericReturnValue +TALER_exchange_online_age_withdraw_confirmation_verify ( + const struct TALER_AgeWithdrawCommitmentHashP *h_commitment, + uint32_t noreveal_index, + const struct TALER_ExchangePublicKeyP *exchange_pub, + const struct TALER_ExchangeSignatureP *exchange_sig) +{ + struct TALER_AgeWithdrawConfirmationPS confirm = { + .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_AGE_WITHDRAW), + .purpose.size = htonl (sizeof (confirm)), + .h_commitment = *h_commitment, + .noreveal_index = htonl (noreveal_index) + }; + + if (GNUNET_OK != + GNUNET_CRYPTO_eddsa_verify ( + TALER_SIGNATURE_EXCHANGE_CONFIRM_AGE_WITHDRAW, + &confirm, + &exchange_sig->eddsa_signature, + &exchange_pub->eddsa_pub)) + { + GNUNET_break_op (0); + return GNUNET_SYSERR; + } + return GNUNET_OK; +} + + /* TODO:oec: add signature for age-withdraw, age-reveal */ -- cgit v1.2.3