mirror of
https://github.com/curl/curl.git
synced 2026-08-10 07:50:54 +03:00
lib: TLS session ticket caching reworked
Described in detail in internal doc TLS-SESSIONS.md Main points: - use a new `ssl_peer_key` for cache lookups by connection filters - recognize differences between TLSv1.3 and other tickets * TLSv1.3 tickets are single-use, cache can hold several of them for a peer * TLSv1.2 are reused, keep only a single one per peer - differentiate between ticket BLOB to store (that could be persisted) and object instances - use put/take/return pattern for cache access - remember TLS version, ALPN protocol, time received and lifetime of ticket - auto-expire tickets after their lifetime Closes #15774
This commit is contained in:
parent
e5e2e09a75
commit
fa0ccd9f1f
36 changed files with 1784 additions and 780 deletions
25
lib/llist.c
25
lib/llist.c
|
|
@ -134,16 +134,12 @@ Curl_llist_append(struct Curl_llist *list, const void *p,
|
|||
Curl_llist_insert_next(list, list->_tail, p, ne);
|
||||
}
|
||||
|
||||
/*
|
||||
* @unittest: 1300
|
||||
*/
|
||||
void
|
||||
Curl_node_uremove(struct Curl_llist_node *e, void *user)
|
||||
void *Curl_node_take_elem(struct Curl_llist_node *e)
|
||||
{
|
||||
void *ptr;
|
||||
struct Curl_llist *list;
|
||||
if(!e)
|
||||
return;
|
||||
return NULL;
|
||||
|
||||
list = e->_list;
|
||||
DEBUGASSERT(list);
|
||||
|
|
@ -179,8 +175,23 @@ Curl_node_uremove(struct Curl_llist_node *e, void *user)
|
|||
#endif
|
||||
|
||||
--list->_size;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/* call the dtor() last for when it actually frees the 'e' memory itself */
|
||||
/*
|
||||
* @unittest: 1300
|
||||
*/
|
||||
void
|
||||
Curl_node_uremove(struct Curl_llist_node *e, void *user)
|
||||
{
|
||||
struct Curl_llist *list;
|
||||
void *ptr;
|
||||
if(!e)
|
||||
return;
|
||||
|
||||
list = e->_list;
|
||||
DEBUGASSERT(list);
|
||||
ptr = Curl_node_take_elem(e);
|
||||
if(list->_dtor)
|
||||
list->_dtor(user, ptr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue