From 891018f69f52244fd4cb61b50e3b3aeaeb0d8f50 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 28 Mar 2015 14:22:21 +0100 Subject: minor renaming of signature values and improved documentation of signatures, also adding a few missing fields to signatures to address #3631 --- src/mint/taler-mint-httpd_db.h | 2 +- src/mint/taler-mint-httpd_deposit.c | 4 ++-- src/mint/taler-mint-httpd_refresh.c | 6 +++--- src/mint/taler-mint-httpd_responses.c | 10 +++++----- src/mint/taler-mint-httpd_withdraw.c | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/mint') diff --git a/src/mint/taler-mint-httpd_db.h b/src/mint/taler-mint-httpd_db.h index 3e8a7df7f..8d51463d8 100644 --- a/src/mint/taler-mint-httpd_db.h +++ b/src/mint/taler-mint-httpd_db.h @@ -87,7 +87,7 @@ struct TMH_DB_MeltDetails * Signature allowing the melt (using * a `struct RefreshMeltConfirmSignRequestBody`) to sign over. */ - union TALER_CoinSpendSignatureP melt_sig; + struct TALER_CoinSpendSignatureP melt_sig; /** * How much of the coin's value did the client allow to be melted? diff --git a/src/mint/taler-mint-httpd_deposit.c b/src/mint/taler-mint-httpd_deposit.c index e732c87d7..09e101f60 100644 --- a/src/mint/taler-mint-httpd_deposit.c +++ b/src/mint/taler-mint-httpd_deposit.c @@ -60,7 +60,7 @@ verify_and_execute_deposit (struct MHD_Connection *connection, struct TALER_MINTDB_DenominationKeyIssueInformation *dki; struct TALER_Amount fee_deposit; - dr.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_DEPOSIT); + dr.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_DEPOSIT); dr.purpose.size = htonl (sizeof (struct TALER_DepositRequestPS)); dr.h_contract = deposit->h_contract; dr.h_wire = deposit->h_wire; @@ -69,7 +69,7 @@ verify_and_execute_deposit (struct MHD_Connection *connection, &deposit->amount_with_fee); dr.coin_pub = deposit->coin.coin_pub; if (GNUNET_OK != - GNUNET_CRYPTO_ecdsa_verify (TALER_SIGNATURE_WALLET_DEPOSIT, + GNUNET_CRYPTO_ecdsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT, &dr.purpose, &deposit->csig.ecdsa_signature, &deposit->coin.coin_pub.ecdsa_pub)) diff --git a/src/mint/taler-mint-httpd_refresh.c b/src/mint/taler-mint-httpd_refresh.c index ef7fb03ad..53671dfab 100644 --- a/src/mint/taler-mint-httpd_refresh.c +++ b/src/mint/taler-mint-httpd_refresh.c @@ -176,7 +176,7 @@ get_coin_public_info (struct MHD_Connection *connection, struct TMH_DB_MeltDetails *r_melt_detail) { int ret; - union TALER_CoinSpendSignatureP melt_sig; + struct TALER_CoinSpendSignatureP melt_sig; struct TALER_DenominationSignature sig; struct TALER_DenominationPublicKey pk; struct TALER_Amount amount; @@ -244,13 +244,13 @@ verify_coin_public_info (struct MHD_Connection *connection, struct TALER_Amount fee_refresh; body.purpose.size = htonl (sizeof (struct TALER_RefreshMeltCoinAffirmationPS)); - body.purpose.purpose = htonl (TALER_SIGNATURE_COIN_MELT); + body.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_MELT); body.session_hash = *session_hash; TALER_amount_hton (&body.amount_with_fee, &r_melt_detail->melt_amount_with_fee); body.coin_pub = r_public_info->coin_pub; if (GNUNET_OK != - GNUNET_CRYPTO_ecdsa_verify (TALER_SIGNATURE_COIN_MELT, + GNUNET_CRYPTO_ecdsa_verify (TALER_SIGNATURE_WALLET_COIN_MELT, &body.purpose, &r_melt_detail->melt_sig.ecdsa_signature, &r_public_info->coin_pub.ecdsa_pub)) diff --git a/src/mint/taler-mint-httpd_responses.c b/src/mint/taler-mint-httpd_responses.c index 95bb95cef..c9ca51413 100644 --- a/src/mint/taler-mint-httpd_responses.c +++ b/src/mint/taler-mint-httpd_responses.c @@ -294,7 +294,7 @@ TMH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection, json_t *sig_json; int ret; - dc.purpose.purpose = htonl (TALER_SIGNATURE_COIN_DEPOSIT); + dc.purpose.purpose = htonl (TALER_SIGNATURE_MINT_CONFIRM_DEPOSIT); dc.purpose.size = htonl (sizeof (struct TALER_DepositConfirmationPS)); dc.h_contract = *h_contract; dc.h_wire = *h_wire; @@ -344,7 +344,7 @@ compile_transaction_history (const struct TALER_MINT_DB_TransactionList *tl) type = "deposit"; value = deposit->amount_with_fee; - dr.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_DEPOSIT); + dr.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_DEPOSIT); dr.purpose.size = htonl (sizeof (struct TALER_DepositRequestPS)); dr.h_contract = deposit->h_contract; dr.h_wire = deposit->h_wire; @@ -363,7 +363,7 @@ compile_transaction_history (const struct TALER_MINT_DB_TransactionList *tl) type = "melt"; value = melt->amount_with_fee; - ms.purpose.purpose = htonl (TALER_SIGNATURE_COIN_MELT); + ms.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_MELT); ms.purpose.size = htonl (sizeof (struct TALER_RefreshMeltCoinAffirmationPS)); ms.session_hash = melt->session_hash; TALER_amount_hton (&ms.amount_with_fee, @@ -498,7 +498,7 @@ compile_reserve_history (const struct ReserveHistory *rh, return NULL; } ret = 1; - wr.purpose.purpose = htonl (TALER_SIGNATURE_RESERVE_WITHDRAW_REQUEST); + wr.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW); wr.purpose.size = htonl (sizeof (struct TALER_WithdrawRequestPS)); wr.reserve_pub = pos->details.withdraw->reserve_pub; GNUNET_CRYPTO_rsa_public_key_hash (pos->details.withdraw->denom_pub.rsa_public_key, @@ -683,7 +683,7 @@ TMH_RESPONSE_reply_refresh_melt_success (struct MHD_Connection *connection, int ret; body.purpose.size = htonl (sizeof (struct TALER_RefreshMeltConfirmationPS)); - body.purpose.purpose = htonl (TALER_SIGNATURE_MINT_MELT_RESPONSE); + body.purpose.purpose = htonl (TALER_SIGNATURE_MINT_CONFIRM_MELT); body.session_hash = *session_hash; body.noreveal_index = htons (noreveal_index); TMH_KS_sign (&body.purpose, diff --git a/src/mint/taler-mint-httpd_withdraw.c b/src/mint/taler-mint-httpd_withdraw.c index 0d700df6f..e7a122213 100644 --- a/src/mint/taler-mint-httpd_withdraw.c +++ b/src/mint/taler-mint-httpd_withdraw.c @@ -138,7 +138,7 @@ TMH_WITHDRAW_handler_withdraw_sign (struct TMH_RequestHandler *rh, /* verify signature! */ wsrd.purpose.size = htonl (sizeof (struct TALER_WithdrawRequestPS)); - wsrd.purpose.purpose = htonl (TALER_SIGNATURE_RESERVE_WITHDRAW_REQUEST); + wsrd.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW); GNUNET_CRYPTO_hash (denomination_pub_data, denomination_pub_data_size, &wsrd.h_denomination_pub); @@ -146,7 +146,7 @@ TMH_WITHDRAW_handler_withdraw_sign (struct TMH_RequestHandler *rh, blinded_msg_len, &wsrd.h_coin_envelope); if (GNUNET_OK != - GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_RESERVE_WITHDRAW_REQUEST, + GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW, &wsrd.purpose, &signature.eddsa_signature, &wsrd.reserve_pub.eddsa_pub)) -- cgit v1.2.3