diff options
Diffstat (limited to 'src/exchange/taler-exchange-httpd_keys.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_keys.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c index 6074b31f7..d301c5def 100644 --- a/src/exchange/taler-exchange-httpd_keys.c +++ b/src/exchange/taler-exchange-httpd_keys.c | |||
@@ -1391,7 +1391,7 @@ setup_general_response_headers (const struct TEH_KeyStateHandle *ksh, | |||
1391 | * @param denoms list of denominations to return | 1391 | * @param denoms list of denominations to return |
1392 | * @return #GNUNET_OK on success | 1392 | * @return #GNUNET_OK on success |
1393 | */ | 1393 | */ |
1394 | static int | 1394 | static enum GNUNET_GenericReturnValue |
1395 | create_krd (struct TEH_KeyStateHandle *ksh, | 1395 | create_krd (struct TEH_KeyStateHandle *ksh, |
1396 | const struct GNUNET_HashCode *denom_keys_hash, | 1396 | const struct GNUNET_HashCode *denom_keys_hash, |
1397 | struct GNUNET_TIME_Absolute last_cpd, | 1397 | struct GNUNET_TIME_Absolute last_cpd, |
@@ -1404,6 +1404,7 @@ create_krd (struct TEH_KeyStateHandle *ksh, | |||
1404 | struct TALER_ExchangeSignatureP exchange_sig; | 1404 | struct TALER_ExchangeSignatureP exchange_sig; |
1405 | json_t *keys; | 1405 | json_t *keys; |
1406 | 1406 | ||
1407 | GNUNET_assert (0 != last_cpd.abs_value_us); | ||
1407 | GNUNET_assert (NULL != signkeys); | 1408 | GNUNET_assert (NULL != signkeys); |
1408 | GNUNET_assert (NULL != recoup); | 1409 | GNUNET_assert (NULL != recoup); |
1409 | GNUNET_assert (NULL != denoms); | 1410 | GNUNET_assert (NULL != denoms); |
@@ -1541,8 +1542,8 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh) | |||
1541 | struct GNUNET_HashContext *hash_context; | 1542 | struct GNUNET_HashContext *hash_context; |
1542 | 1543 | ||
1543 | sctx.signkeys = json_array (); | 1544 | sctx.signkeys = json_array (); |
1544 | sctx.next_sk_expire = GNUNET_TIME_UNIT_FOREVER_ABS; | ||
1545 | GNUNET_assert (NULL != sctx.signkeys); | 1545 | GNUNET_assert (NULL != sctx.signkeys); |
1546 | sctx.next_sk_expire = GNUNET_TIME_UNIT_FOREVER_ABS; | ||
1546 | GNUNET_CONTAINER_multipeermap_iterate (ksh->signkey_map, | 1547 | GNUNET_CONTAINER_multipeermap_iterate (ksh->signkey_map, |
1547 | &add_sign_key_cb, | 1548 | &add_sign_key_cb, |
1548 | &sctx); | 1549 | &sctx); |
@@ -1637,6 +1638,7 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh) | |||
1637 | } | 1638 | } |
1638 | } | 1639 | } |
1639 | GNUNET_CONTAINER_heap_destroy (heap); | 1640 | GNUNET_CONTAINER_heap_destroy (heap); |
1641 | if (0 != last_cpd.abs_value_us) | ||
1640 | { | 1642 | { |
1641 | struct GNUNET_HashCode hc; | 1643 | struct GNUNET_HashCode hc; |
1642 | 1644 | ||
@@ -1658,11 +1660,17 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh) | |||
1658 | json_decref (recoup); | 1660 | json_decref (recoup); |
1659 | return GNUNET_SYSERR; | 1661 | return GNUNET_SYSERR; |
1660 | } | 1662 | } |
1663 | ksh->management_only = false; | ||
1664 | } | ||
1665 | else | ||
1666 | { | ||
1667 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
1668 | "No denomination keys available. Refusing to generate /keys response.\n"); | ||
1669 | GNUNET_CRYPTO_hash_context_abort (hash_context); | ||
1661 | } | 1670 | } |
1662 | json_decref (sctx.signkeys); | 1671 | json_decref (sctx.signkeys); |
1663 | json_decref (recoup); | 1672 | json_decref (recoup); |
1664 | json_decref (denoms); | 1673 | json_decref (denoms); |
1665 | ksh->management_only = false; | ||
1666 | return GNUNET_OK; | 1674 | return GNUNET_OK; |
1667 | } | 1675 | } |
1668 | 1676 | ||