diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-12-07 17:48:39 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-12-07 17:48:39 +0100 |
commit | d4d590bcdab735949ebbc27c7e568647ed442009 (patch) | |
tree | 01d59f9e9a26aac876d12dd31e4bde98fd7d0547 | |
parent | 9cbd1cc139217cc33ac1943d165e9b89ca5a8668 (diff) |
do not crash on bogus signature on denomination key
-rw-r--r-- | src/exchange/taler-exchange-httpd_keystate.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/exchange/taler-exchange-httpd_keystate.c b/src/exchange/taler-exchange-httpd_keystate.c index cf5cbe9a0..828f48373 100644 --- 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); } |