From d0f2d8b42677b578e725cae999db7589fbe35e83 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 15 Mar 2015 15:40:07 +0100 Subject: simplify code structure, reduce exposure of keystate struct --- src/mint/taler-mint-httpd_keystate.h | 61 +++++++++++------------------------- 1 file changed, 18 insertions(+), 43 deletions(-) (limited to 'src/mint/taler-mint-httpd_keystate.h') diff --git a/src/mint/taler-mint-httpd_keystate.h b/src/mint/taler-mint-httpd_keystate.h index 4b700d1c1..d72538a13 100644 --- a/src/mint/taler-mint-httpd_keystate.h +++ b/src/mint/taler-mint-httpd_keystate.h @@ -35,49 +35,7 @@ * Snapshot of the (coin and signing) * keys (including private keys) of the mint. */ -struct MintKeyState -{ - /** - * When did we initiate the key reloading? - */ - struct GNUNET_TIME_Absolute reload_time; - - /** - * JSON array with denomination keys. - */ - json_t *denom_keys_array; - - /** - * JSON array with signing keys. - */ - json_t *sign_keys_array; - - /** - * Mapping from denomination keys to denomination key issue struct. - */ - struct GNUNET_CONTAINER_MultiHashMap *denomkey_map; - - /** - * When is the next key invalid and we have to reload? - */ - struct GNUNET_TIME_Absolute next_reload; - - /** - * Mint signing key that should be used currently. - */ - struct TALER_MINT_SignKeyIssuePriv current_sign_key_issue; - - /** - * Cached JSON text that the mint will send for - * a /keys request. - */ - char *keys_json; - - /** - * Reference count. - */ - unsigned int refcnt; -}; +struct MintKeyState; /** @@ -135,5 +93,22 @@ TALER_MINT_keys_sign (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, struct GNUNET_CRYPTO_EddsaSignature *sig); +/** + * Handle a "/keys" request + * + * @param rh context of the handler + * @param connection the MHD connection to handle + * @param[IN|OUT] connection_cls the connection's closure (can be updated) + * @param upload_data upload data + * @param[IN|OUT] upload_data_size number of bytes (left) in @a upload_data + * @return MHD result code + */ +int +TALER_MINT_handler_keys (struct RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size); + #endif -- cgit v1.2.3