diff --git a/lib/cookies/control.c b/lib/cookies/control.c index 6e0fec3c502e21f8d70f9b94dc14eb3d0b99eb31..28e6c46e9d7603ed8d0c5456430858ec315d3906 100644 --- a/lib/cookies/control.c +++ b/lib/cookies/control.c @@ -28,6 +28,4 @@ void kr_cookie_ctx_init(struct kr_cookie_ctx *ctx) ctx->clnt.current.alg_id = ctx->clnt.recent.alg_id = -1; ctx->srvr.current.alg_id = ctx->srvr.recent.alg_id = -1; - - ctx->cache_ttl = DFLT_COOKIE_TTL; } diff --git a/lib/cookies/control.h b/lib/cookies/control.h index beb544c2c281bd30bb0fb27d127ac4bffa92b9a1..40fd610388b84c4f15f40037f8b7823796ae9671 100644 --- a/lib/cookies/control.h +++ b/lib/cookies/control.h @@ -28,9 +28,6 @@ struct kr_cookie_secret { uint8_t data[]; /*!< Secret quantity data. */ }; -/** Default cookie TTL. */ -#define DFLT_COOKIE_TTL 72000 - /** Holds settings that have direct influence on cookie values computation. */ struct kr_cookie_comp { struct kr_cookie_secret *secr; /*!< Secret data. */ @@ -49,8 +46,6 @@ struct kr_cookie_settings { struct kr_cookie_ctx { struct kr_cookie_settings clnt; /**< Client settings. */ struct kr_cookie_settings srvr; /**< Server settings. */ - - uint32_t cache_ttl; /**< TTL used when caching cookies */ }; /** diff --git a/modules/cookiectl/README.rst b/modules/cookiectl/README.rst index a00b940aa1d0a93a052a64d2b4b089e625e16c5c..7e3a73029016e68725350ef1a482a567e526683a 100644 --- a/modules/cookiectl/README.rst +++ b/modules/cookiectl/README.rst @@ -18,9 +18,6 @@ Example Configuration cookiectl.config( { ['client_secret'] = { 0, 1, 2, 3, 4, 5, 6, 7 }, ['client_cookie_alg'] = 'FNV-64' } ) - -- Cache received server cookies for 12 hours. - cookiectl.config( { ['cache_ttl'] = 43200 } ) - -- Configure the server part of the resolver. Sets a string to be used -- as server secret. Also chooses the hashing algorithm to be used. cookiectl.config( { ['server_secret'] = 'secret key', diff --git a/modules/cookiectl/cookiectl.c b/modules/cookiectl/cookiectl.c index fe62a765e519996d3b986cc1d312a746036a709a..6182a55c926977a1762cef9e13ef9d4bafedfd7b 100644 --- a/modules/cookiectl/cookiectl.c +++ b/modules/cookiectl/cookiectl.c @@ -38,8 +38,6 @@ #define NAME_SERVER_COOKIE_ALG "server_cookie_alg" #define NAME_AVAILABLE_SERVER_COOKIE_ALGS "available_server_cookie_algs" -#define NAME_CACHE_TTL "cache_ttl" - static bool aply_enabled(bool *enabled, const JsonNode *node) { assert(enabled && node); @@ -161,18 +159,6 @@ static bool apply_hash_func(int *alg_id, const JsonNode *node, return false; } -static bool apply_cache_ttl(uint32_t *cache_ttl, const JsonNode *node) -{ - assert(cache_ttl && node); - - if (node->tag == JSON_NUMBER) { - *cache_ttl = node->number_; - return true; - } - - return false; -} - static bool apply_configuration(struct kr_cookie_ctx *cntrl, const JsonNode *node) { @@ -190,8 +176,6 @@ static bool apply_configuration(struct kr_cookie_ctx *cntrl, } else if (strcmp(node->key, NAME_CLIENT_COOKIE_ALG) == 0) { return apply_hash_func(&cntrl->clnt.current.alg_id, node, kr_cc_alg_names); - } else if (strcmp(node->key, NAME_CACHE_TTL) == 0) { - return apply_cache_ttl(&cntrl->cache_ttl, node); } else if (strcmp(node->key, NAME_SERVER_ENABLED) == 0) { return aply_enabled(&cntrl->srvr.enabled, node); } else if (strcmp(node->key, NAME_SERVER_SECRET) == 0) { @@ -296,7 +280,6 @@ static void apply_from_copy(struct kr_cookie_ctx *running, } /* Direct application. */ - running->cache_ttl = shallow->cache_ttl; running->clnt.enabled = shallow->clnt.enabled; running->srvr.enabled = shallow->srvr.enabled; } @@ -370,9 +353,6 @@ char *read_config(struct kr_cookie_ctx *ctx) read_available_hashes(root_node, NAME_AVAILABLE_CLIENT_COOKIE_ALGS, kr_cc_alg_names); - json_append_member(root_node, NAME_CACHE_TTL, - json_mknumber(ctx->cache_ttl)); - json_append_member(root_node, NAME_SERVER_ENABLED, json_mkbool(ctx->srvr.enabled));