exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit d4d590bcdab735949ebbc27c7e568647ed442009
parent 9cbd1cc139217cc33ac1943d165e9b89ca5a8668
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat,  7 Dec 2019 17:48:39 +0100

do not crash on bogus signature on denomination key

Diffstat:
Msrc/exchange/taler-exchange-httpd_keystate.c | 15++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_keystate.c b/src/exchange/taler-exchange-httpd_keystate.c @@ -1601,6 +1601,7 @@ reload_public_denoms_cb (void *cls, { struct ResponseFactoryContext *rfc = cls; struct TALER_EXCHANGEDB_DenominationKeyIssueInformation dki; + int ret; if (rfc->now.abs_value_us > GNUNET_TIME_absolute_ntoh (issue->properties.expire_legal).abs_value_us) @@ -1625,9 +1626,17 @@ reload_public_denoms_cb (void *cls, dki.denom_pub.rsa_public_key = denom_pub->rsa_public_key; dki.issue = *issue; /* we can assert here as we checked for duplicates just above */ - GNUNET_assert (GNUNET_OK == - store_in_map (rfc->key_state->denomkey_map, - &dki /* makes a deep copy of dki */)); + ret = store_in_map (rfc->key_state->denomkey_map, + &dki /* makes a deep copy of dki */); + if (GNUNET_SYSERR == ret) + { + GNUNET_break (0); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Signature wrong on denomination key `%s' (skipping)!\n", + GNUNET_h2s (&issue->properties.denom_hash)); + return; + } + GNUNET_assert (GNUNET_OK == ret); }