create random cookies by creating and storing a random state in infra_cache

This commit is contained in:
TCY16
2022-05-19 14:55:26 +02:00
parent 44af84dfc9
commit 10dee6cee1
3 changed files with 22 additions and 8 deletions
+2 -1
View File
@@ -469,11 +469,12 @@ infra_test(void)
struct infra_key* k;
struct infra_data* d;
int init = 376;
struct ub_randstate* rnd = ub_initstate(NULL);
unit_show_feature("infra cache");
unit_assert(ipstrtoaddr("127.0.0.1", 53, &one, &onelen));
slab = infra_create(cfg);
slab = infra_create(cfg, rnd);
unit_assert( infra_host(slab, &one, onelen, zone, zonelen, now,
&vs, &edns_lame, &to) );
unit_assert( vs == 0 && to == init && edns_lame == 0 );