diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-10-11 14:32:32 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-10-11 14:32:32 +0200 |
commit | 66573865e1da2b23ad856d70088c23ec7f4d4922 (patch) | |
tree | a62ce857fb00c5ce2041cf20a11377f31ed41aec /src/exchange/taler-exchange-httpd_keys.c | |
parent | 70ff10286ba94b0dbcb880a79222ee1bc06a5aea (diff) | |
download | exchange-66573865e1da2b23ad856d70088c23ec7f4d4922.tar.gz exchange-66573865e1da2b23ad856d70088c23ec7f4d4922.tar.bz2 exchange-66573865e1da2b23ad856d70088c23ec7f4d4922.zip |
generate 502 on secmod unavailable instead of 200 with bad public key; more logging
Diffstat (limited to 'src/exchange/taler-exchange-httpd_keys.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_keys.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c index 72c2de123..0e0005305 100644 --- a/src/exchange/taler-exchange-httpd_keys.c +++ b/src/exchange/taler-exchange-httpd_keys.c @@ -2504,6 +2504,21 @@ TEH_keys_management_get_keys_handler (const struct TEH_RequestHandler *rh, .signkeys = json_array () }; + if (GNUNET_is_zero (&denom_sm_pub)) + { + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_GATEWAY, + TALER_EC_EXCHANGE_DENOMINATION_HELPER_UNAVAILABLE, + NULL); + } + if (GNUNET_is_zero (&esign_sm_pub)) + { + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_GATEWAY, + TALER_EC_EXCHANGE_SIGNKEY_HELPER_UNAVAILABLE, + NULL); + } + // then a secmod helper is not yet running and we should return an MHD_HTTP_BAD_GATEWAY! GNUNET_assert (NULL != fbc.denoms); GNUNET_assert (NULL != fbc.signkeys); GNUNET_CONTAINER_multihashmap_iterate (ksh->helpers->denom_keys, |