summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-08 18:18:20 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-08 18:18:20 +0200
commit50bc862a684f8c5d4e3ece2712322bf078fe604f (patch)
tree54d4facce006a8437c58e64e7f2106a3487cba83
parentb22ec7570e830a3f71ed7c33b23879b2c3385387 (diff)
downloadexchange-50bc862a684f8c5d4e3ece2712322bf078fe604f.tar.gz
exchange-50bc862a684f8c5d4e3ece2712322bf078fe604f.tar.bz2
exchange-50bc862a684f8c5d4e3ece2712322bf078fe604f.zip
adapt to new GNUnet sign API (#6164)
-rw-r--r--src/auditor/taler-auditor-httpd_deposit-confirmation.c4
-rw-r--r--src/auditor/taler-auditor-sign.c7
-rw-r--r--src/auditor/taler-helper-auditor-aggregation.c2
-rw-r--r--src/auditor/taler-helper-auditor-coins.c10
-rw-r--r--src/auditor/taler-helper-auditor-reserves.c6
-rw-r--r--src/exchange-tools/taler-exchange-keycheck.c4
-rw-r--r--src/exchange-tools/taler-exchange-keyup.c21
-rw-r--r--src/exchange/taler-exchange-httpd_deposit.c4
-rw-r--r--src/exchange/taler-exchange-httpd_deposits_get.c4
-rw-r--r--src/exchange/taler-exchange-httpd_keystate.c26
-rw-r--r--src/exchange/taler-exchange-httpd_keystate.h36
-rw-r--r--src/exchange/taler-exchange-httpd_melt.c16
-rw-r--r--src/exchange/taler-exchange-httpd_recoup.c2
-rw-r--r--src/exchange/taler-exchange-httpd_refreshes_reveal.c10
-rw-r--r--src/exchange/taler-exchange-httpd_refund.c4
-rw-r--r--src/exchange/taler-exchange-httpd_responses.c16
-rw-r--r--src/exchange/taler-exchange-httpd_transfers_get.c2
-rw-r--r--src/exchange/taler-exchange-httpd_withdraw.c4
-rw-r--r--src/exchangedb/exchangedb_denomkeys.c9
-rw-r--r--src/exchangedb/test_exchangedb_fees.c9
-rw-r--r--src/lib/auditor_api_deposit_confirmation.c84
-rw-r--r--src/lib/exchange_api_common.c14
-rw-r--r--src/lib/exchange_api_deposit.c4
-rw-r--r--src/lib/exchange_api_deposits_get.c9
-rw-r--r--src/lib/exchange_api_handle.c8
-rw-r--r--src/lib/exchange_api_link.c2
-rw-r--r--src/lib/exchange_api_melt.c4
-rw-r--r--src/lib/exchange_api_recoup.c8
-rw-r--r--src/lib/exchange_api_refreshes_reveal.c8
-rw-r--r--src/lib/exchange_api_refund.c9
-rw-r--r--src/lib/exchange_api_transfers_get.c2
-rw-r--r--src/lib/exchange_api_withdraw.c7
-rw-r--r--src/testing/testing_api_cmd_deposit.c7
-rw-r--r--src/util/crypto_wire.c46
34 files changed, 218 insertions, 190 deletions
diff --git a/src/auditor/taler-auditor-httpd_deposit-confirmation.c b/src/auditor/taler-auditor-httpd_deposit-confirmation.c
index 45be222a..fd48ff93 100644
--- a/src/auditor/taler-auditor-httpd_deposit-confirmation.c
+++ b/src/auditor/taler-auditor-httpd_deposit-confirmation.c
@@ -112,7 +112,7 @@ verify_and_execute_deposit_confirmation (
/* Not in cache, need to verify the signature, persist it, and possibly cache it */
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY,
- &skv.purpose,
+ &skv,
&es->master_sig.eddsa_signature,
&es->master_public_key.eddsa_pub))
{
@@ -165,7 +165,7 @@ verify_and_execute_deposit_confirmation (
&dc->amount_without_fee);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT,
- &dcs.purpose,
+ &dcs,
&dc->exchange_sig.eddsa_signature,
&dc->exchange_pub.eddsa_pub))
{
diff --git a/src/auditor/taler-auditor-sign.c b/src/auditor/taler-auditor-sign.c
index 62f56590..e8491fab 100644
--- a/src/auditor/taler-auditor-sign.c
+++ b/src/auditor/taler-auditor-sign.c
@@ -350,10 +350,9 @@ main (int argc,
kv.denom_hash = dk->denom_hash;
/* Finally sign ... */
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (eddsa_priv,
- &kv.purpose,
- &sigs[i].eddsa_sig));
+ GNUNET_CRYPTO_eddsa_sign (eddsa_priv,
+ &kv,
+ &sigs[i].eddsa_sig);
}
if (NULL == output_file)
diff --git a/src/auditor/taler-helper-auditor-aggregation.c b/src/auditor/taler-helper-auditor-aggregation.c
index 190b7260..09376a79 100644
--- a/src/auditor/taler-helper-auditor-aggregation.c
+++ b/src/auditor/taler-helper-auditor-aggregation.c
@@ -1028,7 +1028,7 @@ get_wire_fee (struct AggregationContext *ac,
&wfi->closing_fee);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_FEES,
- &wf.purpose,
+ &wf,
&master_sig.eddsa_signature,
&TALER_ARL_master_pub.eddsa_pub))
{
diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c
index fb50c8db..8acc874c 100644
--- a/src/auditor/taler-helper-auditor-coins.c
+++ b/src/auditor/taler-helper-auditor-coins.c
@@ -743,7 +743,7 @@ init_denomination (const struct GNUNET_HashCode *denom_hash,
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED,
- &rm.purpose,
+ &rm,
&msig.eddsa_signature,
&TALER_ARL_master_pub.eddsa_pub))
{
@@ -1312,7 +1312,7 @@ refresh_session_cb (void *cls,
amount_with_fee);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_MELT,
- &rmc.purpose,
+ &rmc,
&coin_sig->eddsa_signature,
&coin_pub->eddsa_pub))
{
@@ -1679,7 +1679,7 @@ deposit_cb (void *cls,
auditor performance! */
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT,
- &dr.purpose,
+ &dr,
&coin_sig->eddsa_signature,
&coin_pub->eddsa_pub))
{
@@ -1850,7 +1850,7 @@ refund_cb (void *cls,
amount_with_fee);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND,
- &rr.purpose,
+ &rr,
&merchant_sig->eddsa_sig,
&merchant_pub->eddsa_pub))
{
@@ -2017,7 +2017,7 @@ check_recoup (struct CoinContext *cc,
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_RECOUP,
- &pr.purpose,
+ &pr,
&coin_sig->eddsa_signature,
&coin->coin_pub.eddsa_pub))
{
diff --git a/src/auditor/taler-helper-auditor-reserves.c b/src/auditor/taler-helper-auditor-reserves.c
index 4917ef0a..76713192 100644
--- a/src/auditor/taler-helper-auditor-reserves.c
+++ b/src/auditor/taler-helper-auditor-reserves.c
@@ -559,7 +559,7 @@ handle_reserve_out (void *cls,
amount_with_fee);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW,
- &wsrd.purpose,
+ &wsrd,
&reserve_sig->eddsa_signature,
&reserve_pub->eddsa_pub))
{
@@ -686,7 +686,7 @@ handle_recoup_by_reserve (
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_RECOUP,
- &pr.purpose,
+ &pr,
&coin_sig->eddsa_signature,
&coin->coin_pub.eddsa_pub))
{
@@ -743,7 +743,7 @@ handle_recoup_by_reserve (
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED,
- &kr.purpose,
+ &kr,
&msig.eddsa_signature,
&TALER_ARL_master_pub.eddsa_pub))
{
diff --git a/src/exchange-tools/taler-exchange-keycheck.c b/src/exchange-tools/taler-exchange-keycheck.c
index 6b6ce9eb..917ca879 100644
--- a/src/exchange-tools/taler-exchange-keycheck.c
+++ b/src/exchange-tools/taler-exchange-keycheck.c
@@ -92,7 +92,7 @@ signkeys_iter (void *cls,
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY,
- &ski->issue.purpose,
+ &ski->issue,
&ski->master_sig.eddsa_signature,
&ski->issue.master_public_key.eddsa_pub))
{
@@ -171,7 +171,7 @@ denomkeys_iter (void *cls,
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY,
- &dki->issue.properties.purpose,
+ &dki->issue.properties,
&dki->issue.signature.eddsa_signature,
&dki->issue.properties.master.eddsa_pub))
{
diff --git a/src/exchange-tools/taler-exchange-keyup.c b/src/exchange-tools/taler-exchange-keyup.c
index f4d38975..5472f5e0 100644
--- a/src/exchange-tools/taler-exchange-keyup.c
+++ b/src/exchange-tools/taler-exchange-keyup.c
@@ -497,10 +497,9 @@ create_signkey_issue_priv (
issue->purpose.purpose = htonl (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY);
issue->purpose.size = htonl (sizeof (struct
TALER_ExchangeSigningKeyValidityPS));
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (&master_priv.eddsa_priv,
- &issue->purpose,
- &pi->master_sig.eddsa_signature));
+ GNUNET_CRYPTO_eddsa_sign (&master_priv.eddsa_priv,
+ issue,
+ &pi->master_sig.eddsa_signature);
}
@@ -796,10 +795,9 @@ create_denomkey_issue (
= htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY);
dki->issue.properties.purpose.size
= htonl (sizeof (struct TALER_DenominationKeyValidityPS));
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (&master_priv.eddsa_priv,
- &dki->issue.properties.purpose,
- &dki->issue.signature.eddsa_signature));
+ GNUNET_CRYPTO_eddsa_sign (&master_priv.eddsa_priv,
+ &dki->issue.properties,
+ &dki->issue.signature.eddsa_signature);
}
@@ -948,10 +946,9 @@ sign_af (struct TALER_EXCHANGEDB_AggregateFees *af,
TALER_EXCHANGEDB_fees_2_wf (method,
af,
&wf);
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (priv,
- &wf.purpose,
- &af->master_sig.eddsa_signature));
+ GNUNET_CRYPTO_eddsa_sign (priv,
+ &wf,
+ &af->master_sig.eddsa_signature);
}
diff --git a/src/exchange/taler-exchange-httpd_deposit.c b/src/exchange/taler-exchange-httpd_deposit.c
index 193101c0..ac854de6 100644
--- a/src/exchange/taler-exchange-httpd_deposit.c
+++ b/src/exchange/taler-exchange-httpd_deposit.c
@@ -79,7 +79,7 @@ reply_deposit_success (struct MHD_Connection *connection,
TALER_amount_hton (&dc.amount_without_fee,
amount_without_fee);
if (GNUNET_OK !=
- TEH_KS_sign (&dc.purpose,
+ TEH_KS_sign (&dc,
&pub,
&sig))
{
@@ -508,7 +508,7 @@ TEH_handler_deposit (struct MHD_Connection *connection,
&deposit.deposit_fee);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT,
- &dr.purpose,
+ &dr,
&deposit.csig.eddsa_signature,
&deposit.coin.coin_pub.eddsa_pub))
{
diff --git a/src/exchange/taler-exchange-httpd_deposits_get.c b/src/exchange/taler-exchange-httpd_deposits_get.c
index 1c9c58d1..f2b364ca 100644
--- a/src/exchange/taler-exchange-httpd_deposits_get.c
+++ b/src/exchange/taler-exchange-httpd_deposits_get.c
@@ -69,7 +69,7 @@ reply_deposit_details (struct MHD_Connection *connection,
TALER_amount_hton (&cw.coin_contribution,
coin_contribution);
if (GNUNET_OK !=
- TEH_KS_sign (&cw.purpose,
+ TEH_KS_sign (&cw,
&pub,
&sig))
{
@@ -381,7 +381,7 @@ TEH_handler_deposits_get (const struct TEH_RequestHandler *rh,
return MHD_YES; /* parse error */
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION,
- &tps.purpose,
+ &tps,
&merchant_sig.eddsa_sig,
&tps.merchant.eddsa_pub))
{
diff --git a/src/exchange/taler-exchange-httpd_keystate.c b/src/exchange/taler-exchange-httpd_keystate.c
index 1c56b7a0..acdec8d7 100644
--- a/src/exchange/taler-exchange-httpd_keystate.c
+++ b/src/exchange/taler-exchange-httpd_keystate.c
@@ -593,7 +593,7 @@ store_in_map (struct GNUNET_CONTAINER_MultiHashMap *map,
if (GNUNET_SYSERR ==
GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY,
- &denom_key_issue.purpose,
+ &denom_key_issue,
&dkip->signature.eddsa_signature,
&TEH_master_public_key.eddsa_pub))
{
@@ -1489,12 +1489,10 @@ build_keys_response (const struct ResponseFactoryContext *rfc,
GNUNET_CRYPTO_hash_context_finish (rbc.hash_context,
&ks.hc);
rbc.hash_context = NULL;
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (
- &rfc->key_state->current_sign_key_issue.signkey_priv.
- eddsa_priv,
- &ks.purpose,
- &sig.eddsa_signature));
+ GNUNET_CRYPTO_eddsa_sign (
+ &rfc->key_state->current_sign_key_issue.signkey_priv.eddsa_priv,
+ &ks,
+ &sig.eddsa_signature);
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (TEH_cfg,
"exchangedb",
@@ -2399,16 +2397,20 @@ TEH_KS_free (void)
/**
* Sign the message in @a purpose with the exchange's signing key.
*
+ * The @a purpose data is the beginning of the data of which the signature is
+ * to be created. The `size` field in @a purpose must correctly indicate the
+ * number of bytes of the data structure, including its header. Use
+ * #TEH_KS_sign() instead of calling this function directly!
+ *
* @param purpose the message to sign
* @param[out] pub set to the current public signing key of the exchange
* @param[out] sig signature over purpose using current signing key
* @return #GNUNET_OK on success, #GNUNET_SYSERR if we lack key material
*/
int
-TEH_KS_sign (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
- struct TALER_ExchangePublicKeyP *pub,
- struct TALER_ExchangeSignatureP *sig)
-
+TEH_KS_sign_ (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
+ struct TALER_ExchangePublicKeyP *pub,
+ struct TALER_ExchangeSignatureP *sig)
{
struct TEH_KS_StateHandle *key_state;
@@ -2424,7 +2426,7 @@ TEH_KS_sign (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
}
*pub = key_state->current_sign_key_issue.issue.signkey_pub;
GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (
+ GNUNET_CRYPTO_eddsa_sign_ (
&key_state->current_sign_key_issue.signkey_priv.eddsa_priv,
purpose,
&sig->eddsa_signature));
diff --git a/src/exchange/taler-exchange-httpd_keystate.h b/src/exchange/taler-exchange-httpd_keystate.h
index 67165238..65a006bb 100644
--- a/src/exchange/taler-exchange-httpd_keystate.h
+++ b/src/exchange/taler-exchange-httpd_keystate.h
@@ -171,15 +171,45 @@ TEH_KS_loop (void);
* Sign the message in @a purpose with the exchange's signing
* key.
*
+ * The @a purpose data is the beginning of the data of which the signature is
+ * to be created. The `size` field in @a purpose must correctly indicate the
+ * number of bytes of the data structure, including its header. Use
+ * #TEH_KS_sign() instead of calling this function directly!
+ *
* @param purpose the message to sign
* @param[out] pub set to the current public signing key of the exchange
* @param[out] sig signature over purpose using current signing key
* @return #GNUNET_OK on success, #GNUNET_SYSERR if we lack key material
*/
int
-TEH_KS_sign (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
- struct TALER_ExchangePublicKeyP *pub,
- struct TALER_ExchangeSignatureP *sig);
+TEH_KS_sign_ (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
+ struct TALER_ExchangePublicKeyP *pub,
+ struct TALER_ExchangeSignatureP *sig);
+
+/**
+ * @ingroup crypto
+ * @brief EdDSA sign a given block.
+ *
+ * The @a ps data must be a fixed-size struct for which the signature is to be
+ * created. The `size` field in @a ps->purpose must correctly indicate the
+ * number of bytes of the data structure, including its header.
+ *
+ * @param ps packed struct with what to sign, MUST begin with a purpose
+ * @param[out] pub where to store the public key to use for the signing
+ * @param[out] sig where to write the signature
+ */
+#define TEH_KS_sign(ps,pub,sig) \
+ ({ \
+ /* check size is set correctly */ \
+ GNUNET_assert (htonl ((ps)->purpose.size) == \
+ sizeof (*ps)); \
+ /* check 'ps' begins with the purpose */ \
+ GNUNET_static_assert (((void*) (ps)) == \
+ ((void*) &(ps)->purpose)); \
+ TEH_KS_sign_ (&(ps)->purpose, \
+ pub, \
+ sig); \
+ })
/**
diff --git a/src/exchange/taler-exchange-httpd_melt.c b/src/exchange/taler-exchange-httpd_melt.c
index f5bd0b5a..fab0f106 100644
--- a/src/exchange/taler-exchange-httpd_melt.c
+++ b/src/exchange/taler-exchange-httpd_melt.c
@@ -109,7 +109,7 @@ reply_melt_success (struct MHD_Connection *connection,
};
if (GNUNET_OK !=
- TEH_KS_sign (&body.purpose,
+ TEH_KS_sign (&body,
&pub,
&sig))
{
@@ -376,22 +376,22 @@ handle_melt (struct MHD_Connection *connection,
{
/* verify signature of coin for melt operation */
{
- struct TALER_RefreshMeltCoinAffirmationPS body;
+ struct TALER_RefreshMeltCoinAffirmationPS body = {
+ .purpose.size = htonl (sizeof (body)),
+ .purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_MELT),
+ .rc = rmc->refresh_session.rc,
+ .coin_pub = rmc->refresh_session.coin.coin_pub
+ };
- body.purpose.size = htonl (sizeof (struct
- TALER_RefreshMeltCoinAffirmationPS));
- body.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_MELT);
- body.rc = rmc->refresh_session.rc;
TALER_amount_hton (&body.amount_with_fee,
&rmc->refresh_session.amount_with_fee);
TALER_amount_hton (&body.melt_fee,
&rmc->coin_refresh_fee);
- body.coin_pub = rmc->refresh_session.coin.coin_pub;
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_WALLET_COIN_MELT,
- &body.purpose,
+ &body,
&rmc->refresh_session.coin_sig.eddsa_signature,
&rmc->refresh_session.coin.coin_pub.eddsa_pub))
{
diff --git a/src/exchange/taler-exchange-httpd_recoup.c b/src/exchange/taler-exchange-httpd_recoup.c
index d8e7d189..ccb75622 100644
--- a/src/exchange/taler-exchange-httpd_recoup.c
+++ b/src/exchange/taler-exchange-httpd_recoup.c
@@ -414,7 +414,7 @@ verify_and_execute_recoup (struct MHD_Connection *connection,
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_RECOUP,
- &pr.purpose,
+ &pr,
&coin_sig->eddsa_signature,
&coin->coin_pub.eddsa_pub))
{
diff --git a/src/exchange/taler-exchange-httpd_refreshes_reveal.c b/src/exchange/taler-exchange-httpd_refreshes_reveal.c
index b7db0a4b..5b6ca2d3 100644
--- a/src/exchange/taler-exchange-httpd_refreshes_reveal.c
+++ b/src/exchange/taler-exchange-httpd_refreshes_reveal.c
@@ -676,11 +676,11 @@ resolve_refreshes_reveal_denominations (struct TEH_KS_StateHandle *key_state,
rcds[i].coin_ev_size,
&ldp.coin_envelope_hash);
if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_LINK,
- &ldp.purpose,
- &link_sigs[i].eddsa_signature,
- &melt.session.coin.coin_pub.
- eddsa_pub))
+ GNUNET_CRYPTO_eddsa_verify (
+ TALER_SIGNATURE_WALLET_COIN_LINK,
+ &ldp,
+ &link_sigs[i].eddsa_signature,
+ &melt.session.coin.coin_pub.eddsa_pub))
{
GNUNET_break_op (0);
res = TALER_MHD_reply_with_error (connection,
diff --git a/src/exchange/taler-exchange-httpd_refund.c b/src/exchange/taler-exchange-httpd_refund.c
index 9fd9575f..036a0473 100644
--- a/src/exchange/taler-exchange-httpd_refund.c
+++ b/src/exchange/taler-exchange-httpd_refund.c
@@ -64,7 +64,7 @@ reply_refund_success (struct MHD_Connection *connection,
TALER_amount_hton (&rc.refund_fee,
&refund->refund_fee);
if (GNUNET_OK !=
- TEH_KS_sign (&rc.purpose,
+ TEH_KS_sign (&rc,
&pub,
&sig))
{
@@ -365,7 +365,7 @@ verify_and_execute_refund (struct MHD_Connection *connection,
&refund->details.refund_fee);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND,
- &rr.purpose,
+ &rr,
&refund->details.merchant_sig.eddsa_sig,
&refund->details.merchant_pub.eddsa_pub))
{
diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c
index 45284119..4ddd9cd8 100644
--- a/src/exchange/taler-exchange-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -81,7 +81,7 @@ TEH_RESPONSE_compile_transaction_history (
/* internal sanity check before we hand out a bogus sig... */
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT,
- &dr.purpose,
+ &dr,
&deposit->csig.eddsa_signature,
&coin_pub->eddsa_pub))
{
@@ -139,7 +139,7 @@ TEH_RESPONSE_compile_transaction_history (
/* internal sanity check before we hand out a bogus sig... */
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_MELT,
- &ms.purpose,
+ &ms,
&melt->coin_sig.eddsa_signature,
&coin_pub->eddsa_pub))
{
@@ -191,7 +191,7 @@ TEH_RESPONSE_compile_transaction_history (
/* internal sanity check before we hand out a bogus sig... */
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND,
- &rr.purpose,
+ &rr,
&refund->merchant_sig.eddsa_sig,
&refund->merchant_pub.eddsa_pub))
{
@@ -253,7 +253,7 @@ TEH_RESPONSE_compile_transaction_history (
TALER_amount_hton (&pc.recoup_amount,
&pr->value);
if (GNUNET_OK !=
- TEH_KS_sign (&pc.purpose,
+ TEH_KS_sign (&pc,
&epub,
&esig))
{
@@ -306,7 +306,7 @@ TEH_RESPONSE_compile_transaction_history (
TALER_amount_hton (&pc.recoup_amount,
&recoup->value);
if (GNUNET_OK !=
- TEH_KS_sign (&pc.purpose,
+ TEH_KS_sign (&pc,
&epub,
&esig))
{
@@ -355,7 +355,7 @@ TEH_RESPONSE_compile_transaction_history (
TALER_amount_hton (&pc.recoup_amount,
&pr->value);
if (GNUNET_OK !=
- TEH_KS_sign (&pc.purpose,
+ TEH_KS_sign (&pc,
&epub,
&esig))
{
@@ -593,7 +593,7 @@ TEH_RESPONSE_compile_reserve_history (
TALER_amount_hton (&pc.recoup_amount,
&recoup->value);
if (GNUNET_OK !=
- TEH_KS_sign (&pc.purpose,
+ TEH_KS_sign (&pc,
&pub,
&sig))
{
@@ -669,7 +669,7 @@ TEH_RESPONSE_compile_reserve_history (
strlen (closing->receiver_account_details) + 1,
&rcc.h_wire);
if (GNUNET_OK !=
- TEH_KS_sign (&rcc.purpose,
+ TEH_KS_sign (&rcc,
&pub,
&sig))
{
diff --git a/src/exchange/taler-exchange-httpd_transfers_get.c b/src/exchange/taler-exchange-httpd_transfers_get.c
index 9407ad79..4cc855d7 100644
--- a/src/exchange/taler-exchange-httpd_transfers_get.c
+++ b/src/exchange/taler-exchange-httpd_transfers_get.c
@@ -159,7 +159,7 @@ reply_transfer_details (struct MHD_Connection *connection,
GNUNET_CRYPTO_hash_context_finish (hash_context,
&wdp.h_details);
if (GNUNET_OK !=
- TEH_KS_sign (&wdp.purpose,
+ TEH_KS_sign (&wdp,
&pub,
&sig))
{
diff --git a/src/exchange/taler-exchange-httpd_withdraw.c b/src/exchange/taler-exchange-httpd_withdraw.c
index bbd926a5..58ef97ba 100644
--- a/src/exchange/taler-exchange-httpd_withdraw.c
+++ b/src/exchange/taler-exchange-httpd_withdraw.c
@@ -442,7 +442,7 @@ TEH_handler_withdraw (const struct TEH_RequestHandler *rh,
/* verify signature! */
wc.wsrd.purpose.size
- = htonl (sizeof (struct TALER_WithdrawRequestPS));
+ = htonl (sizeof (wc.wsrd));
wc.wsrd.purpose.purpose
= htonl (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW);
wc.wsrd.h_denomination_pub
@@ -452,7 +452,7 @@ TEH_handler_withdraw (const struct TEH_RequestHandler *rh,
&wc.wsrd.h_coin_envelope);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW,
- &wc.wsrd.purpose,
+ &wc.wsrd,
&wc.signature.eddsa_signature,
&wc.wsrd.reserve_pub.eddsa_pub))
{
diff --git a/src/exchangedb/exchangedb_denomkeys.c b/src/exchangedb/exchangedb_denomkeys.c
index fe74d156..ec77d7f0 100644
--- a/src/exchangedb/exchangedb_denomkeys.c
+++ b/src/exchangedb/exchangedb_denomkeys.c
@@ -75,10 +75,9 @@ TALER_EXCHANGEDB_denomination_key_revoke (
.h_denom_pub = *denom_hash
};
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (&mpriv->eddsa_priv,
- &rm.purpose,
- &rd.msig.eddsa_signature));
+ GNUNET_CRYPTO_eddsa_sign (&mpriv->eddsa_priv,
+ &rm,
+ &rd.msig.eddsa_signature);
}
GNUNET_asprintf (&fn,
"%s" DIR_SEPARATOR_STR
@@ -476,7 +475,7 @@ revocations_iterate_cb (void *cls,
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED,
- &rm.purpose,
+ &rm,
&rf.msig.eddsa_signature,
&ric->master_pub->eddsa_pub))
{
diff --git a/src/exchangedb/test_exchangedb_fees.c b/src/exchangedb/test_exchangedb_fees.c
index 7cd890eb..55f34bd6 100644
--- a/src/exchangedb/test_exchangedb_fees.c
+++ b/src/exchangedb/test_exchangedb_fees.c
@@ -39,10 +39,9 @@ sign_af (struct TALER_EXCHANGEDB_AggregateFees *af,
TALER_EXCHANGEDB_fees_2_wf ("test",
af,
&wf);
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (priv,
- &wf.purpose,
- &af->master_sig.eddsa_signature));
+ GNUNET_CRYPTO_eddsa_sign (priv,
+ &wf,
+ &af->master_sig.eddsa_signature);
}
@@ -136,7 +135,7 @@ main (int argc,
&wf);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_FEES,
- &wf.purpose,
+ &wf,
&p->master_sig.eddsa_signature,
&master_pub.eddsa_pub))
{
diff --git a/src/lib/auditor_api_deposit_confirmation.c b/src/lib/auditor_api_deposit_confirmation.c
index 04510208..cddfe8b1 100644
--- a/src/lib/auditor_api_deposit_confirmation.c
+++ b/src/lib/auditor_api_deposit_confirmation.c
@@ -178,49 +178,57 @@ verify_signatures (const struct GNUNET_HashCode *h_wire,
struct GNUNET_TIME_Absolute ep_end,
const struct TALER_MasterSignatureP *master_sig)
{
- struct TALER_DepositConfirmationPS dc;
- struct TALER_ExchangeSigningKeyValidityPS sv;
-
- dc.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT);
- dc.purpose.size = htonl (sizeof (struct TALER_DepositConfirmationPS));
- dc.h_contract_terms = *h_contract_terms;
- dc.h_wire = *h_wire;
- dc.timestamp = GNUNET_TIME_absolute_hton (timestamp);
- dc.refund_deadline = GNUNET_TIME_absolute_hton (refund_deadline);
- TALER_amount_hton (&dc.amount_without_fee,
- amount_without_fee);
- dc.coin_pub = *coin_pub;
- dc.merchant = *merchant_pub;
- if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT,
- &dc.purpose,
- &exchange_sig->eddsa_signature,
- &exchange_pub->eddsa_pub))
{
- GNUNET_break_op (0);
- TALER_LOG_WARNING ("Invalid signature on /deposit-confirmation request!\n");
+ struct TALER_DepositConfirmationPS dc = {
+ .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT),
+ .purpose.size = htonl (sizeof (dc)),
+ .h_contract_terms = *h_contract_terms,
+ .h_wire = *h_wire,
+ .timestamp = GNUNET_TIME_absolute_hton (timestamp),
+ .refund_deadline = GNUNET_TIME_absolute_hton (refund_deadline),
+ .coin_pub = *coin_pub,
+ .merchant = *merchant_pub
+ };
+
+ TALER_amount_hton (&dc.amount_without_fee,
+ amount_without_fee);
+ if (GNUNET_OK !=
+ GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT,
+ &dc,
+ &exchange_sig->eddsa_signature,
+ &exchange_pub->eddsa_pub))
{
- TALER_LOG_DEBUG ("... amount_without_fee was %s\n",
- TALER_amount2s (amount_without_fee));
+ GNUNET_break_op (0);
+ TALER_LOG_WARNING (
+ "Invalid signature on /deposit-confirmation request!\n");
+ {
+ TALER_LOG_DEBUG ("... amount_without_fee was %s\n",
+ TALER_amount2s (amount_without_fee));
+ }
+ return GNUNET_SYSERR;
}
- return GNUNET_SYSERR;
}
- sv.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY);
- sv.purpose.size = htonl (sizeof (struct TALER_ExchangeSigningKeyValidityPS));
- sv.master_public_key = *master_pub;
- sv.start = GNUNET_TIME_absolute_hton (ep_start);
- sv.expire = GNUNET_TIME_absolute_hton (ep_expire);
- sv.end = GNUNET_TIME_absolute_hton (ep_end);
- sv.signkey_pub = *exchange_pub;
- if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY,
- &sv.purpose,
- &master_sig->eddsa_signature,
- &master_pub->eddsa_pub))
{
- GNUNET_break (0);
- TALER_LOG_WARNING ("Invalid signature on exchange signing key!\n");
- return GNUNET_SYSERR;
+ struct TALER_ExchangeSigningKeyValidityPS sv = {
+ .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY),
+ .purpose.size = htonl (sizeof (sv)),
+ .master_public_key = *master_pub,
+ .start = GNUNET_TIME_absolute_hton (ep_start),
+ .expire = GNUNET_TIME_absolute_hton (ep_expire),
+ .end = GNUNET_TIME_absolute_hton (ep_end),
+ .signkey_pub = *exchange_pub
+ };
+
+ if (GNUNET_OK !=
+ GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY,
+ &sv,
+ &master_sig->eddsa_signature,
+ &master_pub->eddsa_pub))
+ {
+ GNUNET_break (0);
+ TALER_LOG_WARNING ("Invalid signature on exchange signing key!\n");
+ return GNUNET_SYSERR;
+ }
}
if (0 == GNUNET_TIME_absolute_get_remaining (ep_end).rel_value_us)
{
diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c
index af77d29e..d441807a 100644
--- a/src/lib/exchange_api_common.c
+++ b/src/lib/exchange_api_common.c
@@ -177,7 +177,7 @@ TALER_EXCHANGE_parse_reserve_history (
/* Check that the signature is a valid withdraw request */
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW,
- &withdraw_purpose.purpose,
+ &withdraw_purpose,
&sig.eddsa_signature,
&reserve_pub->eddsa_pub))
{
@@ -294,7 +294,7 @@ TALER_EXCHANGE_parse_reserve_history (
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP,
- &pc.purpose,
+ &pc,
&rh->details.recoup_details.exchange_sig.eddsa_signature,
&rh->details.recoup_details.exchange_pub.eddsa_pub))
{
@@ -371,7 +371,7 @@ TALER_EXCHANGE_parse_reserve_history (
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED,
- &rcc.purpose,
+ &rcc,
&rh->details.close_details.exchange_sig.eddsa_signature,
&rh->details.close_details.exchange_pub.eddsa_pub))
{
@@ -551,7 +551,7 @@ TALER_EXCHANGE_verify_coin_history (
dr.coin_pub = *coin_pub;
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT,
- &dr.purpose,
+ &dr,
&sig.eddsa_signature,
&coin_pub->eddsa_pub))
{
@@ -606,7 +606,7 @@ TALER_EXCHANGE_verify_coin_history (
rm.coin_pub = *coin_pub;
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_MELT,
- &rm.purpose,
+ &rm,
&sig.eddsa_signature,
&coin_pub->eddsa_pub))
{
@@ -665,7 +665,7 @@ TALER_EXCHANGE_verify_coin_history (
&amount);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND,
- &rr.purpose,
+ &rr,
&sig.eddsa_sig,
&rr.merchant.eddsa_pub))
{
@@ -731,7 +731,7 @@ TALER_EXCHANGE_verify_coin_history (
&amount);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP,
- &pc.purpose,
+ &pc,
&exchange_sig.eddsa_signature,
&exchange_pub.eddsa_pub))
{
diff --git a/src/lib/exchange_api_deposit.c b/src/lib/exchange_api_deposit.c
index e01a3c58..38f15246 100644
--- a/src/lib/exchange_api_deposit.c
+++ b/src/lib/exchange_api_deposit.c
@@ -219,7 +219,7 @@ verify_deposit_signature_ok (struct TALER_EXCHANGE_DepositHandle *dh,
}
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT,
- &dh->depconf.purpose,
+ &dh->depconf,
&exchange_sig->eddsa_signature,
&exchange_pub->eddsa_pub))
{
@@ -441,7 +441,7 @@ verify_signatures (const struct TALER_EXCHANGE_DenomPublicKey *dki,
&dki->fee_deposit);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT,
- &dr.purpose,
+ &dr,
&coin_sig->eddsa_signature,
&coin_pub->eddsa_pub))
{
diff --git a/src/lib/exchange_api_deposits_get.c b/src/lib/exchange_api_deposits_get.c
index 053f3ac8..aecd8824 100644
--- a/src/lib/exchange_api_deposits_get.c
+++ b/src/lib/exchange_api_deposits_get.c
@@ -119,7 +119,7 @@ verify_deposit_wtid_signature_ok (
}
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE,
- &dwh->depconf.purpose,
+ &dwh->depconf,
&exchange_sig.eddsa_signature,
&exchange_pub->eddsa_pub))
{
@@ -315,10 +315,9 @@ TALER_EXCHANGE_deposits_get (
&dtp.merchant.eddsa_pub);
dtp.coin_pub = *coin_pub;
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (&merchant_priv->eddsa_priv,
- &dtp.purpose,
- &merchant_sig.eddsa_sig));
+ GNUNET_CRYPTO_eddsa_sign (&merchant_priv->eddsa_priv,
+ &dtp,
+ &merchant_sig.eddsa_sig);
{
char cpub_str[sizeof (struct TALER_CoinSpendPublicKeyP) * 2];
char mpub_str[sizeof (struct TALER_MerchantPublicKeyP) * 2];
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index ed12f6af..86edc070 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -407,7 +407,7 @@ parse_json_signkey (struct TALER_EXCHANGE_SigningPublicKey *sign_key,
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY,
- &sign_key_issue.purpose,
+ &sign_key_issue,
&sign_key_issue_sig.eddsa_signature,
&master_key->eddsa_pub))
{
@@ -508,7 +508,7 @@ parse_json_denomkey (struct TALER_EXCHANGE_DenomPublicKey *denom_key,
EXITIF (GNUNET_SYSERR ==
GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY,
- &denom_key_issue.purpose,
+ &denom_key_issue,
&denom_key->master_sig.eddsa_signature,
&master_key->eddsa_pub));
}
@@ -635,7 +635,7 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS,
- &kv.purpose,
+ &kv,
&auditor_sig.eddsa_sig,
&auditor->auditor_pub.eddsa_pub))
{
@@ -1096,7 +1096,7 @@ decode_keys_json (const json_t *resp_obj,
&pub));
EXITIF (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_KEY_SET,
- &ks.purpose,
+ &ks,
&sig.eddsa_signature,
&pub.eddsa_pub));
}
diff --git a/src/lib/exchange_api_link.c b/src/lib/exchange_api_link.c
index c05b2e56..f933edd9 100644
--- a/src/lib/exchange_api_link.c
+++ b/src/lib/exchange_api_link.c
@@ -154,7 +154,7 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh,
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_LINK,
- &ldp.purpose,
+ &ldp,
&link_sig.eddsa_signature,
&ldp.old_coin_pub.eddsa_pub))
{
diff --git a/src/lib/exchange_api_melt.c b/src/lib/exchange_api_melt.c
index 4d0d21b3..0217757b 100644
--- a/src/lib/exchange_api_melt.c
+++ b/src/lib/exchange_api_melt.c
@@ -142,7 +142,7 @@ verify_melt_signature_ok (struct TALER_EXCHANGE_MeltHandle *mh,
confirm.noreveal_index = htonl (*noreveal_index);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT,
- &confirm.purpose,
+ &confirm,
&exchange_sig.eddsa_signature,
&exchange_pub->eddsa_pub))
{
@@ -416,7 +416,7 @@ TALER_EXCHANGE_melt (struct TALER_EXCHANGE_Handle *exchange,
GNUNET_CRYPTO_eddsa_key_get_public (&md->melted_coin.coin_priv.eddsa_priv,
&melt.coin_pub.eddsa_pub);
GNUNET_CRYPTO_eddsa_sign (&md->melted_coin.coin_priv.eddsa_priv,
- &melt.purpose,
+ &melt,
&confirm_sig.eddsa_signature);
GNUNET_CRYPTO_rsa_public_key_hash (md->melted_coin.pub_key.rsa_public_key,
&h_denom_pub);
diff --git a/src/lib/exchange_api_recoup.c b/src/lib/exchange_api_recoup.c
index 484d2753..723b4178 100644
--- a/src/lib/exchange_api_recoup.c
+++ b/src/lib/exchange_api_recoup.c
@@ -303,11 +303,9 @@ TALER_EXCHANGE_recoup (struct TALER_EXCHANGE_Handle *exchange,
&h_denom_pub);
pr.h_denom_pub = pk->h_key;
pr.coin_blind = ps->blinding_key;
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (&ps->coin_priv.eddsa_priv,
- &pr.purpose,
- &coin_sig.eddsa_signature));
-
+ GNUNET_CRYPTO_eddsa_sign (&ps->coin_priv.eddsa_priv,
+ &pr,
+ &coin_sig.eddsa_signature);
recoup_obj = json_pack ("{s:o, s:o," /* denom pub/sig */
" s:o," /* sig */
" s:o, s:o}", /* coin_bks */
diff --git a/src/lib/exchange_api_refreshes_reveal.c b/src/lib/exchange_api_refreshes_reveal.c
index f8071f5c..4ef2e3d0 100644
--- a/src/lib/exchange_api_refreshes_reveal.c
+++ b/src/lib/exchange_api_refreshes_reveal.c
@@ -399,11 +399,9 @@ TALER_EXCHANGE_refreshes_reveal (
GNUNET_CRYPTO_hash (pd.coin_ev,
pd.coin_ev_size,
&ldp.coin_envelope_hash);
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (
- &md->melted_coin.coin_priv.eddsa_priv,
- &ldp.purpose,
- &link_sig.eddsa_signature));
+ GNUNET_CRYPTO_eddsa_sign (&md->melted_coin.coin_priv.eddsa_priv,
+ &ldp,
+ &link_sig.eddsa_signature);
GNUNET_assert (0 ==
json_array_append_new (link_sigs,
GNUNET_JSON_from_data_auto (
diff --git a/src/lib/exchange_api_refund.c b/src/lib/exchange_api_refund.c
index 81127c5a..7ece7eb1 100644
--- a/src/lib/exchange_api_refund.c
+++ b/src/lib/exchange_api_refund.c
@@ -117,7 +117,7 @@ verify_refund_signature_ok (const struct TALER_EXCHANGE_RefundHandle *rh,
}
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND,
- &rh->depconf.purpose,
+ &rh->depconf,
&exchange_sig.eddsa_signature,
&exchange_pub->eddsa_pub))
{
@@ -289,10 +289,9 @@ TALER_EXCHANGE_refund (struct TALER_EXCHANGE_Handle *exchange,
amount);
TALER_amount_hton (&rr.refund_fee,
refund_fee);
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (&merchant_priv->eddsa_priv,
- &rr.purpose,
- &merchant_sig.eddsa_sig));
+ GNUNET_CRYPTO_eddsa_sign (&merchant_priv->eddsa_priv,
+ &rr,
+ &merchant_sig.eddsa_sig);
return TALER_EXCHANGE_refund2 (exchange,
amount,
refund_fee,
diff --git a/src/lib/exchange_api_transfers_get.c b/src/lib/exchange_api_transfers_get.c
index 2f1e3289..aa4abfa5 100644
--- a/src/lib/exchange_api_transfers_get.c
+++ b/src/lib/exchange_api_transfers_get.c
@@ -207,7 +207,7 @@ check_transfers_get_response_ok (
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT,
- &wdp.purpose,
+ &wdp,
&exchange_sig.eddsa_signature,
&exchange_pub.eddsa_pub))
{
diff --git a/src/lib/exchange_api_withdraw.c b/src/lib/exchange_api_withdraw.c
index 6f7928c6..c72454e2 100644
--- a/src/lib/exchange_api_withdraw.c
+++ b/src/lib/exchange_api_withdraw.c
@@ -540,10 +540,9 @@ TALER_EXCHANGE_withdraw (
GNUNET_CRYPTO_hash (pd.coin_ev,
pd.coin_ev_size,
&req.h_coin_envelope);
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (&reserve_priv->eddsa_priv,
- &req.purpose,
- &reserve_sig.eddsa_signature));
+ GNUNET_CRYPTO_eddsa_sign (&reserve_priv->eddsa_priv,
+ &req,
+ &reserve_sig.eddsa_signature);
wh = reserve_withdraw_internal (exchange,
pk,
&reserve_sig,
diff --git a/src/testing/testing_api_cmd_deposit.c b/src/testing/testing_api_cmd_deposit.c
index c11c49ac..c251aada 100644
--- a/src/testing/testing_api_cmd_deposit.c
+++ b/src/testing/testing_api_cmd_deposit.c
@@ -409,10 +409,9 @@ deposit_run (void *cls,
&denom_pub->fee_deposit);
dr.merchant = merchant_pub;
dr.coin_pub = coin_pub;
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (&coin_priv->eddsa_priv,
- &dr.purpose,
- &coin_sig.eddsa_signature));
+ GNUNET_CRYPTO_eddsa_sign (&coin_priv->eddsa_priv,
+ &dr,
+ &coin_sig.eddsa_signature);
}
ds->dh = TALER_EXCHANGE_deposit (is->exchange,
&ds->amount,
diff --git a/src/util/crypto_wire.c b/src/util/crypto_wire.c
index 6fdf6551..7aaf7d15 100644
--- a/src/util/crypto_wire.c
+++ b/src/util/crypto_wire.c
@@ -59,14 +59,15 @@ TALER_exchange_wire_signature_check (
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_MasterSignatureP *master_sig)
{
- struct TALER_MasterWireDetailsPS wd;
+ struct TALER_MasterWireDetailsPS wd = {
+ .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_DETAILS),
+ .purpose.size = htonl (sizeof (wd))
+ };
- wd.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_DETAILS);
- wd.purpose.size = htonl (sizeof (wd));
TALER_exchange_wire_signature_hash (payto_uri,
&wd.h_wire_details);
return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_DETAILS,
- &wd.purpose,
+ &wd,
&master_sig->eddsa_signature,
&master_pub->eddsa_pub);
}
@@ -85,16 +86,16 @@ TALER_exchange_wire_signature_make (
const struct TALER_MasterPrivateKeyP *master_priv,
struct TALER_MasterSignatureP *master_sig)
{
- struct TALER_MasterWireDetailsPS wd;
+ struct TALER_MasterWireDetailsPS wd = {
+ .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_DETAILS),
+ .purpose.size = htonl (sizeof (wd))
+ };
- wd.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_DETAILS);
- wd.purpose.size = htonl (sizeof (wd));
TALER_exchange_wire_signature_hash (payto_uri,
&wd.h_wire_details);
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
- &wd.purpose,
- &master_sig->eddsa_signature));
+ GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
+ &wd,
+ &master_sig->eddsa_signature);
}
@@ -149,15 +150,16 @@ TALER_merchant_wire_signature_check (
const struct TALER_MerchantPublicKeyP *merch_pub,
const struct TALER_MerchantSignatureP *merch_sig)
{
- struct TALER_MasterWireDetailsPS wd;
+ struct TALER_MasterWireDetailsPS wd = {
+ .purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS),
+ .purpose.size = htonl (sizeof (wd))
+ };
- wd.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS);
- wd.purpose.size = htonl (sizeof (wd));
TALER_merchant_wire_signature_hash (payto_uri,
salt,
&wd.h_wire_details);
return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS,
- &wd.purpose,
+ &wd,
&merch_sig->eddsa_sig,
&merch_pub->eddsa_pub);
}
@@ -178,17 +180,17 @@ TALER_merchant_wire_signature_make (
const struct TALER_MerchantPrivateKeyP *merch_priv,
struct TALER_MerchantSignatureP *merch_sig)
{
- struct TALER_MasterWireDetailsPS wd;
+ struct TALER_MasterWireDetailsPS wd = {
+ .purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS),
+ .purpose.size = htonl (sizeof (wd))
+ };
- wd.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS);
- wd.purpose.size = htonl (sizeof (wd));
TALER_merchant_wire_signature_hash (payto_uri,
salt,
&wd.h_wire_details);
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (&merch_priv->eddsa_priv,
- &wd.purpose,
- &merch_sig->eddsa_sig));
+ GNUNET_CRYPTO_eddsa_sign (&merch_priv->eddsa_priv,
+ &wd,
+ &merch_sig->eddsa_sig);
}