fix struct used in size calc for key signing

This commit is contained in:
Christian Grothoff 2015-06-19 22:24:02 +02:00
parent 113dee90a9
commit 2c1db3ea04
2 changed files with 12 additions and 8 deletions

View File

@ -458,10 +458,12 @@ parse_json_denomkey (struct TALER_MINT_DenomPublicKey *denom_key,
EXITIF (GNUNET_SYSERR == parse_json_amount (obj, &fee_deposit)); EXITIF (GNUNET_SYSERR == parse_json_amount (obj, &fee_deposit));
EXITIF (NULL == (obj = json_object_get (denom_key_obj, "fee_refresh"))); EXITIF (NULL == (obj = json_object_get (denom_key_obj, "fee_refresh")));
EXITIF (GNUNET_SYSERR == parse_json_amount (obj, &fee_refresh)); EXITIF (GNUNET_SYSERR == parse_json_amount (obj, &fee_refresh));
denom_key_issue.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY); denom_key_issue.purpose.purpose
denom_key_issue.purpose.size = htonl = htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY);
(sizeof (struct TALER_DenominationKeyValidityPS) - denom_key_issue.purpose.size
offsetof (struct TALER_DenominationKeyValidityPS, purpose)); = htonl (sizeof (struct TALER_DenominationKeyValidityPS) -
offsetof (struct TALER_DenominationKeyValidityPS,
purpose));
denom_key_issue.master = *master_key; denom_key_issue.master = *master_key;
denom_key_issue.start = GNUNET_TIME_absolute_hton (valid_from); denom_key_issue.start = GNUNET_TIME_absolute_hton (valid_from);
denom_key_issue.expire_withdraw = GNUNET_TIME_absolute_hton (withdraw_valid_until); denom_key_issue.expire_withdraw = GNUNET_TIME_absolute_hton (withdraw_valid_until);

View File

@ -752,10 +752,12 @@ create_denomkey_issue (const struct CoinTypeParams *params,
&params->fee_deposit); &params->fee_deposit);
TALER_amount_hton (&dki->issue.fee_refresh, TALER_amount_hton (&dki->issue.fee_refresh,
&params->fee_refresh); &params->fee_refresh);
dki->issue.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY); dki->issue.purpose.purpose
dki->issue.purpose.size = htonl (sizeof (struct TALER_MINTDB_DenominationKeyIssueInformation) - = htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY);
offsetof (struct TALER_MINTDB_DenominationKeyIssueInformation, dki->issue.purpose.size
issue.purpose)); = htonl (sizeof (struct TALER_DenominationKeyValidityPS) -
offsetof (struct TALER_DenominationKeyValidityPS,
purpose));
GNUNET_assert (GNUNET_OK == GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (&master_priv.eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&master_priv.eddsa_priv,
&dki->issue.purpose, &dki->issue.purpose,