struct shared_secret_cache_key {
/** the hash table key */
uint8_t key[DNSCRYPT_SHARED_SECRET_KEY_LENGTH];
- /** the hash table entry, data is struct reply_info* */
+ /** the hash table entry, data is uint8_t pointer of size crypto_box_BEFORENMBYTES which contains the shared secret. */
struct lruhash_entry entry;
};
env->shared_secrets_cache = slabhash_create(
cfg->msg_cache_slabs,
HASH_DEFAULT_STARTARRAY,
- cfg->msg_cache_size,
+ 4000000,
dnsc_shared_secrets_sizefunc,
dnsc_shared_secrets_compfunc,
dnsc_shared_secrets_delkeyfunc,
*/
size_t
-dnsc_shared_secrets_sizefunc(void *k, void *d)
+dnsc_shared_secrets_sizefunc(void *k, void* ATTR_UNUSED(d))
{
struct shared_secret_cache_key* ssk = (struct shared_secret_cache_key*)k;
size_t key_size = sizeof(struct shared_secret_cache_key)
+ lock_get_mem(&ssk->entry.lock);
size_t data_size = crypto_box_BEFORENMBYTES;
+ (void)ssk; /* otherwise ssk is unused if no threading, or fixed locksize */
return key_size + data_size;
}
- iana portlist update
- Fix #1415: [dnscrypt] shared secret cache, patch from
Manu Bretelle.
+ - Small fixes for the shared secret cache patch.
23 August 2017: Wouter
- Fix #1407: Add ECS options check to unbound-checkconf.