check signatures before serving
This commit is contained in:
parent
8577686bbe
commit
c17d82e9b4
@ -587,6 +587,30 @@ store_in_map (struct GNUNET_CONTAINER_MultiHashMap *map,
|
||||
struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *d2;
|
||||
int res;
|
||||
|
||||
{
|
||||
const struct TALER_EXCHANGEDB_DenominationKeyInformationP *dkip;
|
||||
struct TALER_DenominationKeyValidityPS denom_key_issue;
|
||||
|
||||
dkip = &dki->issue;
|
||||
denom_key_issue = dkip->properties;
|
||||
denom_key_issue.purpose.purpose
|
||||
= htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY);
|
||||
denom_key_issue.purpose.size
|
||||
= htonl (sizeof (struct TALER_DenominationKeyValidityPS));
|
||||
denom_key_issue.master = TEH_master_public_key;
|
||||
if (GNUNET_SYSERR ==
|
||||
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY,
|
||||
&denom_key_issue.purpose,
|
||||
&dkip->signature.eddsa_signature,
|
||||
&TEH_master_public_key.eddsa_pub))
|
||||
{
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||
"Invalid signature on denomination key `%s'\n",
|
||||
GNUNET_h2s (&dkip->properties.denom_hash));
|
||||
return GNUNET_SYSERR;
|
||||
}
|
||||
}
|
||||
|
||||
d2 = GNUNET_new (struct TALER_EXCHANGEDB_DenominationKeyIssueInformation);
|
||||
d2->issue = dki->issue;
|
||||
if (NULL != dki->denom_priv.rsa_private_key)
|
||||
|
Loading…
Reference in New Issue
Block a user