check signatures before serving

This commit is contained in:
Christian Grothoff 2019-08-21 20:32:27 +02:00
parent 8577686bbe
commit c17d82e9b4
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -587,6 +587,30 @@ store_in_map (struct GNUNET_CONTAINER_MultiHashMap *map,
struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *d2; struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *d2;
int res; 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 = GNUNET_new (struct TALER_EXCHANGEDB_DenominationKeyIssueInformation);
d2->issue = dki->issue; d2->issue = dki->issue;
if (NULL != dki->denom_priv.rsa_private_key) if (NULL != dki->denom_priv.rsa_private_key)