adapt to new GNUnet sign API (#6164)

This commit is contained in:
Christian Grothoff 2020-04-08 18:18:20 +02:00
parent b22ec7570e
commit 50bc862a68
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
34 changed files with 218 additions and 190 deletions

View File

@ -112,7 +112,7 @@ verify_and_execute_deposit_confirmation (
/* Not in cache, need to verify the signature, persist it, and possibly cache it */ /* Not in cache, need to verify the signature, persist it, and possibly cache it */
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY,
&skv.purpose, &skv,
&es->master_sig.eddsa_signature, &es->master_sig.eddsa_signature,
&es->master_public_key.eddsa_pub)) &es->master_public_key.eddsa_pub))
{ {
@ -165,7 +165,7 @@ verify_and_execute_deposit_confirmation (
&dc->amount_without_fee); &dc->amount_without_fee);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT,
&dcs.purpose, &dcs,
&dc->exchange_sig.eddsa_signature, &dc->exchange_sig.eddsa_signature,
&dc->exchange_pub.eddsa_pub)) &dc->exchange_pub.eddsa_pub))
{ {

View File

@ -350,10 +350,9 @@ main (int argc,
kv.denom_hash = dk->denom_hash; kv.denom_hash = dk->denom_hash;
/* Finally sign ... */ /* Finally sign ... */
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (eddsa_priv, GNUNET_CRYPTO_eddsa_sign (eddsa_priv,
&kv.purpose, &kv,
&sigs[i].eddsa_sig)); &sigs[i].eddsa_sig);
} }
if (NULL == output_file) if (NULL == output_file)

View File

@ -1028,7 +1028,7 @@ get_wire_fee (struct AggregationContext *ac,
&wfi->closing_fee); &wfi->closing_fee);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_FEES, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_FEES,
&wf.purpose, &wf,
&master_sig.eddsa_signature, &master_sig.eddsa_signature,
&TALER_ARL_master_pub.eddsa_pub)) &TALER_ARL_master_pub.eddsa_pub))
{ {

View File

@ -743,7 +743,7 @@ init_denomination (const struct GNUNET_HashCode *denom_hash,
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify ( GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED, TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED,
&rm.purpose, &rm,
&msig.eddsa_signature, &msig.eddsa_signature,
&TALER_ARL_master_pub.eddsa_pub)) &TALER_ARL_master_pub.eddsa_pub))
{ {
@ -1312,7 +1312,7 @@ refresh_session_cb (void *cls,
amount_with_fee); amount_with_fee);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_MELT, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_MELT,
&rmc.purpose, &rmc,
&coin_sig->eddsa_signature, &coin_sig->eddsa_signature,
&coin_pub->eddsa_pub)) &coin_pub->eddsa_pub))
{ {
@ -1679,7 +1679,7 @@ deposit_cb (void *cls,
auditor performance! */ auditor performance! */
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT,
&dr.purpose, &dr,
&coin_sig->eddsa_signature, &coin_sig->eddsa_signature,
&coin_pub->eddsa_pub)) &coin_pub->eddsa_pub))
{ {
@ -1850,7 +1850,7 @@ refund_cb (void *cls,
amount_with_fee); amount_with_fee);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND,
&rr.purpose, &rr,
&merchant_sig->eddsa_sig, &merchant_sig->eddsa_sig,
&merchant_pub->eddsa_pub)) &merchant_pub->eddsa_pub))
{ {
@ -2017,7 +2017,7 @@ check_recoup (struct CoinContext *cc,
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_RECOUP, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_RECOUP,
&pr.purpose, &pr,
&coin_sig->eddsa_signature, &coin_sig->eddsa_signature,
&coin->coin_pub.eddsa_pub)) &coin->coin_pub.eddsa_pub))
{ {

View File

@ -559,7 +559,7 @@ handle_reserve_out (void *cls,
amount_with_fee); amount_with_fee);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW,
&wsrd.purpose, &wsrd,
&reserve_sig->eddsa_signature, &reserve_sig->eddsa_signature,
&reserve_pub->eddsa_pub)) &reserve_pub->eddsa_pub))
{ {
@ -686,7 +686,7 @@ handle_recoup_by_reserve (
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_RECOUP, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_RECOUP,
&pr.purpose, &pr,
&coin_sig->eddsa_signature, &coin_sig->eddsa_signature,
&coin->coin_pub.eddsa_pub)) &coin->coin_pub.eddsa_pub))
{ {
@ -743,7 +743,7 @@ handle_recoup_by_reserve (
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify ( GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED, TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED,
&kr.purpose, &kr,
&msig.eddsa_signature, &msig.eddsa_signature,
&TALER_ARL_master_pub.eddsa_pub)) &TALER_ARL_master_pub.eddsa_pub))
{ {

View File

@ -92,7 +92,7 @@ signkeys_iter (void *cls,
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY,
&ski->issue.purpose, &ski->issue,
&ski->master_sig.eddsa_signature, &ski->master_sig.eddsa_signature,
&ski->issue.master_public_key.eddsa_pub)) &ski->issue.master_public_key.eddsa_pub))
{ {
@ -171,7 +171,7 @@ denomkeys_iter (void *cls,
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify ( GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY, TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY,
&dki->issue.properties.purpose, &dki->issue.properties,
&dki->issue.signature.eddsa_signature, &dki->issue.signature.eddsa_signature,
&dki->issue.properties.master.eddsa_pub)) &dki->issue.properties.master.eddsa_pub))
{ {

View File

@ -497,10 +497,9 @@ create_signkey_issue_priv (
issue->purpose.purpose = htonl (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY); issue->purpose.purpose = htonl (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY);
issue->purpose.size = htonl (sizeof (struct issue->purpose.size = htonl (sizeof (struct
TALER_ExchangeSigningKeyValidityPS)); TALER_ExchangeSigningKeyValidityPS));
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (&master_priv.eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&master_priv.eddsa_priv,
&issue->purpose, issue,
&pi->master_sig.eddsa_signature)); &pi->master_sig.eddsa_signature);
} }
@ -796,10 +795,9 @@ create_denomkey_issue (
= htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY); = htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY);
dki->issue.properties.purpose.size dki->issue.properties.purpose.size
= htonl (sizeof (struct TALER_DenominationKeyValidityPS)); = htonl (sizeof (struct TALER_DenominationKeyValidityPS));
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (&master_priv.eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&master_priv.eddsa_priv,
&dki->issue.properties.purpose, &dki->issue.properties,
&dki->issue.signature.eddsa_signature)); &dki->issue.signature.eddsa_signature);
} }
@ -948,10 +946,9 @@ sign_af (struct TALER_EXCHANGEDB_AggregateFees *af,
TALER_EXCHANGEDB_fees_2_wf (method, TALER_EXCHANGEDB_fees_2_wf (method,
af, af,
&wf); &wf);
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (priv, GNUNET_CRYPTO_eddsa_sign (priv,
&wf.purpose, &wf,
&af->master_sig.eddsa_signature)); &af->master_sig.eddsa_signature);
} }

View File

@ -79,7 +79,7 @@ reply_deposit_success (struct MHD_Connection *connection,
TALER_amount_hton (&dc.amount_without_fee, TALER_amount_hton (&dc.amount_without_fee,
amount_without_fee); amount_without_fee);
if (GNUNET_OK != if (GNUNET_OK !=
TEH_KS_sign (&dc.purpose, TEH_KS_sign (&dc,
&pub, &pub,
&sig)) &sig))
{ {
@ -508,7 +508,7 @@ TEH_handler_deposit (struct MHD_Connection *connection,
&deposit.deposit_fee); &deposit.deposit_fee);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT,
&dr.purpose, &dr,
&deposit.csig.eddsa_signature, &deposit.csig.eddsa_signature,
&deposit.coin.coin_pub.eddsa_pub)) &deposit.coin.coin_pub.eddsa_pub))
{ {

View File

@ -69,7 +69,7 @@ reply_deposit_details (struct MHD_Connection *connection,
TALER_amount_hton (&cw.coin_contribution, TALER_amount_hton (&cw.coin_contribution,
coin_contribution); coin_contribution);
if (GNUNET_OK != if (GNUNET_OK !=
TEH_KS_sign (&cw.purpose, TEH_KS_sign (&cw,
&pub, &pub,
&sig)) &sig))
{ {
@ -381,7 +381,7 @@ TEH_handler_deposits_get (const struct TEH_RequestHandler *rh,
return MHD_YES; /* parse error */ return MHD_YES; /* parse error */
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION,
&tps.purpose, &tps,
&merchant_sig.eddsa_sig, &merchant_sig.eddsa_sig,
&tps.merchant.eddsa_pub)) &tps.merchant.eddsa_pub))
{ {

View File

@ -593,7 +593,7 @@ store_in_map (struct GNUNET_CONTAINER_MultiHashMap *map,
if (GNUNET_SYSERR == if (GNUNET_SYSERR ==
GNUNET_CRYPTO_eddsa_verify ( GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY, TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY,
&denom_key_issue.purpose, &denom_key_issue,
&dkip->signature.eddsa_signature, &dkip->signature.eddsa_signature,
&TEH_master_public_key.eddsa_pub)) &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, GNUNET_CRYPTO_hash_context_finish (rbc.hash_context,
&ks.hc); &ks.hc);
rbc.hash_context = NULL; rbc.hash_context = NULL;
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign ( GNUNET_CRYPTO_eddsa_sign (
&rfc->key_state->current_sign_key_issue.signkey_priv. &rfc->key_state->current_sign_key_issue.signkey_priv.eddsa_priv,
eddsa_priv, &ks,
&ks.purpose, &sig.eddsa_signature);
&sig.eddsa_signature));
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (TEH_cfg, GNUNET_CONFIGURATION_get_value_time (TEH_cfg,
"exchangedb", "exchangedb",
@ -2399,16 +2397,20 @@ TEH_KS_free (void)
/** /**
* Sign the message in @a purpose with the exchange's signing key. * 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 purpose the message to sign
* @param[out] pub set to the current public signing key of the exchange * @param[out] pub set to the current public signing key of the exchange
* @param[out] sig signature over purpose using current signing key * @param[out] sig signature over purpose using current signing key
* @return #GNUNET_OK on success, #GNUNET_SYSERR if we lack key material * @return #GNUNET_OK on success, #GNUNET_SYSERR if we lack key material
*/ */
int int
TEH_KS_sign (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, TEH_KS_sign_ (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
struct TALER_ExchangePublicKeyP *pub, struct TALER_ExchangePublicKeyP *pub,
struct TALER_ExchangeSignatureP *sig) struct TALER_ExchangeSignatureP *sig)
{ {
struct TEH_KS_StateHandle *key_state; 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; *pub = key_state->current_sign_key_issue.issue.signkey_pub;
GNUNET_assert (GNUNET_OK == GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign ( GNUNET_CRYPTO_eddsa_sign_ (
&key_state->current_sign_key_issue.signkey_priv.eddsa_priv, &key_state->current_sign_key_issue.signkey_priv.eddsa_priv,
purpose, purpose,
&sig->eddsa_signature)); &sig->eddsa_signature));

View File

@ -171,16 +171,46 @@ TEH_KS_loop (void);
* Sign the message in @a purpose with the exchange's signing * Sign the message in @a purpose with the exchange's signing
* key. * 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 purpose the message to sign
* @param[out] pub set to the current public signing key of the exchange * @param[out] pub set to the current public signing key of the exchange
* @param[out] sig signature over purpose using current signing key * @param[out] sig signature over purpose using current signing key
* @return #GNUNET_OK on success, #GNUNET_SYSERR if we lack key material * @return #GNUNET_OK on success, #GNUNET_SYSERR if we lack key material
*/ */
int int
TEH_KS_sign (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, TEH_KS_sign_ (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
struct TALER_ExchangePublicKeyP *pub, struct TALER_ExchangePublicKeyP *pub,
struct TALER_ExchangeSignatureP *sig); 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); \
})
/** /**
* Handle a "/keys" request * Handle a "/keys" request

View File

@ -109,7 +109,7 @@ reply_melt_success (struct MHD_Connection *connection,
}; };
if (GNUNET_OK != if (GNUNET_OK !=
TEH_KS_sign (&body.purpose, TEH_KS_sign (&body,
&pub, &pub,
&sig)) &sig))
{ {
@ -376,22 +376,22 @@ handle_melt (struct MHD_Connection *connection,
{ {
/* verify signature of coin for melt operation */ /* 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, TALER_amount_hton (&body.amount_with_fee,
&rmc->refresh_session.amount_with_fee); &rmc->refresh_session.amount_with_fee);
TALER_amount_hton (&body.melt_fee, TALER_amount_hton (&body.melt_fee,
&rmc->coin_refresh_fee); &rmc->coin_refresh_fee);
body.coin_pub = rmc->refresh_session.coin.coin_pub;
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify ( GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_WALLET_COIN_MELT, TALER_SIGNATURE_WALLET_COIN_MELT,
&body.purpose, &body,
&rmc->refresh_session.coin_sig.eddsa_signature, &rmc->refresh_session.coin_sig.eddsa_signature,
&rmc->refresh_session.coin.coin_pub.eddsa_pub)) &rmc->refresh_session.coin.coin_pub.eddsa_pub))
{ {

View File

@ -414,7 +414,7 @@ verify_and_execute_recoup (struct MHD_Connection *connection,
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_RECOUP, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_RECOUP,
&pr.purpose, &pr,
&coin_sig->eddsa_signature, &coin_sig->eddsa_signature,
&coin->coin_pub.eddsa_pub)) &coin->coin_pub.eddsa_pub))
{ {

View File

@ -676,11 +676,11 @@ resolve_refreshes_reveal_denominations (struct TEH_KS_StateHandle *key_state,
rcds[i].coin_ev_size, rcds[i].coin_ev_size,
&ldp.coin_envelope_hash); &ldp.coin_envelope_hash);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_LINK, GNUNET_CRYPTO_eddsa_verify (
&ldp.purpose, TALER_SIGNATURE_WALLET_COIN_LINK,
&ldp,
&link_sigs[i].eddsa_signature, &link_sigs[i].eddsa_signature,
&melt.session.coin.coin_pub. &melt.session.coin.coin_pub.eddsa_pub))
eddsa_pub))
{ {
GNUNET_break_op (0); GNUNET_break_op (0);
res = TALER_MHD_reply_with_error (connection, res = TALER_MHD_reply_with_error (connection,

View File

@ -64,7 +64,7 @@ reply_refund_success (struct MHD_Connection *connection,
TALER_amount_hton (&rc.refund_fee, TALER_amount_hton (&rc.refund_fee,
&refund->refund_fee); &refund->refund_fee);
if (GNUNET_OK != if (GNUNET_OK !=
TEH_KS_sign (&rc.purpose, TEH_KS_sign (&rc,
&pub, &pub,
&sig)) &sig))
{ {
@ -365,7 +365,7 @@ verify_and_execute_refund (struct MHD_Connection *connection,
&refund->details.refund_fee); &refund->details.refund_fee);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND,
&rr.purpose, &rr,
&refund->details.merchant_sig.eddsa_sig, &refund->details.merchant_sig.eddsa_sig,
&refund->details.merchant_pub.eddsa_pub)) &refund->details.merchant_pub.eddsa_pub))
{ {

View File

@ -81,7 +81,7 @@ TEH_RESPONSE_compile_transaction_history (
/* internal sanity check before we hand out a bogus sig... */ /* internal sanity check before we hand out a bogus sig... */
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT,
&dr.purpose, &dr,
&deposit->csig.eddsa_signature, &deposit->csig.eddsa_signature,
&coin_pub->eddsa_pub)) &coin_pub->eddsa_pub))
{ {
@ -139,7 +139,7 @@ TEH_RESPONSE_compile_transaction_history (
/* internal sanity check before we hand out a bogus sig... */ /* internal sanity check before we hand out a bogus sig... */
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_MELT, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_MELT,
&ms.purpose, &ms,
&melt->coin_sig.eddsa_signature, &melt->coin_sig.eddsa_signature,
&coin_pub->eddsa_pub)) &coin_pub->eddsa_pub))
{ {
@ -191,7 +191,7 @@ TEH_RESPONSE_compile_transaction_history (
/* internal sanity check before we hand out a bogus sig... */ /* internal sanity check before we hand out a bogus sig... */
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND,
&rr.purpose, &rr,
&refund->merchant_sig.eddsa_sig, &refund->merchant_sig.eddsa_sig,
&refund->merchant_pub.eddsa_pub)) &refund->merchant_pub.eddsa_pub))
{ {
@ -253,7 +253,7 @@ TEH_RESPONSE_compile_transaction_history (
TALER_amount_hton (&pc.recoup_amount, TALER_amount_hton (&pc.recoup_amount,
&pr->value); &pr->value);
if (GNUNET_OK != if (GNUNET_OK !=
TEH_KS_sign (&pc.purpose, TEH_KS_sign (&pc,
&epub, &epub,
&esig)) &esig))
{ {
@ -306,7 +306,7 @@ TEH_RESPONSE_compile_transaction_history (
TALER_amount_hton (&pc.recoup_amount, TALER_amount_hton (&pc.recoup_amount,
&recoup->value); &recoup->value);
if (GNUNET_OK != if (GNUNET_OK !=
TEH_KS_sign (&pc.purpose, TEH_KS_sign (&pc,
&epub, &epub,
&esig)) &esig))
{ {
@ -355,7 +355,7 @@ TEH_RESPONSE_compile_transaction_history (
TALER_amount_hton (&pc.recoup_amount, TALER_amount_hton (&pc.recoup_amount,
&pr->value); &pr->value);
if (GNUNET_OK != if (GNUNET_OK !=
TEH_KS_sign (&pc.purpose, TEH_KS_sign (&pc,
&epub, &epub,
&esig)) &esig))
{ {
@ -593,7 +593,7 @@ TEH_RESPONSE_compile_reserve_history (
TALER_amount_hton (&pc.recoup_amount, TALER_amount_hton (&pc.recoup_amount,
&recoup->value); &recoup->value);
if (GNUNET_OK != if (GNUNET_OK !=
TEH_KS_sign (&pc.purpose, TEH_KS_sign (&pc,
&pub, &pub,
&sig)) &sig))
{ {
@ -669,7 +669,7 @@ TEH_RESPONSE_compile_reserve_history (
strlen (closing->receiver_account_details) + 1, strlen (closing->receiver_account_details) + 1,
&rcc.h_wire); &rcc.h_wire);
if (GNUNET_OK != if (GNUNET_OK !=
TEH_KS_sign (&rcc.purpose, TEH_KS_sign (&rcc,
&pub, &pub,
&sig)) &sig))
{ {

View File

@ -159,7 +159,7 @@ reply_transfer_details (struct MHD_Connection *connection,
GNUNET_CRYPTO_hash_context_finish (hash_context, GNUNET_CRYPTO_hash_context_finish (hash_context,
&wdp.h_details); &wdp.h_details);
if (GNUNET_OK != if (GNUNET_OK !=
TEH_KS_sign (&wdp.purpose, TEH_KS_sign (&wdp,
&pub, &pub,
&sig)) &sig))
{ {

View File

@ -442,7 +442,7 @@ TEH_handler_withdraw (const struct TEH_RequestHandler *rh,
/* verify signature! */ /* verify signature! */
wc.wsrd.purpose.size wc.wsrd.purpose.size
= htonl (sizeof (struct TALER_WithdrawRequestPS)); = htonl (sizeof (wc.wsrd));
wc.wsrd.purpose.purpose wc.wsrd.purpose.purpose
= htonl (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW); = htonl (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW);
wc.wsrd.h_denomination_pub wc.wsrd.h_denomination_pub
@ -452,7 +452,7 @@ TEH_handler_withdraw (const struct TEH_RequestHandler *rh,
&wc.wsrd.h_coin_envelope); &wc.wsrd.h_coin_envelope);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW,
&wc.wsrd.purpose, &wc.wsrd,
&wc.signature.eddsa_signature, &wc.signature.eddsa_signature,
&wc.wsrd.reserve_pub.eddsa_pub)) &wc.wsrd.reserve_pub.eddsa_pub))
{ {

View File

@ -75,10 +75,9 @@ TALER_EXCHANGEDB_denomination_key_revoke (
.h_denom_pub = *denom_hash .h_denom_pub = *denom_hash
}; };
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (&mpriv->eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&mpriv->eddsa_priv,
&rm.purpose, &rm,
&rd.msig.eddsa_signature)); &rd.msig.eddsa_signature);
} }
GNUNET_asprintf (&fn, GNUNET_asprintf (&fn,
"%s" DIR_SEPARATOR_STR "%s" DIR_SEPARATOR_STR
@ -476,7 +475,7 @@ revocations_iterate_cb (void *cls,
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify ( GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED, TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED,
&rm.purpose, &rm,
&rf.msig.eddsa_signature, &rf.msig.eddsa_signature,
&ric->master_pub->eddsa_pub)) &ric->master_pub->eddsa_pub))
{ {

View File

@ -39,10 +39,9 @@ sign_af (struct TALER_EXCHANGEDB_AggregateFees *af,
TALER_EXCHANGEDB_fees_2_wf ("test", TALER_EXCHANGEDB_fees_2_wf ("test",
af, af,
&wf); &wf);
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (priv, GNUNET_CRYPTO_eddsa_sign (priv,
&wf.purpose, &wf,
&af->master_sig.eddsa_signature)); &af->master_sig.eddsa_signature);
} }
@ -136,7 +135,7 @@ main (int argc,
&wf); &wf);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_FEES, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_FEES,
&wf.purpose, &wf,
&p->master_sig.eddsa_signature, &p->master_sig.eddsa_signature,
&master_pub.eddsa_pub)) &master_pub.eddsa_pub))
{ {

View File

@ -178,43 +178,50 @@ verify_signatures (const struct GNUNET_HashCode *h_wire,
struct GNUNET_TIME_Absolute ep_end, struct GNUNET_TIME_Absolute ep_end,
const struct TALER_MasterSignatureP *master_sig) const struct TALER_MasterSignatureP *master_sig)
{ {
struct TALER_DepositConfirmationPS dc; {
struct TALER_ExchangeSigningKeyValidityPS sv; 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
};
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, TALER_amount_hton (&dc.amount_without_fee,
amount_without_fee); amount_without_fee);
dc.coin_pub = *coin_pub;
dc.merchant = *merchant_pub;
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT,
&dc.purpose, &dc,
&exchange_sig->eddsa_signature, &exchange_sig->eddsa_signature,
&exchange_pub->eddsa_pub)) &exchange_pub->eddsa_pub))
{ {
GNUNET_break_op (0); GNUNET_break_op (0);
TALER_LOG_WARNING ("Invalid signature on /deposit-confirmation request!\n"); TALER_LOG_WARNING (
"Invalid signature on /deposit-confirmation request!\n");
{ {
TALER_LOG_DEBUG ("... amount_without_fee was %s\n", TALER_LOG_DEBUG ("... amount_without_fee was %s\n",
TALER_amount2s (amount_without_fee)); 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; struct TALER_ExchangeSigningKeyValidityPS sv = {
sv.start = GNUNET_TIME_absolute_hton (ep_start); .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY),
sv.expire = GNUNET_TIME_absolute_hton (ep_expire); .purpose.size = htonl (sizeof (sv)),
sv.end = GNUNET_TIME_absolute_hton (ep_end); .master_public_key = *master_pub,
sv.signkey_pub = *exchange_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 != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY,
&sv.purpose, &sv,
&master_sig->eddsa_signature, &master_sig->eddsa_signature,
&master_pub->eddsa_pub)) &master_pub->eddsa_pub))
{ {
@ -222,6 +229,7 @@ verify_signatures (const struct GNUNET_HashCode *h_wire,
TALER_LOG_WARNING ("Invalid signature on exchange signing key!\n"); TALER_LOG_WARNING ("Invalid signature on exchange signing key!\n");
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
}
if (0 == GNUNET_TIME_absolute_get_remaining (ep_end).rel_value_us) if (0 == GNUNET_TIME_absolute_get_remaining (ep_end).rel_value_us)
{ {
GNUNET_break (0); GNUNET_break (0);

View File

@ -177,7 +177,7 @@ TALER_EXCHANGE_parse_reserve_history (
/* Check that the signature is a valid withdraw request */ /* Check that the signature is a valid withdraw request */
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW,
&withdraw_purpose.purpose, &withdraw_purpose,
&sig.eddsa_signature, &sig.eddsa_signature,
&reserve_pub->eddsa_pub)) &reserve_pub->eddsa_pub))
{ {
@ -294,7 +294,7 @@ TALER_EXCHANGE_parse_reserve_history (
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify ( GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP, TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP,
&pc.purpose, &pc,
&rh->details.recoup_details.exchange_sig.eddsa_signature, &rh->details.recoup_details.exchange_sig.eddsa_signature,
&rh->details.recoup_details.exchange_pub.eddsa_pub)) &rh->details.recoup_details.exchange_pub.eddsa_pub))
{ {
@ -371,7 +371,7 @@ TALER_EXCHANGE_parse_reserve_history (
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify ( GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED, TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED,
&rcc.purpose, &rcc,
&rh->details.close_details.exchange_sig.eddsa_signature, &rh->details.close_details.exchange_sig.eddsa_signature,
&rh->details.close_details.exchange_pub.eddsa_pub)) &rh->details.close_details.exchange_pub.eddsa_pub))
{ {
@ -551,7 +551,7 @@ TALER_EXCHANGE_verify_coin_history (
dr.coin_pub = *coin_pub; dr.coin_pub = *coin_pub;
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT,
&dr.purpose, &dr,
&sig.eddsa_signature, &sig.eddsa_signature,
&coin_pub->eddsa_pub)) &coin_pub->eddsa_pub))
{ {
@ -606,7 +606,7 @@ TALER_EXCHANGE_verify_coin_history (
rm.coin_pub = *coin_pub; rm.coin_pub = *coin_pub;
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_MELT, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_MELT,
&rm.purpose, &rm,
&sig.eddsa_signature, &sig.eddsa_signature,
&coin_pub->eddsa_pub)) &coin_pub->eddsa_pub))
{ {
@ -665,7 +665,7 @@ TALER_EXCHANGE_verify_coin_history (
&amount); &amount);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND,
&rr.purpose, &rr,
&sig.eddsa_sig, &sig.eddsa_sig,
&rr.merchant.eddsa_pub)) &rr.merchant.eddsa_pub))
{ {
@ -731,7 +731,7 @@ TALER_EXCHANGE_verify_coin_history (
&amount); &amount);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP,
&pc.purpose, &pc,
&exchange_sig.eddsa_signature, &exchange_sig.eddsa_signature,
&exchange_pub.eddsa_pub)) &exchange_pub.eddsa_pub))
{ {

View File

@ -219,7 +219,7 @@ verify_deposit_signature_ok (struct TALER_EXCHANGE_DepositHandle *dh,
} }
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT,
&dh->depconf.purpose, &dh->depconf,
&exchange_sig->eddsa_signature, &exchange_sig->eddsa_signature,
&exchange_pub->eddsa_pub)) &exchange_pub->eddsa_pub))
{ {
@ -441,7 +441,7 @@ verify_signatures (const struct TALER_EXCHANGE_DenomPublicKey *dki,
&dki->fee_deposit); &dki->fee_deposit);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT,
&dr.purpose, &dr,
&coin_sig->eddsa_signature, &coin_sig->eddsa_signature,
&coin_pub->eddsa_pub)) &coin_pub->eddsa_pub))
{ {

View File

@ -119,7 +119,7 @@ verify_deposit_wtid_signature_ok (
} }
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE,
&dwh->depconf.purpose, &dwh->depconf,
&exchange_sig.eddsa_signature, &exchange_sig.eddsa_signature,
&exchange_pub->eddsa_pub)) &exchange_pub->eddsa_pub))
{ {
@ -315,10 +315,9 @@ TALER_EXCHANGE_deposits_get (
&dtp.merchant.eddsa_pub); &dtp.merchant.eddsa_pub);
dtp.coin_pub = *coin_pub; dtp.coin_pub = *coin_pub;
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (&merchant_priv->eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&merchant_priv->eddsa_priv,
&dtp.purpose, &dtp,
&merchant_sig.eddsa_sig)); &merchant_sig.eddsa_sig);
{ {
char cpub_str[sizeof (struct TALER_CoinSpendPublicKeyP) * 2]; char cpub_str[sizeof (struct TALER_CoinSpendPublicKeyP) * 2];
char mpub_str[sizeof (struct TALER_MerchantPublicKeyP) * 2]; char mpub_str[sizeof (struct TALER_MerchantPublicKeyP) * 2];

View File

@ -407,7 +407,7 @@ parse_json_signkey (struct TALER_EXCHANGE_SigningPublicKey *sign_key,
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY,
&sign_key_issue.purpose, &sign_key_issue,
&sign_key_issue_sig.eddsa_signature, &sign_key_issue_sig.eddsa_signature,
&master_key->eddsa_pub)) &master_key->eddsa_pub))
{ {
@ -508,7 +508,7 @@ parse_json_denomkey (struct TALER_EXCHANGE_DenomPublicKey *denom_key,
EXITIF (GNUNET_SYSERR == EXITIF (GNUNET_SYSERR ==
GNUNET_CRYPTO_eddsa_verify ( GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY, TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY,
&denom_key_issue.purpose, &denom_key_issue,
&denom_key->master_sig.eddsa_signature, &denom_key->master_sig.eddsa_signature,
&master_key->eddsa_pub)); &master_key->eddsa_pub));
} }
@ -635,7 +635,7 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS,
&kv.purpose, &kv,
&auditor_sig.eddsa_sig, &auditor_sig.eddsa_sig,
&auditor->auditor_pub.eddsa_pub)) &auditor->auditor_pub.eddsa_pub))
{ {
@ -1096,7 +1096,7 @@ decode_keys_json (const json_t *resp_obj,
&pub)); &pub));
EXITIF (GNUNET_OK != EXITIF (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_KEY_SET, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_KEY_SET,
&ks.purpose, &ks,
&sig.eddsa_signature, &sig.eddsa_signature,
&pub.eddsa_pub)); &pub.eddsa_pub));
} }

View File

@ -154,7 +154,7 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh,
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_LINK, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_LINK,
&ldp.purpose, &ldp,
&link_sig.eddsa_signature, &link_sig.eddsa_signature,
&ldp.old_coin_pub.eddsa_pub)) &ldp.old_coin_pub.eddsa_pub))
{ {

View File

@ -142,7 +142,7 @@ verify_melt_signature_ok (struct TALER_EXCHANGE_MeltHandle *mh,
confirm.noreveal_index = htonl (*noreveal_index); confirm.noreveal_index = htonl (*noreveal_index);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT,
&confirm.purpose, &confirm,
&exchange_sig.eddsa_signature, &exchange_sig.eddsa_signature,
&exchange_pub->eddsa_pub)) &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, GNUNET_CRYPTO_eddsa_key_get_public (&md->melted_coin.coin_priv.eddsa_priv,
&melt.coin_pub.eddsa_pub); &melt.coin_pub.eddsa_pub);
GNUNET_CRYPTO_eddsa_sign (&md->melted_coin.coin_priv.eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&md->melted_coin.coin_priv.eddsa_priv,
&melt.purpose, &melt,
&confirm_sig.eddsa_signature); &confirm_sig.eddsa_signature);
GNUNET_CRYPTO_rsa_public_key_hash (md->melted_coin.pub_key.rsa_public_key, GNUNET_CRYPTO_rsa_public_key_hash (md->melted_coin.pub_key.rsa_public_key,
&h_denom_pub); &h_denom_pub);

View File

@ -303,11 +303,9 @@ TALER_EXCHANGE_recoup (struct TALER_EXCHANGE_Handle *exchange,
&h_denom_pub); &h_denom_pub);
pr.h_denom_pub = pk->h_key; pr.h_denom_pub = pk->h_key;
pr.coin_blind = ps->blinding_key; pr.coin_blind = ps->blinding_key;
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (&ps->coin_priv.eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&ps->coin_priv.eddsa_priv,
&pr.purpose, &pr,
&coin_sig.eddsa_signature)); &coin_sig.eddsa_signature);
recoup_obj = json_pack ("{s:o, s:o," /* denom pub/sig */ recoup_obj = json_pack ("{s:o, s:o," /* denom pub/sig */
" s:o," /* sig */ " s:o," /* sig */
" s:o, s:o}", /* coin_bks */ " s:o, s:o}", /* coin_bks */

View File

@ -399,11 +399,9 @@ TALER_EXCHANGE_refreshes_reveal (
GNUNET_CRYPTO_hash (pd.coin_ev, GNUNET_CRYPTO_hash (pd.coin_ev,
pd.coin_ev_size, pd.coin_ev_size,
&ldp.coin_envelope_hash); &ldp.coin_envelope_hash);
GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (&md->melted_coin.coin_priv.eddsa_priv,
GNUNET_CRYPTO_eddsa_sign ( &ldp,
&md->melted_coin.coin_priv.eddsa_priv, &link_sig.eddsa_signature);
&ldp.purpose,
&link_sig.eddsa_signature));
GNUNET_assert (0 == GNUNET_assert (0 ==
json_array_append_new (link_sigs, json_array_append_new (link_sigs,
GNUNET_JSON_from_data_auto ( GNUNET_JSON_from_data_auto (

View File

@ -117,7 +117,7 @@ verify_refund_signature_ok (const struct TALER_EXCHANGE_RefundHandle *rh,
} }
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND,
&rh->depconf.purpose, &rh->depconf,
&exchange_sig.eddsa_signature, &exchange_sig.eddsa_signature,
&exchange_pub->eddsa_pub)) &exchange_pub->eddsa_pub))
{ {
@ -289,10 +289,9 @@ TALER_EXCHANGE_refund (struct TALER_EXCHANGE_Handle *exchange,
amount); amount);
TALER_amount_hton (&rr.refund_fee, TALER_amount_hton (&rr.refund_fee,
refund_fee); refund_fee);
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (&merchant_priv->eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&merchant_priv->eddsa_priv,
&rr.purpose, &rr,
&merchant_sig.eddsa_sig)); &merchant_sig.eddsa_sig);
return TALER_EXCHANGE_refund2 (exchange, return TALER_EXCHANGE_refund2 (exchange,
amount, amount,
refund_fee, refund_fee,

View File

@ -207,7 +207,7 @@ check_transfers_get_response_ok (
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify ( GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT, TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT,
&wdp.purpose, &wdp,
&exchange_sig.eddsa_signature, &exchange_sig.eddsa_signature,
&exchange_pub.eddsa_pub)) &exchange_pub.eddsa_pub))
{ {

View File

@ -540,10 +540,9 @@ TALER_EXCHANGE_withdraw (
GNUNET_CRYPTO_hash (pd.coin_ev, GNUNET_CRYPTO_hash (pd.coin_ev,
pd.coin_ev_size, pd.coin_ev_size,
&req.h_coin_envelope); &req.h_coin_envelope);
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (&reserve_priv->eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&reserve_priv->eddsa_priv,
&req.purpose, &req,
&reserve_sig.eddsa_signature)); &reserve_sig.eddsa_signature);
wh = reserve_withdraw_internal (exchange, wh = reserve_withdraw_internal (exchange,
pk, pk,
&reserve_sig, &reserve_sig,

View File

@ -409,10 +409,9 @@ deposit_run (void *cls,
&denom_pub->fee_deposit); &denom_pub->fee_deposit);
dr.merchant = merchant_pub; dr.merchant = merchant_pub;
dr.coin_pub = coin_pub; dr.coin_pub = coin_pub;
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (&coin_priv->eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&coin_priv->eddsa_priv,
&dr.purpose, &dr,
&coin_sig.eddsa_signature)); &coin_sig.eddsa_signature);
} }
ds->dh = TALER_EXCHANGE_deposit (is->exchange, ds->dh = TALER_EXCHANGE_deposit (is->exchange,
&ds->amount, &ds->amount,

View File

@ -59,14 +59,15 @@ TALER_exchange_wire_signature_check (
const struct TALER_MasterPublicKeyP *master_pub, const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_MasterSignatureP *master_sig) 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, TALER_exchange_wire_signature_hash (payto_uri,
&wd.h_wire_details); &wd.h_wire_details);
return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_DETAILS, return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_DETAILS,
&wd.purpose, &wd,
&master_sig->eddsa_signature, &master_sig->eddsa_signature,
&master_pub->eddsa_pub); &master_pub->eddsa_pub);
} }
@ -85,16 +86,16 @@ TALER_exchange_wire_signature_make (
const struct TALER_MasterPrivateKeyP *master_priv, const struct TALER_MasterPrivateKeyP *master_priv,
struct TALER_MasterSignatureP *master_sig) 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, TALER_exchange_wire_signature_hash (payto_uri,
&wd.h_wire_details); &wd.h_wire_details);
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
&wd.purpose, &wd,
&master_sig->eddsa_signature)); &master_sig->eddsa_signature);
} }
@ -149,15 +150,16 @@ TALER_merchant_wire_signature_check (
const struct TALER_MerchantPublicKeyP *merch_pub, const struct TALER_MerchantPublicKeyP *merch_pub,
const struct TALER_MerchantSignatureP *merch_sig) 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, TALER_merchant_wire_signature_hash (payto_uri,
salt, salt,
&wd.h_wire_details); &wd.h_wire_details);
return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS, return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS,
&wd.purpose, &wd,
&merch_sig->eddsa_sig, &merch_sig->eddsa_sig,
&merch_pub->eddsa_pub); &merch_pub->eddsa_pub);
} }
@ -178,17 +180,17 @@ TALER_merchant_wire_signature_make (
const struct TALER_MerchantPrivateKeyP *merch_priv, const struct TALER_MerchantPrivateKeyP *merch_priv,
struct TALER_MerchantSignatureP *merch_sig) 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, TALER_merchant_wire_signature_hash (payto_uri,
salt, salt,
&wd.h_wire_details); &wd.h_wire_details);
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (&merch_priv->eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&merch_priv->eddsa_priv,
&wd.purpose, &wd,
&merch_sig->eddsa_sig)); &merch_sig->eddsa_sig);
} }